< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java
Print this page
@@ -52,10 +52,11 @@
import jdk.vm.ci.meta.ConstantReflectionProvider;
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.MetaAccessProvider;
import jdk.vm.ci.meta.PrimitiveConstant;
+import jdk.vm.ci.meta.ResolvedJavaType;
/**
* The {@code ConstantNode} represents a {@link Constant constant}.
*/
@NodeInfo(nameTemplate = "C({p#rawvalue}) {p#stampKind}", cycles = CYCLES_0, size = SIZE_1)
@@ -97,10 +98,14 @@
} else {
this.isDefaultStable = isDefaultStable;
}
}
+ public ConstantNode(@InjectedNodeParameter Stamp stamp, @InjectedNodeParameter ConstantReflectionProvider constantReflection, @ConstantNodeParameter ResolvedJavaType type) {
+ this(constantReflection.asJavaClass(type), stamp);
+ }
+
/**
* @return the constant value represented by this node
*/
public Constant getValue() {
return value;
@@ -544,6 +549,9 @@
if (length == null) {
return null;
}
return ConstantNode.forInt(length);
}
+
+ @NodeIntrinsic
+ public static native Class<?> forClass(@ConstantNodeParameter ResolvedJavaType type);
}
< prev index next >