Instruction: castore
Wiki References
Note: Before reading wiki pages, clone the wiki repository if .wiki/ directory does not exist:
git clone git@github.com:LSantha/jnode_ai.wiki.git .wiki
Agent Instructions
-
Read Spec Pages:
-
Read Wiki Pages:
- First, check if
.wiki/ directory exists. If not, clone it:
git clone git@github.com:LSantha/jnode_ai.wiki.git .wiki
- Review
JIT-Compilers.md to understand the 3-tier compilation model.
- Review
L1-Compiler.md for L1A/L1B implementation details.
- Review
L2-Compiler-Deep-Dive.md for L2 specifics.
- Review
Type-System-Internals.md for type/category rules that affect stack and local-variable handling.
-
Analyze Implementations:
Focus on the JNode bytecode parser, visitor contract, and all compiler implementations that can execute or lower this instruction:
- Parser / opcode dispatch:
core/src/core/org/jnode/vm/bytecode/BytecodeParser.java
- Visitor contract:
core/src/core/org/jnode/vm/bytecode/BytecodeVisitor.java
- l1a:
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java
- l1b:
core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java
- l2 support:
core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.java
- l2 code generation:
core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java
- Operand stack behavior:
core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java, core/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java, core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java, core/src/core/org/jnode/vm/x86/compiler/l1b/VirtualStack.java
- Local variable / frame behavior:
core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java, core/src/core/org/jnode/vm/x86/compiler/l1b/X86StackFrame.java, core/src/core/org/jnode/vm/x86/compiler/l2/X86StackFrame.java
For castore, also focus on this instruction family context: array load/store.
core/src/core/org/jnode/vm/bytecode/BytecodeVisitor.java — visitor method signature for array load/store instructions.
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java and core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java — array load/store lowering and stack operand order.
core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java and core/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java — operand stack order and category/type tracking.
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:4201 and core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java:4146 — existing TODO for array store type compatibility and ArrayStoreException.
core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.java and core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java — L2 support and code generation.
-
Verify Spec Compliance:
Check the implementation against the castore spec page and the JNode code focus above. In particular, verify:
- Verify operand stack order exactly: arrayref, index, and value ordering for stores.
- Check runtime exceptions required by the spec: NullPointerException, ArrayIndexOutOfBoundsException, and ArrayStoreException where applicable.
- Check primitive array element sign/zero extension for baload/caload/saload and narrowing/truncation for bastore/castore/sastore.
- Check reference array store type compatibility, including ArrayStoreException.
-
Document Results:
Add a comment to this issue with the following format. Do not open a PR and do not change source code or wiki pages for this ticket.
Spec compliance report
| Compiler |
Status |
Issues |
| l1a |
✅ PASS / ❌ FAIL / ⚠️ PARTIAL |
|
| l1b |
✅ PASS / ❌ FAIL / ⚠️ PARTIAL |
|
| l2 |
✅ PASS / ❌ FAIL / ⚠️ PARTIAL |
|
Details
l1a Implementation
- Status: ✅ PASS / ❌ FAIL / ⚠️ PARTIAL
- Files:
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:<line>, plus any stack/local helper files that affect castore
- Issues: <specific issues with line numbers or "None">
l1b Implementation
- Status: ✅ PASS / ❌ FAIL / ⚠️ PARTIAL
- Files:
core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:<line>, plus any stack/local helper files that affect castore
- Issues: <specific issues with line numbers or "None">
l2 Implementation
- Status: ✅ PASS / ❌ FAIL / ⚠️ PARTIAL
- Files:
core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.java:<line>, core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java:<line>
- Issues: <specific issues with line numbers or "None">
IMPORTANT: No changes to source code or wiki are permitted. This is a read-only analysis task. The expected outcome is a single issue comment containing the spec compliance report above, with JVM spec references and JNode file references.
Instruction: castore
Wiki References
Agent Instructions
Read Spec Pages:
castore: https://docs.oracle.com/javase/specs/jvms/se6/html/Instructions2.doc2.htmlcastore.Read Wiki Pages:
.wiki/directory exists. If not, clone it:git clone git@github.com:LSantha/jnode_ai.wiki.git .wikiJIT-Compilers.mdto understand the 3-tier compilation model.L1-Compiler.mdfor L1A/L1B implementation details.L2-Compiler-Deep-Dive.mdfor L2 specifics.Type-System-Internals.mdfor type/category rules that affect stack and local-variable handling.Analyze Implementations:
Focus on the JNode bytecode parser, visitor contract, and all compiler implementations that can execute or lower this instruction:
core/src/core/org/jnode/vm/bytecode/BytecodeParser.javacore/src/core/org/jnode/vm/bytecode/BytecodeVisitor.javacore/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.javacore/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.javacore/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.javacore/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.javacore/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java,core/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java,core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java,core/src/core/org/jnode/vm/x86/compiler/l1b/VirtualStack.javacore/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java,core/src/core/org/jnode/vm/x86/compiler/l1b/X86StackFrame.java,core/src/core/org/jnode/vm/x86/compiler/l2/X86StackFrame.javaFor
castore, also focus on this instruction family context: array load/store.core/src/core/org/jnode/vm/bytecode/BytecodeVisitor.java— visitor method signature for array load/store instructions.core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.javaandcore/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java— array load/store lowering and stack operand order.core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.javaandcore/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java— operand stack order and category/type tracking.core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:4201andcore/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java:4146— existing TODO for array store type compatibility and ArrayStoreException.core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.javaandcore/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java— L2 support and code generation.Verify Spec Compliance:
Check the implementation against the
castorespec page and the JNode code focus above. In particular, verify:Document Results:
Add a comment to this issue with the following format. Do not open a PR and do not change source code or wiki pages for this ticket.
Spec compliance report
Details
l1a Implementation
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:<line>, plus any stack/local helper files that affectcastorel1b Implementation
core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:<line>, plus any stack/local helper files that affectcastorel2 Implementation
core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.java:<line>,core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java:<line>IMPORTANT: No changes to source code or wiki are permitted. This is a read-only analysis task. The expected outcome is a single issue comment containing the spec compliance report above, with JVM spec references and JNode file references.