-
Notifications
You must be signed in to change notification settings - Fork 397
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
Add frontend method getVFTEntry #2651
Conversation
OpenJ9 2126 has been merged |
I am fine with this change so maybe @fjeremic you could take a look? |
"FrontEnd" is a deprecated interface from OMR's perspective. Please consider either moving this into the |
compiler/codegen/FrontEnd.hpp
Outdated
@@ -200,6 +200,8 @@ class TR_FrontEnd : public TR_Uncopyable | |||
virtual TR_OpaqueClassBlock * getClassFromMethodBlock(TR_OpaqueMethodBlock *mb); | |||
virtual int32_t getNewArrayTypeFromClass(TR_OpaqueClassBlock *clazz); | |||
|
|||
virtual intptrj_t getVFTEntry(TR_OpaqueClassBlock *clazz, int32_t offset); |
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.
In addition to @0xdaryl's comments it would be great if we could Doxygen document this new API so that consumers of the class know what the expected behavior is.
@0xdaryl If we were to move the call to this new method completely into Openj9, should we do that by moving the |
The methodtest case should not move down to OpenJ9 - method test guards exist in OMR and are a valid cross language construct - the bit that would potentially need to move down would be how to check if the LHS and RHS of the equality in this case are equal |
You obviously have more requirements on this simple API than this pull request provides. Please be aware that I'm approaching it from a language-agnostic perspective and what fits in with OMR. There is a precedent for accomplishing what I think you're doing. You can add the API to the Admittedly, this isn't a great overall solution for some downstream projects. The FrontEnd refactoring is only partially complete and will need to undergo further evolution in OMR to support the notion of different "frontend" specializations like shared classes and JIT-as-a-service. I expect to be architecting this in the second half of this year. |
bd91448
to
6e7d73a
Compare
That makes sense. I updated the commit to use ClassEnv instead. We can then revert the corresponding change to OpenJ9. |
@0xdaryl are you okay with this commit ? |
@genie-omr build all |
compiler/env/OMRClassEnv.hpp
Outdated
@@ -111,6 +111,9 @@ class OMR_EXTENSIBLE ClassEnv | |||
char *classSignature_DEPRECATED(TR::Compilation *comp, TR_OpaqueClassBlock * clazz, int32_t & length, TR_Memory *) { return NULL; } | |||
char *classSignature(TR::Compilation *comp, TR_OpaqueClassBlock * clazz, TR_Memory *) { return NULL; } | |||
|
|||
// Get the virtual function table entry at a specific offset from the class |
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.
Please provide a Doxygen comment for the API (i.e., the parameters and return value as well).
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.
Also, please ensure the copyright headers of each file are updated to 2018.
The optimizer should ideally not fetch class fields directly. Factor it out into a ClassEnv method instead. Signed-off-by: Noah Weninger <Noah.Weninger@ibm.com>
6e7d73a
to
d36ad53
Compare
@0xdaryl updated |
@genie-omr build all |
The optimizer should ideally not fetch class fields directly. Factor it out into a frontend method instead (implemented in openj9).
This commit was originally written by Omer Sheikh and is required for JITaaS support.
Depends on eclipse-openj9/openj9#2126
Signed-off-by: Noah Weninger Noah.Weninger@ibm.com