Skip to content
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

Allow fabricated loadaddr for classes in AOT #2083

Merged
merged 1 commit into from
Jun 13, 2018

Conversation

jdmpapin
Copy link
Contributor

@jdmpapin jdmpapin commented Jun 5, 2018

More specifically for classes loaded by the bootstrap class loader,
which are unambiguously identifiable at relocation time.

This allows the JIT compiler to make up references to types about which
it has special knowledge. In particular, it's now possible to create a
loadaddr for java/lang/Class "out of thin air," without a corresponding
constant pool entry available.

At a high level, the appropriate relocations are carried out as follows:

  1. Allow TR_ClassAddress ExternalRelocations to be created without a
    constant pool index.

  2. Before grouping into IteratedExternalRelocations, identify these
    and set their kind to the new TR_ArbitraryClassAddress.

  3. Write the relocation record for TR_ArbitraryClassAddress with the
    same data as would be required for TR_ClassPointer.

  4. Relocate TR_ArbitraryClassAddress by finding the class as though
    for TR_ClassPointer, and then patching the code as though for
    TR_ClassAddress (to deal with materialization sequences).

Note that because the compilation has the class pointer, it must have
been through validateArbitraryClass(). In case the class can't be found
at relocation time, the validation record will cause relocation to fail,
so the value used for missing classes is irrelevant.

Power code generation is updated to generate a materialization sequence
and relocation when it encounters a fabricated class symbol reference in
an AOT (ahead of time) compilation. Previously it used an unresolved
snippet, which requires a constant pool index.

@jdmpapin
Copy link
Contributor Author

jdmpapin commented Jun 5, 2018

This is the openj9 part of eclipse-omr/omr#2636.

@jdmpapin
Copy link
Contributor Author

jdmpapin commented Jun 8, 2018

Updated to avoid adding classAddressUsesReloRecordInfo() and getClassAddressSymRef() to OMR, as described in eclipse-omr/omr#2636.

Diff from the previous version of this commit

@andrewcraik
Copy link
Contributor

Jenkins test sanity

@andrewcraik
Copy link
Contributor

Ok so sanity tests say JDK8 windows build failed due to #2129. Travis build is shown failed because the dependent OMR change had not been merged at that time. The only issue to be resolved here is to fix the copyright failure. @jdmpapin can you please verify the copyright and then do a push to update the change? I don't think we need sanity again - we need travis clean and the copyright check clean provided the only update you make is to the copyright headers

@fjeremic fjeremic added comp:jit depends:omr Pull request is dependent on a corresponding change in OMR labels Jun 12, 2018
@jdmpapin
Copy link
Contributor Author

Updated the copyright header in J9AheadOfTimeCompile.hpp

More specifically for classes loaded by the bootstrap class loader,
which are unambiguously identifiable at relocation time.

This allows the JIT compiler to make up references to types about which
it has special knowledge. In particular, it's now possible to create a
loadaddr for java/lang/Class "out of thin air," without a corresponding
constant pool entry available.

At a high level, the appropriate relocations are carried out as follows:

  1. Allow TR_ClassAddress ExternalRelocations to be created without a
  constant pool index.

  2. Before grouping into IteratedExternalRelocations, identify these
  and set their kind to the new TR_ArbitraryClassAddress.

  3. Write the relocation record for TR_ArbitraryClassAddress with the
  same data as would be required for TR_ClassPointer.

  4. Relocate TR_ArbitraryClassAddress by finding the class as though
  for TR_ClassPointer, and then patching the code as though for
  TR_ClassAddress (to deal with materialization sequences).

Note that because the compilation has the class pointer, it must have
been through validateArbitraryClass(). In case the class can't be found
at relocation time, the validation record will cause relocation to fail,
so the value used for missing classes is irrelevant.

Power code generation is updated to generate a materialization sequence
and relocation when it encounters a fabricated class symbol reference in
an AOT (ahead of time) compilation. Previously it used an unresolved
snippet, which requires a constant pool index.

Signed-off-by: Devin Papineau <[email protected]>
@andrewcraik
Copy link
Contributor

Build is clean and CI completed previously as noted - merging

@andrewcraik andrewcraik merged commit b825388 into eclipse-openj9:master Jun 13, 2018
@jdmpapin jdmpapin deleted the aot-fab-loadaddr branch September 4, 2018 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jit depends:omr Pull request is dependent on a corresponding change in OMR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants