Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/doc/compiler/aot/RelocationRecords.md
6000 views

This document describes at a high level what the various relocation records are used for. The exact data stored into the SCC can be found in initializeCommonAOTRelocationHeader and the various initializePlatformSpecificAOTRelocationHeader functions. Similarly, the exact type of the API class for each relocation kind can be found in TR_RelocationRecord::create.

Traditional (non-SVM) Validation Records

KindDescription
TR_ValidateInstanceFieldValidates the class of an instance field.
TR_ValidateStaticFieldValidates the class of a static field.
TR_ValidateClassValidates a class.
TR_ValidateArbitraryClassValidates a J9Class acquired in a manner other than by name or cpIndex.

SVM Validation Records

KindDescription
TR_ValidateClassByNameValidates a class acquired by name.
TR_ValidateProfiledClassValidates a class acquired through profiling.
TR_ValidateClassFromCPValidates a class acquired from a constant pool.
TR_ValidateDefiningClassFromCPValidates a defining class acquired from a constant pool.
TR_ValidateStaticClassFromCPValidates a static class acquired from a constant pool.
TR_ValidateArrayClassFromComponentClassValidates either the array class of a class, or the component class of an array class.
TR_ValidateSuperClassFromClassValidates the super class of a class.
TR_ValidateClassInstanceOfClassValidates whether a class is an instance of another class.
TR_ValidateSystemClassByNameValidates a system class acquired by name.
TR_ValidateClassFromITableIndexCPValidates an interface class from a constant pool.
TR_ValidateDeclaringClassFromFieldOrStaticValidates the declaring class from an instance or static field.
TR_ValidateConcreteSubClassFromClassValidates the concrete subclass from a class (uses the Persistent CH Table).
TR_ValidateClassChainValidates the Class Chain of a class.
TR_ValidateMethodFromClassValidates a method acquired from a class.
TR_ValidateStaticMethodFromCPValidates a static method acquired from a constant pool.
TR_ValidateSpecialMethodFromCPValidates a special method acquired from a constant pool.
TR_ValidateVirtualMethodFromCPValidates a virtual method acquired from a constant pool.
TR_ValidateVirtualMethodFromOffsetValidates a virtual method acquired from an offset.
TR_ValidateInterfaceMethodFromCPValidates a interface method acquired from a constant pool.
TR_ValidateMethodFromClassAndSigValidates a method acquired using a class and signature.
TR_ValidateStackWalkerMaySkipFramesRecordValidates whether the stack walker may skip frames.
TR_ValidateClassInfoIsInitializedValidates whether a class is initialized based on the corresponding class info in the Persistent CH Table.
TR_ValidateMethodFromSingleImplementerValidates whether a method is a single implementer (uses the Persistent CH Table).
TR_ValidateMethodFromSingleInterfaceImplementerValidates whether a method is a single interface implementer (uses the Persistent CH Table).
TR_ValidateMethodFromSingleAbstractImplementerValidates whether a method is a single abstract implementer (uses the Persistent CH Table).
TR_ValidateImproperInterfaceMethodFromCPValidates an improper interface method acquired from a constant pool (nestmates).

Inlined Method Validation / Metadata Relocation Records

KindDescription
TR_InlinedStaticMethodWithNopGuardValidates the J9Method of an inlined static method, relocates the appropriate entry in the inlining table in the J9JITExceptionTable, and registers a runtime assumption for the guard; or patches the guard to jump to the slow path on failure.
TR_InlinedSpecialMethodWithNopGuardValidates the J9Method of an inlined special method, relocates the appropriate entry in the inlining table in the J9JITExceptionTable, and registers a runtime assumption for the guard; or patches the guard to jump to the slow path on failure.
TR_InlinedVirtualMethodWithNopGuardValidates the J9Method of an inlined virtual method, relocates the appropriate entry in the inlining table in the J9JITExceptionTable, and registers a runtime assumption for the guard; or patches the guard to jump to the slow path on failure.
TR_InlinedInterfaceMethodWithNopGuardValidates the J9Method of an inlined interface method, relocates the appropriate entry in the inlining table in the J9JITExceptionTable, and registers a runtime assumption for the guard; or patches the guard to jump to the slow path on failure.
TR_InlinedAbstractMethodWithNopGuardValidates the J9Method of an inlined abstract method, relocates the appropriate entry in the inlining table in the J9JITExceptionTable, and registers a runtime assumption for the guard; or patches the guard to jump to the slow path on failure.
TR_InlinedStaticMethodValidates the J9Method of an inlined static method and relocates the appropriate entry in the inlining table in the J9JITExceptionTable.
TR_InlinedSpecialMethodValidates the J9Method of an inlined special method and relocates the appropriate entry in the inlining table in the J9JITExceptionTable.
TR_InlinedInterfaceMethodValidates the J9Method of an inlined interface method and relocates the appropriate entry in the inlining table in the J9JITExceptionTable.
TR_InlinedVirtualMethodValidates the J9Method of an inlined virtual method and relocates the appropriate entry in the inlining table in the J9JITExceptionTable.
TR_InlinedAbstractMethodValidates the J9Method of an inlined abstract method and relocates the appropriate entry in the inlining table in the J9JITExceptionTable.
TR_ProfiledMethodGuardRelocationValidates the J9Method used in a profiled method guard and relocates the appropriate entry in the inlining table in the J9JITExceptionTable.
TR_ProfiledClassGuardRelocationValidates the J9Class used in a profiled class guard and relocates the appropriate entry in the inlining table in the J9JITExceptionTable.
TR_ProfiledInlinedMethodRelocationValidates the J9Method of a profiled inlined method and relocates the appropriate entry in the inlining table in the J9JITExceptionTable.

