public class KnownIntrinsics extends Object
Constructor and Description |
---|
KnownIntrinsics() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
convertUnknownValue(Object obj,
Class<T> type)
This method is a helper for the static analysis.
|
static void |
farReturn(Object result,
org.graalvm.word.Pointer sp,
org.graalvm.nativeimage.c.function.CodePointer ip,
boolean fromMethodWithCalleeSavedRegisters)
Continues execution in the specified caller frame, at the specified instruction pointer.
|
static org.graalvm.word.Pointer |
heapBase()
Returns the value of the heap base.
|
static boolean |
isDeoptimizationTarget()
For deoptimization testing only.
|
static org.graalvm.word.Pointer |
nonNullPointer(org.graalvm.word.Pointer pointer)
Narrow down the range of values to exclude 0 as the possible pointer value.
|
static int |
readArrayLength(Object array)
Returns the length of the given array.
|
static org.graalvm.word.Pointer |
readCallerStackPointer()
Returns the value of the native stack pointer for the physical caller frame.
|
static DynamicHub |
readHub(Object obj)
Returns the hub of the given object.
|
static org.graalvm.nativeimage.c.function.CodePointer |
readReturnAddress()
Returns the value of the native instruction pointer for the physical caller frame.
|
static org.graalvm.word.Pointer |
readStackPointer()
Returns the value of the native stack pointer.
|
static void |
testDeoptimize()
For deoptimization testing only.
|
public static org.graalvm.word.Pointer heapBase()
public static int readArrayLength(Object array)
public static DynamicHub readHub(Object obj)
public static org.graalvm.word.Pointer nonNullPointer(org.graalvm.word.Pointer pointer)
pointer
- that we are narrowing to non-nullpublic static org.graalvm.word.Pointer readStackPointer()
public static org.graalvm.word.Pointer readCallerStackPointer()
NeverInline
to ensure that the
physical caller frame is deterministic.public static org.graalvm.nativeimage.c.function.CodePointer readReturnAddress()
NeverInline
to ensure that the
physical caller frame is deterministic.public static void farReturn(Object result, org.graalvm.word.Pointer sp, org.graalvm.nativeimage.c.function.CodePointer ip, boolean fromMethodWithCalleeSavedRegisters)
public static void testDeoptimize()
public static boolean isDeoptimizationTarget()
true
in a deoptimization target method
and to false
in a deoptimization source method.public static <T> T convertUnknownValue(Object obj, Class<T> type)
Object.class
is specified no actual
type reduction is done.
The method has a default implementation which just returns the obj parameter because it can
used in places that are reached at runtime (hence analyzed) but also during image building
(e.g., SharedConstantReflectionProvider.unboxPrimitive(JavaConstant)).
For the analysis case a call to it is intercepted in
SubstrateGraphBuilderPlugins.registerKnownIntrinsicsPlugins() and replaced with a
ConvertUnknownValueNode which later is processed during analysis type flow graph building.