Fix eval interpreter catchup: missing operators, local *glob, and ExifTool support#242
Merged
Fix eval interpreter catchup: missing operators, local *glob, and ExifTool support#242
Conversation
- Binary operator handlers: binmode, seek, eof, printf, close, fileno, getc, tell, join (as BinaryOperatorNode form) - $#array = value assignment (SET_ARRAY_LAST_INDEX opcode) - Logical xor/^^ operator (XOR_LOGICAL opcode) - //= defined-or assignment (DEFINED_OR_ASSIGN opcode) - CONCAT: handle RuntimeList operands via scalar coercion ExifTool now runs successfully in interpreter mode. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
The compileJoinBinaryOp was only using lastResultReg from node.right.accept(), which for a ListNode with multiple elements (e.g. string interpolation "$x-$y") would only capture the last element. Now properly iterates ListNode elements and emits CREATE_LIST before JOIN. This fixes a regression in re/regexp.t (1565→1784) caused by string interpolation in eval strings producing empty/partial results. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
Array interpolation in eval strings (e.g. ">@array<") was getting scalar context (array count) instead of list context (array elements) because compileJoinBinaryOp didn't set LIST context for the right operand when it wasn't a ListNode. This fixes base/lex.t (-3 → +1) and re/regexp.t (1784 → 1786). 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
This PR continues the interpreter mode (
JPERL_EVAL_USE_INTERPRETER=1) catch-up work, fixing multiple issues discovered while getting ExifTool to run in interpreter mode.Missing bytecode operators for ExifTool
binmode,seek,eof,printf,close,fileno,getc,tell,join— these were missing when the parser generatesBinaryOperatorNode(2+ arg form)$#array = valueassignment via newSET_ARRAY_LAST_INDEXopcodexor/^^logical operator via newXOR_LOGICALopcode//=defined-or assignment via newDEFINED_OR_ASSIGNopcodeRuntimeListto scalar when encountered as operandlocal *glob restore fix (uni/gv.t test 169, mro/method_caching.t)
RuntimeGlob.dynamicSaveState/RestoreStatewithGlobSlotSnapshotto save/restore actual Java object references from global mapsInheritanceResolver.invalidateCache()on code slot restore to fix MRO cache regressionOther interpreter fixes
#linetracking in evaleval STRING$SIG{__DIE__}and exception handling viaWarnDie.catchEvalResult
ExifTool (
Image-ExifTool-13.44/exiftool) now runs successfully in interpreter mode.Test plan
./gradlew classes testUnitParallel --parallelpassescd Image-ExifTool-13.44 && JPERL_EVAL_USE_INTERPRETER=1 ../jperl -Ilib exiftoolGenerated with Devin