public class CacheableCallSite
extends MutableCallSite
Represents a cacheable call site, which can reduce the cost of resolving methods
| Constructor and description |
|---|
CacheableCallSite(MethodType type, Lookup lookup)Creates a cacheable call site for the supplied type and lookup context. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public MethodHandleWrapper |
getAndPut(String className, org.codehaus.groovy.runtime.memoize.MemoizeCache.ValueProvider<? super String, ? extends MethodHandleWrapper> valueProvider)Returns a cached method-handle wrapper for the receiver class, computing and storing it if needed. |
|
public MethodHandle |
getDefaultTarget()Returns the default target currently installed on this call site. |
|
public AtomicLong |
getFallbackRound()Returns the fallback round counter. |
|
public MethodHandle |
getFallbackTarget()Returns the fallback target used when guards fail. |
|
public Lookup |
getLookup()Returns the lookup associated with this call site. |
|
public long |
incrementFallbackCount()Increments the number of fallback executions for this call site. |
|
public MethodHandleWrapper |
put(String name, MethodHandleWrapper mhw)Stores a method-handle wrapper under the supplied cache key. |
|
public void |
resetFallbackCount()Resets the fallback count and advances the fallback round marker. |
|
public void |
setDefaultTarget(MethodHandle defaultTarget)Stores the default target for this call site. |
|
public void |
setFallbackTarget(MethodHandle fallbackTarget)Stores the fallback target used when guards fail. |
Creates a cacheable call site for the supplied type and lookup context.
type - the call-site typelookup - the lookup used to unreflect targetsReturns a cached method-handle wrapper for the receiver class, computing and storing it if needed.
className - the receiver cache keyvalueProvider - the provider used to compute a missing entryReturns the default target currently installed on this call site.
Returns the fallback round counter.
Returns the fallback target used when guards fail.
Returns the lookup associated with this call site.
Increments the number of fallback executions for this call site.
Stores a method-handle wrapper under the supplied cache key.
name - the receiver cache keymhw - the wrapper to cachenull if none existedResets the fallback count and advances the fallback round marker.
Stores the default target for this call site.
defaultTarget - the default target handleStores the fallback target used when guards fail.
fallbackTarget - the fallback target handleCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.