Skip to content

Commit

Permalink
Relocation Record files addition
Browse files Browse the repository at this point in the history
The added files are: OMRRelocationRecord.hpp, OMRRelocationRecord.cpp,
OMRExternalRelocationsKindToHeaderSizeMap.hpp. These files contain
RelocationRecord, RelocationRecordGroup,RelocationRecordBinaryTemplate
classes. The RelocationRecordGroup is an iterator for application of
relocations. The RelocationRecordBinaryTemplate is the class that has
RelocationRecord information. Those classes realize core relocations
storage functionality in OpenJ9, but are language independent and thus
are worth including into OMR. The
OMRExternalRelocationsKindToHeaderSizeMap.hpp is an attempt for
improving extension, similarly to codeGenPhases, by including headers
with relocation sizes from consuming projects. Compared to OpenJ9, the
RelocationRecord classes became extensible. Another proposed change is
in the creation of relocation records: the implementation of
TR::RelocationRecord::create function is proposed to be done as a
function in corresponding relocationRecord class. The
RelocationRecordBinaryTemplate, has undergone changes to improve
readability and portability: the setSize() and setType(), as well as
x64 architecture specific setExtra() and their corresponding accessor
methods are now  RelocationTarget API calls, as advised in Issue eclipse-omr#3031
[skip ci]

Signed-off-by: Georgiy Krylov <[email protected]>
  • Loading branch information
