-
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
Enhance extensibility of JitBuilder classes #2515
Enhance extensibility of JitBuilder classes #2515
Conversation
@genie-omr build all |
ac3df52
to
1d04a44
Compare
@genie-omr build zlinux |
1d04a44
to
fb26736
Compare
@genie-omr build zlinux |
fb26736
to
10101dc
Compare
(At least) One more time! @genie-omr build zlinux |
@genie-omr build plinux |
00ed563
to
ca11e27
Compare
yay @genie-omr build all |
For the record, I think this one is ready for your consideration when you're ready, @0xdaryl (which is to say: I think I'm finally done iterating through build failures!). |
ca11e27
to
1271c17
Compare
Latest push only fixed the merge conflicts induced by #2529 . |
With the constraints that you want, I wonder if we should start to use C++ language features to enforce some of these rules. Otherwise, your intentions will be lost over time. For instance, for the functions you expect to provide functionality for but do not want to be overridden, would you consider marking them On a related note, there is an experiment underway to "revirtualize" the extension points in the extensible class hierarchy. That is, turn the extensibility points of a class into virtual functions and thereby eliminate the requirement for the |
I would really recommend against the use of C++11 features. I am actively trying to get all current uses of C++11 features removed from the codebase as they are not supported on all of our platforms / compilers. |
@0xdaryl I'm not sure I understand your suggestion. What is the benefit to make a function virtual but marked as |
oh, i see, to prevent a subclass from overriding it anyway which would be visible via calls to the TR namespaced class but not to calls within that class's hierarchy (i.e. calls implicitly or explicitly via |
having all methods be tagged with |
1271c17
to
f538edf
Compare
@genie-omr build all |
@charliegracie @0xdaryl rebased now. Anything else you think should be changed at this point? |
I don't believe we should preclude the use of more modern C++ features if it makes understanding the code easier or allows the compiler to perform compile-time checks to enforce rules we have in the code base. Even more so if it avoids the development of specialized "linter" tools to catch transgressions. This is especially true if that C++ feature can easily be avoided on build compilers that do not support said feature (for instance, by simply hiding its use behind a macro). I get the argument that we need to avoid "modern" language features in order to increase broadest possible adoption, but there is also an argument to be made that some of those features are actually useful and beneficial to some projects. Precluding new language features may in fact be punishing those projects that choose to build with more modern toolchains by leaving important performance optimizations on the table or limiting their effect. It's a bit of a double-edged sword. This PR is not the right forum to debate this topic and likely needs a broader project-level discussion to define the minimum language level that will be accepted and the minimum compiler levels (and there should be CI jobs that test them). We don't have a clearly documented standard to apply to changes proposed in a PR as to whether they're acceptable from a toolchain perspective or not. And since we don't, debates such as this will recur. Perhaps this should be part of the OMR release discussion (#2274) or make the toolchain part of the API we define for a release. In the interests of moving this PR forward, however, I don't think there's any particular technique employed in this PR that's outside the spirit of extensible classes. @mstoodle, the PR does need a rebase though. |
I'll rebase tonight and ping when it's ready. Thanks Daryl! |
In preparation for creating a JitBuilder extension for IlBuilder, to facilitate the client API creation, the IlBuilder class needs to become more like a fully extensible with an independent header. Since compilertest provides an IlBuilder extension, it also needs to be adjusted to account for the new structure. Sigsned-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for MethodBuilder, to facilitate the client API creation, the MethodBuilder class needs to become more like a fully extensible with an independent header. Because the test compiler provides an extension of MethodBuilder, its files were also adjusted to define a separate header file. Signed-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for BytecodeBuilder, to facilitate the client API creation, the BytecodeBuilder class needs to become more like a fully extensible with an independent header. Signed-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for IlType and TypeDictionary, to facilitate the client API creation, the IlType class needs to be separated from TypeDictionary.hpp/cpp and both classes need to become more fully extensible with independent headers. Signed-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for IlValue, to facilitate the client API creation, the IlValue class needs to become more like a fully extensible with an independent header. Signed-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for ThunkBuilder, to facilitate the client API creation, the ThunkBuilder class needs to become more like a fully extensible with an independent header. Signed-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for VirtualMachineState, to facilitate the client API creation, the VirtualMachineState class needs to become more like a fully extensible with an independent header. Also change references to OMR::VirtualMachineState to TR::VirtualMachineState. Signed-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for VirtualMachineRegister, to facilitate the client API creation, the VirtualMachineRegister class needs to become more like a fully extensible with an independent header. Also change references to OMR::VirtualMachineRegister to TR::VirtualMachineRegister. Signed-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for VirtualMachineRegisterInStruct, to facilitate the client API creation, the VirtualMachineRegisterInStruct class needs to become more like a fully extensible class with an independent header. Signed-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for VirtualMachineOperandArray, to facilitate the client API creation, the VirtualMachineOperandArray class needs to become more like a fully extensible with an independent header. Signed-off-by: Mark Stoodley <[email protected]>
In preparation for creating a JitBuilder extension for VirtualMachineOperandStack, to facilitate the client API creation, the VirtualMachineOperandStack class needs to become more like a fully extensible with an independent header. Signed-off-by: Mark Stoodley <[email protected]>
Makes these fields more usable as part of an extensible class. Signed-off-by: Mark Stoodley <[email protected]>
Makes it easier to find a file; not much harder to maintain. Signed-off-by: Mark Stoodley <[email protected]>
JitBuilder doesn't need to explicitly include these anymore; it gets them from the base compiler objects. Signed-off-by: Mark Stoodley <[email protected]>
Needed to prevent build errors for JitBuilder samples, but will become unnecessary when JitBuilder migrates to the new client API generators. Signed-off-by: Mark Stoodley <[email protected]>
Signed-off-by: Mark Stoodley <[email protected]>
f538edf
to
902e227
Compare
For extra insurance: @genie-omr build all |
Fixes error in omr acceptance build caused by eclipse-omr/omr#2515 Files marked "# Delete me" should be removed when omr changes are merged Signed-off-by: Devin Nakamura <[email protected]>
The JitBuilder implementation files in
compiler/ilgen
are not really in the right shape to be extended by other compilers. This pull request moves these files closer to the extensible classes shape used by some classes in the rest of the compiler, but not all the way (on purpose). I am willing to change my position on these aspects, but for now I want to see where we can get without them:self()
throughout these classes, which is an implicit statement that I am hoping extensions of these classes will only add function rather than override function.Note for JitBuilder clients: OMR::VirtualMachine* classes have been promoted to full TR::VirtualMachine* classes. However, once the new client API work lands, all those classes are moving to the OMR::JitBuilder namespace anyway (sorry for the dual migration).