-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General Relocation Infrastructure Clean up #11235
General Relocation Infrastructure Clean up #11235
Conversation
@mstoodle for your review; finally almost over :). |
@mstoodle review reminder. |
Jenkins test sanity.functional,extended.system all jdk8 |
Jenkins test sanity.functional,extended.system xlinux,xlinuxxl,zlinux,zlinuxxl,osx jdk8 |
Jenkins test sanity.functional,extended.system alinux64,alinux64xl jdk8 |
aarch64_linux failure because of #10840 |
@mstoodle review reminder. |
Lol I'm going to have to change all the copyrights in a couple of days aren't I? |
0bb17f2
to
596d89a
Compare
Jenkins test sanity.functional,extended.system all jdk8 |
It is highly unlikely this PR will be merged before #9591 which is going to cause a merge conflict. Converting to draft as I'm going to end up rebasing a couple of times and there's no point running tests for those. |
8f9c4d4
to
396b3bd
Compare
Ok, rebased over #9591 ; hopefully this can get merged next week as it blocks a set of PRs that are needed for FSD. |
Jenkins test sanity.functional,extended.system all jdk8 |
Looks like AIX failure
is because of #11616 |
Looks
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good @dsouzai! Some very happy changes in this PR :) . just had a couple of relatively minor questions to be answered and a couple of possible follow-up actions.
@@ -503,9 +503,15 @@ TR_RelocationRecord::clean(TR_RelocationTarget *reloTarget) | |||
} | |||
|
|||
int32_t | |||
TR_RelocationRecord::bytesInHeaderAndPayload() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can live with this change. One of the reasons for the original naming was because the header was the only thing you could count on to be in every single relocation record: from the fields in the header, you could decode whether additional data was needed to perform the relocation, or whether the offsets followed immediately after the header. It is a little bit weird (to me) that you now look the header before you know how the rest of the header is laid out, but if you look in the safe part where the type field resides, then you can properly decode it :) .
Anyway, I accept it was a source of confusion and, like I said, I can live with the update as I'm probably the only person whose brain will need to be reprogrammed :) .
@@ -39,346 +39,14 @@ class TR_RelocationTarget; | |||
struct TR_RelocationRecordBinaryTemplate; | |||
typedef TR_ExternalRelocationTargetKind TR_RelocationRecordType; | |||
|
|||
// These *BinaryTemplate structs describe the shape of the binary relocation records. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am so happy to finally see these structs move out of the header file......Bravo!
Update the code to only use the canonical table of relocation record header sizes in RelocationRecord.cpp, rather than the duplicated (for each platform) table of sizes. Additionally, delete these now unused tables. Additionally, this commit also deletes code that guarded by #ifdef 0 in ARM for two reasons; 1, it's #ifdef 0, and 2, it's code that prints out the fields in the relo header which is done elsewhere. Signed-off-by: Irwin D'Souza <[email protected]>
Common out all the places where the cursor is incremented. To facilitate this, initializeCommonAOTRelocationHeader is updated to not increment the cursor and fail the compilation if an unknown relo type is passed in. Signed-off-by: Irwin D'Souza <[email protected]>
Signed-off-by: Irwin D'Souza <[email protected]>
Signed-off-by: Irwin D'Souza <[email protected]>
Signed-off-by: Irwin D'Souza <[email protected]>
The macros definition used with respect to the relo flags were unnecessarily defined in RelocationRecord.cpp. This commit updates RelocationRecord.cpp to use the macro definitions in Runtime.hpp so that it is consistent with the uses in the codegen. Signed-off-by: Irwin D'Souza <[email protected]>
Rename bytesInHeaderAndPayload to just bytesInHeader. This name has been a point of confusion for more than one developer because of the fact that this API does not return total size of the binary relocation record (ie the data necessary to materialize the value to relocate/validate + the offsets at which to apply relocation); it in fact only returns the size of the total data needed to materialize the value. The reason why it was named "header and payload" is because the "header" was considered the fields of the base type TR_RelocationRecordBinaryTemplate, whereas the "payload" was considered the fields of any extending type. A (possible) point in favour of this is that the fields of TR_RelocationRecordBinaryTemplate are used to determine the type of the binary template, and therefore, how to interpret the fields that follow. However, because immediately following the binary template header fields are offsets, it complicates the notion that a complete binary relocation record contains a header, a payload, and offsets - it begs the question "what makes the offsets different that it cannot be grouped in with the payload?". And while there is an answer for this, it adds undue compexity to an already complex infrastructure. Therefore, to lower the barrier to entry (as I know this was for me), this commit goes ahead and renames it. It also deletes all the different implementations of it, and instead uses the canonical table of sizes to return the answer. In doing so, it is now consistent with the codegen. Signed-off-by: Irwin D'Souza <[email protected]>
396b3bd
to
a74a2ed
Compare
@mstoodle PR updated with requested changes (see https://github.com/eclipse/openj9/compare/396b3bdb7e2419eadd470add8e32204e483cbe2b..a74a2edf75e3adf058fd556756b79cd1b8307863) |
Move the binary templates back into the cpp file to enforce using TR_RelocationRecord (and extending types), ie the API layer, to read and write the raw relocation record data to and from the buffer. Signed-off-by: Irwin D'Souza <[email protected]>
Signed-off-by: Irwin D'Souza <[email protected]>
The common fields of all the raw relocation record headers (ie the fields of TR_RelocationRecordBinaryTemplate) should be initialized the same regardless of platform. This commit enforces this by refactoring the appropriate code into a common method. The initializeAOTRelocationHeader method that was implemented on all platforms is removed, and replaced with initializePlatformSpecificAOTRelocationHeader. Instead, only one version of initializeAOTRelocationHeader now exists, which performs the common intialization, and then delegates to initializePlatformSpecificAOTRelocationHeader, which in turn may delegate to initializeCommonAOTRelocationHeader. Signed-off-by: Irwin D'Souza <[email protected]>
Signed-off-by: Irwin D'Souza <[email protected]>
a74a2ed
to
6af5f91
Compare
@mstoodle added static asserts as requested (see https://github.com/eclipse/openj9/compare/a74a2edf75e3adf058fd556756b79cd1b8307863..6af5f91a145f5f0d1015d00a1fbf8cfaa782e9bb) |
Jenkins test sanity,extended all jdk8,jdk11 |
Jenkins test sanity.functional,extended.system all jdk8 |
failures look to be |
@mstoodle aside from the curl failures, all tests passed. This should be good to be merged now. |
LGTM, merging now. Thanks @dsouzai ! |
This is the most therapeutic PR I've ever opened. It completes the clean up of a significant portion of the relocation infrastructure.
Opening as a draft as I have yet to build and test on platforms other than xlinux.