Relocation Records

KindDescription
TR_NoRelocationIndicates no relocation record is necessary.
TR_HelperAddressRelocates a helper offset relative to the address of the instruction being relocated.
TR_AbsoluteHelperAddressRelocates the absolute address of a helper.
TR_ArrayCopyHelperRelocates the address of the Array Copy Helper.
TR_ArrayCopyTocOnly used on POWER. Relocates the address of the TOC for the Array Copy Helper.
TR_RelativeMethodAddressRelocates an address that is within the method being compiled.
TR_AbsoluteMethodAddressRelocates an address that is within the method being compiled.
TR_AbsoluteMethodAddressOrderedPairRelocates an address that is within the method being compiled. The exact method of relocation depends on the sequence enum specified.
TR_FixedSequenceAddressOnly used on POWER. Relocates the load of a 64 bit address of a label in the method being compiled. The exact method of relocation depends on the sequence enum specified.
TR_FixedSequenceAddress2Relocates the load of an address in the method being compiled. The exact method of relocation depends on the sequence enum specified.
TR_BodyInfoAddressRelocates the address to the TR_PersistentJittedBodyInfo for the method being compiled. Also relocates some fields, as well as the TR_PersistentMethodInfo.
TR_BodyInfoAddressLoadRelocates the address to the TR_PersistentJittedBodyInfo for the method being compiled.
TR_CheckMethodEnterPatches the code if method enter tracing is enabled. Note, the AOT code should have been compiled with the assumption that tracing could be enabled.
TR_CheckMethodExitPatches the code if method enter tracing is enabled. Note, the AOT code should have been compiled with the assumption that tracing could be enabled.
TR_JNIVirtualTargetAddressRelocates the start address of a virtual JNI method.
TR_JNIStaticTargetAddressRelocates the start address of a static JNI method.
TR_JNISpecialTargetAddressRelocates the start address of a special JNI method.
TR_SpecialRamMethodConstRelocates the J9Method of a special method.
TR_VirtualRamMethodConstRelocates the J9Method of a virtual method.
TR_StaticRamMethodConstRelocates the J9Method of a static method.
TR_ThunksRegisters a J2I thunk; if the thunk exists in the SCC, it loads it out and relocates it first. Also relocates a pointer to the J9ConstantPool.
TR_J2IVirtualThunkPointerRelocates like TR_Thunks but additionally relocates pointers to the J2I thunk.
TR_MethodPointerRelocates a J9Method pointer acquired via profiling. Only used without the SVM.
TR_ClassPointerRelocates a J9Class pointer acquired via profiling. Only used without the SVM.
TR_InlinedMethodPointerRelocates a J9Method pointer acquired via profiling that also happens to be inlined into the method being compiled. Only used without the SVM.
TR_ClassAddressRelocates the address of a class. Only used without the SVM.
TR_ArbitraryClassAddressValidates classes that would normally validate like a TR_ClassAddress but contains a cpIndex of -1, so must be validated differently. This record is limited to classes loaded by the bootstrap class loader. Only used without the SVM.
TR_RamMethodRelocates the J9Method pointer of the method being compiled.
TR_RamMethodSequenceRelocates the J9Method pointer of the method being compiled based on the sequence enum specified.
TR_DataAddressRelocates the address of a Java static.
TR_MethodObjectRelocates the address of a field in a J9ConstantPool struct.
TR_ConstantPoolRelocates a J9ConstantPool * pointer; the pointer has to be the constant pool the method being compiled or one of the inlined methods.
TR_VerifyClassObjectForAllocValidates the class of an inlined object allocation. Patches the guard to the slow path if invalid.
TR_VerifyRefArrayForAllocValidates the class of an inlined array object allocation. Patches the guard to the slow path if invalid.
TR_TrampolinesReserves an unresolved trampoline. Also relocates a pointer to the J9ConstantPool.
TR_ResolvedTrampolinesReserves a resolved trampoline. Only used with the SVM.
TR_PicTrampolinesOnly used on x86. Reserves the necessary number of trampolines used for PICs.
TR_GlobalValueRelocates a value materialized from the global value table indexed via the TR_GlobalValueItem enum.
TR_HCRCreates HCR Runtime Assumptions against the J9Method of the method being compiled.
TR_EmitClassUsed when Hardware Profiling is enabled. Used to associate an instruction with the bytecode PC for value profiling.
TR_DebugCounterMaterializes a Debug Counter and relocates pointers to the counter.
TR_ClassUnloadAssumptionRegisters a runtime assumption at the specified location in the code to trigger if any class gets unloaded.
TR_BlockFrequencyRelocates pointer to the JProfiling block frequency counter.
TR_RecompQueuedFlagRelocates the address of the queued for recompilation flag in the TR_BlockFrequencyInfo object in the TR_PersistentJittedBodyInfo of the method being compiled.
TR_BreakpointRelocates Break Point guards used in FSD.
TR_VMINLMethodRelocates the J9Method of a VMINL method.
TR_SymbolFromManagerRelocates a pointer materialized by using its SVM ID.
TR_DiscontiguousSymbolFromManagerRelocates a discontiguous pointer materialized by using its SVM ID.
TR_MethodCallAddressRelocates the address of a call target. Only used in JitServer (in AOT, all other methods are assumed to be interpreted).