Skip to content

Reduce execute() bytecode size and improve error messages#274

Merged
fglock merged 5 commits into
masterfrom
improve-croak-error-messages
Mar 6, 2026
Merged

Reduce execute() bytecode size and improve error messages#274
fglock merged 5 commits into
masterfrom
improve-croak-error-messages

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Mar 6, 2026

Summary

  • Extract 84 opcode handlers from BytecodeInterpreter.execute() into new InlineOpcodeHandler.java, reducing method size from 12007 to 7137 bytes (under 7500 JVM JIT compilation limit)
  • Add 76 missing opcode mappings to InterpretedCode disassembler
  • Remove dead executeArithmetic() method (326 lines)
  • Fix check-bytecode-size.sh for renamed package path
  • Improve parser error messages to pass more croak.t tests (11→44/330)
  • Fix $# check to allow special array names ($#+, $#-, $#{^CAPTURE})

Test plan

  • ./gradlew classes builds successfully
  • bash dev/tools/check-bytecode-size.sh reports all methods under limit
  • ./gradlew classes testUnitParallel --parallel shadowJar all tests pass

Generated with Devin

Update class path from org.perlonjava.interpreter to
org.perlonjava.backend.bytecode after package reorganization.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
@fglock fglock force-pushed the improve-croak-error-messages branch from e8b15c2 to e522ef9 Compare March 6, 2026 12:18
…assembler mappings

Reduce BytecodeInterpreter.execute() from 12007 to 7137 bytes (under 7500
JVM JIT limit) by extracting 84 inline case blocks into individual static
methods in new InlineOpcodeHandler.java.

Convert all switch statements to arrow-style (case X -> {}) for clarity
and to eliminate break statements.

Add comments explaining the nested try/catch/finally structure
(outer try for cleanup, inner try for Perl eval/die semantics).

Also add 76 missing opcode mappings to InterpretedCode disassembler and
remove dead executeArithmetic() method (326 lines).

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
@fglock fglock force-pushed the improve-croak-error-messages branch from e522ef9 to 407c7c0 Compare March 6, 2026 12:20
fglock and others added 3 commits March 6, 2026 13:23
Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
@fglock fglock merged commit ae2ec91 into master Mar 6, 2026
2 checks passed
@fglock fglock deleted the improve-croak-error-messages branch March 6, 2026 12:42
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.

1 participant