georgkrylov committed Nov 10, 2019
1 parent fa59bff commit 1f36a73
Show file tree
Hide file tree
Showing 3 changed files with 827 additions and 0 deletions.
190 changes: 190 additions & 0 deletions compiler/runtime/OMRExternalRelocationsKindToHeaderSizeMap.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at http://eclipse.org/legal/epl-2.0
* or the Apache License, Version 2.0 which accompanies this distribution
* and is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License, v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception [1] and GNU General Public
* License, version 2 with the OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/
// The project specific relocation header sizes should be included to at end of this file
#if defined (TR_HOST_64BIT)
24, // TR_ConstantPool = 0
8, // TR_HelperAddress = 1
24, // TR_RelativeMethodAddress = 2
8, // TR_AbsoluteMethodAddress = 3
0, // TR_DataAddress = 4
24, // TR_ClassObject = 5
24, // TR_MethodObject = 6
24, // TR_InterfaceObject = 7
8, // TR_AbsoluteHelperAddress = 8
16, // TR_FixedSeqAddress = 9
16, // TR_FixedSeq2Address = 10
32, // TR_JNIVirtualTargetAddress = 11
32, // TR_JNIStaticTargetAddress = 12
4, // Dummy for TR_ArrayCopyHelper = 13
4, // Dummy for TR_ArrayCopyToc = 14
8, // TR_BodyInfoAddress = 15
24, // TR_Thunks = 16
32, // TR_StaticRamMethodConst = 17
24, // TR_Trampolines = 18
8, // TR_PicTrampolines = 19
16, // TR_CheckMethodEnter = 20
8, // TR_RamMethod = 21
16, // TR_RamMethodSequence = 22
16, // TR_RamMethodSequenceReg = 23
48, // TR_VerifyClassObjectForAlloc = 24
24, // TR_ConstantPoolOrderedPair = 25
8, // TR_AbsoluteMethodAddressOrderedPair = 26
40, // TR_VerifyRefArrayForAlloc = 27
24, // TR_J2IThunks = 28
16, // TR_GlobalValue = 29
4, // dummy for TR_BodyInfoAddress = 30
40, // TR_ValidateInstanceField = 31
48, // TR_InlinedStaticMethodWithNopGuard = 32
48, // TR_InlinedSpecialMethodWithNopGuard = 33
48, // TR_InlinedVirtualMethodWithNopGuard = 34
48, // TR_InlinedInterfaceMethodWithNopGuard = 35
32, // TR_SpecialRamMethodConst = 36
48, // TR_InlinedHCRMethod = 37
40, // TR_ValidateStaticField = 38
40, // TR_ValidateClass = 39
32, // TR_ClassAddress = 40
16, // TR_HCR = 41
64, // TR_ProfiledMethodGuardRelocation = 42
64, // TR_ProfiledClassGuardRelocation = 43
0, // TR_HierarchyGuardRelocation = 44
0, // TR_AbstractGuardRelocation = 45
64, // TR_ProfiledInlinedMethodRelocation = 46
40, // TR_MethodPointer = 47
32, // TR_ClassPointer = 48
16, // TR_CheckMethodExit = 49
24, // TR_ValidateArbitraryClass = 50
0, // TR_EmitClass(not used) = 51
32, // TR_JNISpecialTargetAddress = 52
32, // TR_VirtualRamMethodConst = 53
40, // TR_InlinedInterfaceMethod = 54
40, // TR_InlinedVirtualMethod = 55
0, // TR_NativeMethodAbsolute = 56,
0, // TR_NativeMethodRelative = 57,
32, // TR_ArbitraryClassAddress = 58,
56, // TR_DebugCounter = 59
8, // TR_ClassUnloadAssumption = 60
32, // TR_J2IVirtualThunkPointer = 61,
48, // TR_InlinedAbstractMethodWithNopGuard = 62,
0, // TR_ValidateRootClass = 63,
0, // sizeof(TR_RelocationRecordValidateClassByNameBinaryTemplate), // TR_ValidateClassByName = 64,
0, // sizeof(TR_RelocationRecordValidateProfiledClassBinaryTemplate), // TR_ValidateProfiledClass = 65,
0, // sizeof(TR_RelocationRecordValidateClassFromCPBinaryTemplate), // TR_ValidateClassFromCP = 66,
0, // sizeof(TR_RelocationRecordValidateDefiningClassFromCPBinaryTemplate),//TR_ValidateDefiningClassFromCP = 67,
0, // sizeof(TR_RelocationRecordValidateStaticClassFromCPBinaryTemplate), // TR_ValidateStaticClassFromCP = 68,
0, // TR_ValidateClassFromMethod = 69,
0, // TR_ValidateComponentClassFromArrayClass= 70,
0, // sizeof(TR_RelocationRecordValidateArrayFromCompBinaryTemplate), // TR_ValidateArrayClassFromComponentClass= 71,
0, // sizeof(TR_RelocationRecordValidateSuperClassFromClassBinaryTemplate),//TR_ValidateSuperClassFromClass = 72,
0, // sizeof(TR_RelocationRecordValidateClassInstanceOfClassBinaryTemplate),//TR_ValidateClassInstanceOfClass = 73,
0, // sizeof(TR_RelocationRecordValidateSystemClassByNameBinaryTemplate), //TR_ValidateSystemClassByName = 74,
0, // sizeof(TR_RelocationRecordValidateClassFromITableIndexCPBinaryTemplate),//TR_ValidateClassFromITableIndexCP = 75,
0, // sizeof(TR_RelocationRecordValidateDeclaringClassFromFieldOrStaticBinaryTemplate),//TR_ValidateDeclaringClassFromFieldOrStatic=76,
0, // TR_ValidateClassClass = 77,
0, // sizeof(TR_RelocationRecordValidateConcreteSubFromClassBinaryTemplate),//TR_ValidateConcreteSubClassFromClass = 78,
0, // sizeof(TR_RelocationRecordValidateClassChainBinaryTemplate), // TR_ValidateClassChain = 79,
0, // TR_ValidateRomClass = 80,
0, // TR_ValidatePrimitiveClass = 81,
0, // TR_ValidateMethodFromInlinedSite = 82,
0, // TR_ValidatedMethodByName = 83,
0, // sizeof(TR_RelocationRecordValidateMethodFromClassBinaryTemplate), // TR_ValidatedMethodFromClass = 84,
0, // sizeof(TR_RelocationRecordValidateStaticMethodFromCPBinaryTemplate),// TR_ValidateStaticMethodFromCP = 85,
0, // sizeof(TR_RelocationRecordValidateSpecialMethodFromCPBinaryTemplate),//TR_ValidateSpecialMethodFromCP = 86,
0, // sizeof(TR_RelocationRecordValidateVirtualMethodFromCPBinaryTemplate),//TR_ValidateVirtualMethodFromCP = 87,
0, // sizeof(TR_RelocationRecordValidateVirtualMethodFromOffsetBinaryTemplate),//TR_ValidateVirtualMethodFromOffset = 88,
0, // sizeof(TR_RelocationRecordValidateInterfaceMethodFromCPBinaryTemplate),//TR_ValidateInterfaceMethodFromCP = 89,
0, // sizeof(TR_RelocationRecordValidateMethodFromClassAndSigBinaryTemplate),//TR_ValidateMethodFromClassAndSig = 90,
0, // sizeof(TR_RelocationRecordValidateStackWalkerMaySkipFramesBinaryTemplate),//TR_ValidateStackWalkerMaySkipFramesRecord= 91,
0, // TR_ValidateArrayClassFromJavaVM = 92,
0, // sizeof(TR_RelocationRecordValidateClassInfoIsInitializedBinaryTemplate),//TR_ValidateClassInfoIsInitialized = 93,
0, // sizeof(TR_RelocationRecordValidateMethodFromSingleImplBinaryTemplate),//TR_ValidateMethodFromSingleImplementer= 94,
0, // sizeof(TR_RelocationRecordValidateMethodFromSingleInterfaceImplBinaryTemplate),//TR_ValidateMethodFromSingleInterfaceImplementer= 95,
0, // sizeof(TR_RelocationRecordValidateMethodFromSingleAbstractImplBinaryTemplate),//TR_ValidateMethodFromSingleAbstractImplementer= 96,
0, // sizeof(TR_RelocationRecordValidateImproperInterfaceMethodFromCPBinaryTemplate),//TR_ValidateImproperInterfaceMethodFromCP= 97,
0, // sizeof(TR_RelocationRecordSymbolFromManagerBinaryTemplate), // TR_SymbolFromManager = 98,
0, //100
0, // 101
#else

