public @interface GenerateUncached
getUncached() on the generated node.
The generated code for the uncached version is based on the specialization closure. The
specialization closure only includes specializations that were are not replaced by others. This,
for example, automatically excludes inline caches from the closure. Uses of the Cached
annotation will automatically use getUncached instead of a cached
version to initialize the cache.
A node subclass must fullfill the following requirements in order to be uncachable:
Cached parameters provide valid uncached
initializers.
NodeChild or NodeField annotations.
Example:
@GenerateUncached
abstract static class UncachableNode extends Node {
abstract Object execute(Object arg);
@Specialization(guards = "v == cachedV")
static Object doCached(int v, @Cached("v") int cachedV) {
// do cached
}
@Specialization(replaces = "doCached")
static String doGeneric(int v) {
// do uncached
}
}
This node produces the following uncached version of the execute method:
@Override
Object execute(Object arg0Value) {
if (arg0Value instanceof Integer) {
int arg0Value_ = (int) arg0Value;
return UncachableNode.doGeneric(arg0Value_);
}
throw new UnsupportedSpecializationException(this, new Node[]{null}, arg0Value);
}
Cached