-
Notifications
You must be signed in to change notification settings - Fork 43
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
aot suggested fixes #574
aot suggested fixes #574
Conversation
@@ -367,13 +367,13 @@ private byte[] compileClass(String className, FunctionSection functions) { | |||
var classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES); | |||
classWriter.visit( | |||
Opcodes.V11, | |||
Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, | |||
Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL | Opcodes.ACC_SUPER, |
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.
Apparently, compatibility with project Leyden.
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.
Not Leyden, Valhalla. In Valhalla, if you have a class without ACC_SUPER (renamed ACC_IDENTITY), you are creating a value class. See https://bugs.openjdk.org/browse/JDK-8317278
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.
Many thanks for the explanation!
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'm guessing this doesn't matter was we're currently generating V11
classes, but good to fix for the future!
internalClassName, | ||
null, | ||
getInternalName(Object.class), | ||
new String[] {getInternalName(Machine.class)}); | ||
|
||
classWriter.visitSource("wasm", "wasm"); | ||
classWriter.visitSource(null, null); |
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.
Better to leave those fields empty than using dummy values.
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.
The second argument seems wrong for sure. The first one causes stack traces to include wasm
, which seems useful, but I don't know if there are downsides. If @forax says we should remove it, then let's remove it!
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.
As electrum said, for me, it should be
classWriter.visitSource("wasm", null);
so you get "wasm" printed in the stacktraces.
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.
Ok, I have nothing against, my reasoning was:
"better to not provide anything than a wrong fileName
that the IDE will try to resolve".
But the IDE is still broken in either cases, so I just opened #576 to track it as a separate issue.
Thanks everyone for the feedback, much appreciated!
internalClassName, | ||
null, | ||
getInternalName(Object.class), | ||
new String[] {getInternalName(Machine.class)}); | ||
|
||
classWriter.visitSource("wasm", "wasm"); | ||
classWriter.visitSource(null, null); |
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.
We can simply remove this call, as calling with null won't do anything.
752fe05
to
c4e2c87
Compare
c4e2c87
to
2ca4759
Compare
At Devoxx I had the pleasure to meet @forax , he is one of the maintainer of the ASM library we are using in the AOT compiler and suggested those fixes.