12, // TR_ConstantPool = 0
8, // TR_HelperAddress = 1
12, // TR_RelativeMethodAddress = 2
4, // TR_AbsoluteMethodAddress = 3
20, // TR_DataAddress = 4
12, // TR_ClassObject = 5
12, // TR_MethodObject = 6
12, // TR_InterfaceObject = 7
8, // TR_AbsoluteHelperAddress = 8
8, // TR_FixedSeqAddress = 9
8, // TR_FixedSeq2Address = 10
16, // TR_JNIVirtualTargetAddress = 11
16, // TR_JNIStaticTargetAddress = 12
4, // Dummy for TR_ArrayCopyHelper = 13
4, // Dummy for TR_ArrayCopyToc = 14
4, // TR_BodyInfoAddress = 15
12, // TR_Thunks = 16
16, // TR_StaticRamMethodConst = 17
12, // TR_Trampolines = 18
8, // TR_PicTrampolines = 19
8, // TR_CheckMethodEnter = 20
4, // TR_RamMethod = 21
8, // TR_RamMethodSequence = 22
8, // TR_RamMethodSequenceReg = 23
24, // TR_VerifyClassObjectForAlloc = 24
12, // TR_ConstantPoolOrderedPair = 25
8, // TR_AbsoluteMethodAddressOrderedPair = 26
20, // TR_VerifyRefArrayForAlloc = 27
12, // TR_J2IThunks = 28
8, // TR_GlobalValue = 29
4, // TR_BodyInfoAddressLoad = 30
20, // TR_ValidateInstanceField = 31
24, // TR_InlinedStaticMethodWithNopGuard = 32
24, // TR_InlinedSpecialMethodWithNopGuard = 33
24, // TR_InlinedVirtualMethodWithNopGuard = 34
24, // TR_InlinedInterfaceMethodWithNopGuard = 35
16, // TR_SpecialRamMethodConst = 36
24, // TR_InlinedHCRMethod = 37
20, // TR_ValidateStaticField = 38
20, // TR_ValidateClass = 39
16, // TR_ClassAddress = 40
8, // TR_HCR = 41
32, // TR_ProfiledMethodGuardRelocation = 42
32, // TR_ProfiledClassGuardRelocation = 43
0, // TR_HierarchyGuardRelocation = 44
0, // TR_AbstractGuardRelocation = 45
32, // TR_ProfiledInlinedMethodRelocation = 46
20, // TR_MethodPointer = 47
16, // TR_ClassPointer = 48
8, // TR_CheckMethodExit = 49
12, // TR_ValidateArbitraryClass = 50
0, // TR_EmitClass(not used) = 51
16, // TR_JNISpecialTargetAddress = 52
16, // TR_VirtualRamMethodConst = 53
20, // TR_InlinedInterfaceMethod = 54
20, // TR_InlinedVirtualMethod = 55
0, // TR_NativeMethodAbsolute = 56,
0, // TR_NativeMethodRelative = 57,
16, // TR_ArbitraryClassAddress = 58,
28, // TR_DebugCounter = 59
4, // TR_ClassUnloadAssumption = 60
16, // TR_J2IVirtualThunkPointer = 61,
24, // TR_InlinedAbstractMethodWithNopGuard = 62,
#endiflinedAbstractMethodWithNopGuard = 62,
#endif
Loading

0 comments on commit 1f36a73

Please sign in to comment.