Skip to content

All three JNode compilers (l1a, l1b, l2) ✅ PASS for iconst_4 spec compliance#560

Open
opencode-agent[bot] wants to merge 1 commit into
masterfrom
opencode/issue306-20260622113059
Open

All three JNode compilers (l1a, l1b, l2) ✅ PASS for iconst_4 spec compliance#560
opencode-agent[bot] wants to merge 1 commit into
masterfrom
opencode/issue306-20260622113059

Conversation

@opencode-agent

Copy link
Copy Markdown

Spec compliance report

Compiler Status Issues
l1a ✅ PASS None
l1b ✅ PASS None
l2 ✅ PASS None

Details

l1a Implementation

  • Status: ✅ PASS
  • Files: core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:2161, core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java:61, core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java:60, core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java:250
  • Issues: None

Analysis:

  • BytecodeParser (line 174) correctly decodes opcode 0x07 → handler.visit_iconst(4)
  • X86BytecodeVisitor.visit_iconst() pushes an IntItem with JvmType.INT via ItemFactory.createIConst()
  • IntItem.getType() returns JvmType.INT (category 1)
  • Item.getCategory() returns 1 (correct for int)
  • VirtualStack correctly tracks the single-slot push

l1b Implementation

  • Status: ✅ PASS
  • Files: core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:2604, core/src/core/org/jnode/vm/x86/compiler/l1b/ItemFactory.java:56, core/src/core/org/jnode/vm/x86/compiler/l1b/IntItem.java:61, core/src/core/org/jnode/vm/x86/compiler/l1b/Item.java:235
  • Issues: None

Analysis:

  • Identical implementation pattern to l1a
  • Adds bytecode counter for profiling
  • IntItem extends WordItem with JvmType.INT, category 1
  • VirtualStack correctly handles the push

l2 Implementation

  • Status: ✅ PASS
  • Files: core/src/core/org/jnode/vm/compiler/ir/IRGenerator.java:275, core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java:241, core/src/core/org/jnode/vm/compiler/ir/IntConstant.java:26
  • Issues: None

Analysis:

  • IRGenerator.visit_iconst() creates ConstantRefAssignQuad with IntConstant(value)
  • Stack offset incremented by 1 (category 1)
  • GenericX86CodeGenerator.generateCodeFor(ConstantRefAssignQuad) emits MOV_Const to register or stack
  • L2ByteCodeSupportChecker does not override visit_iconst (inherits empty impl from BytecodeVisitorSupport) — this is correct as the checker only validates L2 eligibility, actual compilation uses IRGenerator

JVM Spec References

Closes #306

New%20session%20-%202026-06-22T11%3A30%3A58.572Z
opencode session  |  github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JVM instruction spec compliance: iconst_4

0 participants