l1a/l1b: PARTIAL (missing null/abstract checks); l2: FAIL (unsupported)#570
Open
opencode-agent[bot] wants to merge 1 commit into
Open
l1a/l1b: PARTIAL (missing null/abstract checks); l2: FAIL (unsupported)#570opencode-agent[bot] wants to merge 1 commit into
opencode-agent[bot] wants to merge 1 commit into
Conversation
Co-authored-by: LSantha <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec compliance report
L2ByteCodeSupportCheckermarksinvokevirtualas unsupported (line 195-196), preventing L2 compilation entirely; code generation exists but is never usedDetails
l1a Implementation
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:2809-2861objectrefto load the TIB (os.writeMOV(asize, helper.AAX, helper.AAX, tibOffset)) without first testing for null. Ifobjectrefis null, this causes a segmentation fault rather than throwingNullPointerException.TIBBuilder), but the dispatch code assumes concrete implementations.helper.pushReturnValue()(line 2857), correct operand stack effect (pops objectref + args, pushes return value).l1b Implementation
core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:3489-3549objectrefwithout null test.l2 Implementation
core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.java:195-196— explicitly marksinvokevirtualas unsupportedcore/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java:5508-5577(VirtualCallAssignQuad) and5580-5637(VirtualCallQuad) — code generation exists but is unreachablecore/src/core/org/jnode/vm/compiler/ir/IRGenerator.java:1022-1079— IR generation correctly models operand stack effectL2ByteCodeSupportChecker.visit_invokevirtual()at line 195-196 callsnotSupported()which throwsUnsupportedOperationException. This prevents any method containinginvokevirtualfrom being compiled by L2, forcing fallback to L1.GenericX86CodeGenerator(lines 5550-5562 / 5622-5634) has the same null dereference issue as l1a/l1b.IRGenerator.visit_invokevirtual()properly models the operand stack effect (pops objectref + args, pushes return value for non-void methods) and createsVirtualCallQuad/VirtualCallAssignQuadwith correct variable offsets.JVM Spec References (invokevirtual, SE6)
Format:
invokevirtual indexbyte1 indexbyte2(opcode 182 / 0xb6)Operand Stack:
..., objectref, [arg1, [arg2 ...]] → ...(return value pushed if non-void)Linking Exceptions:
IncompatibleClassChangeErrorif resolved method is staticRuntime Exceptions:
NullPointerExceptionif objectref is nullAbstractMethodErrorif no matching method selected OR selected method is abstractUnsatisfiedLinkErrorif native method code cannot be boundNotes: The nargs argument values and objectref are not one-to-one with the first nargs+1 local variables; long/double take two slots.
Closes #406
opencode session | github run