Conversation
…arge method handling Three fixes for ExifTool test failures: 1. Recursive label collection in EmitBlock: collectStatementLabelNames now descends into IfNode branches and nested BlockNodes so goto can find labels inside if/elsif/else. 2. Spill LHS in repeat (x) operator: handleRepeat now stores the left operand in a local variable before evaluating the right operand, preventing ASM frame computation crashes when the RHS is a function call. 3. Large method handling: EmitterMethodCreator tries AST splitting before interpreter fallback on MethodTooLargeException; LargeBlockRefactorer uses bytecode size estimation to decide when to refactor. ExifTool results: 177/177 tests pass across 16 test suites (was 157/163). Core Perl tests (bop.t, pat.t, open.t) unchanged. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
- Restrict goto LABEL from jumping into if/for/try constructs (Perl 5.44 behavior). Labels inside these constructs are no longer visible to gotos at the parent block level. - Preserve cross-branch goto within if/elsif/else chains by pushing sibling branch labels in emitIf (needed by ExifTool WriteExif/Geotag). - Add evalbytes support to bytecode compiler (CompileOperator). - Add Encode::_utf8_on/_utf8_off methods. - Resolve merge conflict markers in BitwiseOperators.java. uni/labels.t: 2/11 → 7/11. ExifTool Writer.t: 61/61 (no regression). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
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.
Summary
Fixes for ExifTool test failures and Perl 5 core test improvements:
Goto label scoping (Perl 5.44 semantics)
collectStatementLabelNamesRecursiveno longer descends intoIfNode,For1Node,For3Node, orTryNode. This preventsgoto LABELfrom jumping into constructs from outside (Perl 5.44: "Use of goto to jump into a construct is no longer permitted").emitIfnow collects labels from all sibling branches of if/elsif/else chains and pushes them before emission. This keeps ExifTool's cross-branch goto pattern working (WriteExif.pl, Geotag.pm, InDesign.pm).LHS spill in repeat (
x) operatorhandleRepeatinEmitOperatorstores the left operand in a local variable before evaluating the right operand, preventing ASM frame crashes when RHS is a function call (e.g.(0) x FREQMAX()).Large method handling
EmitterMethodCreatortries AST splitting before interpreter fallback onMethodTooLargeException;LargeBlockRefactoreruses bytecode size estimation.Other fixes
evalbytessupport to bytecode compiler (CompileOperator).Encode::_utf8_on/_utf8_offmethods.BitwiseOperators.java.Files changed
EmitBlock.javacollectIfChainLabelsfor cross-branch gotoEmitStatement.javaemitIfEmitOperator.javahandleRepeatEmitterMethodCreator.javaLargeBlockRefactorer.javaCompileOperator.javaevalbytessupport in bytecode compilerEncode.java_utf8_on/_utf8_offmethodsBitwiseOperators.javaTest plan
Generated with Devin