Repository navigation
Resolve variable-access names lazily from tagged bytecode (#12, for 25.6) - #14
Merged
Merged
Conversation
* Resolve variable-access names lazily from tagged bytecode Drop the per-code-unit variable-access side table added in #11. It duplicated names the code unit already holds and locations the Bytecode DSL already records: every name occurrence was copied into the code unit, marshaled (UTF-8 name plus five ints), re-interned on load, and kept on the heap whether or not a tool was attached. The ReadVariableTag/WriteVariableTag node object now resolves names on demand from the tagged region's bytecode (TagTreeNode#getBytecodeNode and the enter/return bytecode indices). The access is the last matching load or store outside nested variable tags. Its operands identify the name: frame slots map to varnames, cellvars and freevars; LocalAccessor operands map through the locals table info; cell instructions carry an index; and global/name instructions carry the name constant. Identifier locations come from the tag's own source layers. Fused two-target unpacking now gets one identifier layer per operand, so per-name ranges are preserved. Variable tags no longer overwrite the compiler's currentLocation, which is used for syntax error positions and loop-header trace lines. Bump the bytecode cache version to 39 for the marshal format change (37 on elide-25.5.x; 25.6 was already at 38). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix JDK 21 download URLs for github jobs Ported from elide-25.5.x; the 25.6-only placeholder code unit in PBytecodeDSLRootNode drops the argument too. (cherry picked from commit 3fa9e56) * Identify variable accesses by operation class, not instruction names Instruction names are debugging aids and can change at any time. Use InstructionDescriptor#getOperationClass() (GR-81626, backported in elide-dev/graal#241) to recognize the custom name operations, and recognize built-in local loads/stores by their local argument. The access is still the last match outside nested variable tags: store values can contain untagged local loads, such as the self/__class__ loads that super() generates. Pin the Graal imports to the backport commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Pin Graal imports to the merged getOperationClass() backport (elide-dev/graal#241) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep instruction locations unchanged inside variable tags tagged variable access. Source sections exist whether or not tags are instrumented, so exception locations, traceback carets and line tables moved to the statement. This broke the tagged CPython tests test_traceback (test_caret_in_type_annotation, test_byte_offset_with_emojis_term_highlight) and test_compile.test_lineno_procedure_call. Open the statement and identifier layers outside the tag, and re-open the previously innermost range inside it. The tag's own location stays at the statement, which keeps debugger caller locations stable (PythonDebugTest), and the tagged instructions keep their previous location. The augmented-assignment read tag now uses the same layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: sync ci/graal/common.json with the pinned Graal revision JVMCI 25.5 (and mx 7.88.0), but ci/graal/common.json still pinned JVMCI 25.4. On that JDK Truffle falls back to the non-optimizing runtime ("Graal expected a JVMCI release version of 25.5, but got 25.4"), so every junit test fails on the -Dpolyglot.engine.CompilationFailureAction option the gate sets. This went unnoticed while the JDK 21 bootstrap download failed before any test ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apply mx 7.88 Eclipse formatting to TpSlotDescrGet The style gate's CodeFormatCheck with mx 7.88.0 indents the sealed class's permits continuation line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Michael Simacek <michael.simacek@oracle.com> Ported from elide-25.5.x; the 25.6-only placeholder code unit in PBytecodeDSLRootNode drops the argument too. (cherry picked from commit 09e64c7)
…#242) The lazy variable-access resolution needs InstructionDescriptor.getOperationClass() (elide-dev/graal#241), which reaches 25.6 with oracle#242. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Port of #12 to
elide-25.6.x. The bytecode cache version goes to 39 (25.6 was already at 38). The 25.6-only placeholder code unit inPBytecodeDSLRootNodealso drops the removed argument. Builds withvm --env ni-ce --dynamicimports /graal-js,/graalpython,/wasmagainst elide-dev/graalsync/25.6-wave.🤖 Generated with Claude Code