Skip to content

* improvement (core): Model local definition with interfaces - #1782

Open
dkimitsa wants to merge 1 commit into
soot-oss:developfrom
dkimitsa:impt/bytecode-local-slot-index-separate-locals
Open

dkimitsa wants to merge 1 commit into
soot-oss:developfrom
dkimitsa:impt/bytecode-local-slot-index-separate-locals

Conversation

@dkimitsa

@dkimitsa dkimitsa commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR address? (Why)

Expose original JVM variable slots and distinguish operand-stack temporaries for downstream analyses and code generation, preserving metadata during local transformations.

What are the main implementation details? (What, How)

  • Make Local and JavaLocal interfaces, with shared AbstractLocal behavior and composable slot/stack and Java annotation variants.
  • Add newSlotLocal and newStackLocal factories with private implementations and metadata-preserving withers; migrate constructor calls.
  • Record provenance during bytecode conversion and preserve it during renaming and serialization; add slot, wide-parameter, and transformation tests.

Validation: clean core, Java core, interceptor, and both frontend suites (786 passed, 14 skipped); formatting passed.

Linked issue (if any)

None.

Checklist

Code style & guidelines

  • I ran the formatter: mvn com.spotify.fmt:fmt-maven-plugin:format
  • I added the necessary comments in the code
  • I provided meaningful tests for my proposed change
  • I updated documentation (if needed)

Self-review

  • I performed a self-review of my code
  • I added or updated tests where needed
  • I have successfully run tests with my changes locally
  • My branch is up to date with develop

Review

  • CI checks are green
  • I requested a review from a core contributor

**What does this PR address? (Why)**

Expose original JVM variable slots and distinguish operand-stack temporaries for downstream analyses and code generation, preserving metadata during local transformations.

**What are the main implementation details? (What, How)**

- Make `Local` and `JavaLocal` interfaces, with shared `AbstractLocal` behavior and composable slot/stack and Java annotation variants.
- Add `newSlotLocal` and `newStackLocal` factories with private implementations and metadata-preserving withers; migrate constructor calls.
- Record provenance during bytecode conversion and preserve it during renaming and serialization; add slot, wide-parameter, and transformation tests.

Validation: clean core, Java core, interceptor, and both frontend suites (786 passed, 14 skipped); formatting passed.

**Linked issue (if any)**

None.

**Checklist**

*Code style & guidelines*

- [x] I ran the formatter: `mvn com.spotify.fmt:fmt-maven-plugin:format`
- [x] I added the necessary comments in the code
- [x] I provided meaningful tests for my proposed change
- [x] I updated documentation (if needed)

*Self-review*

- [x] I performed a self-review of my code
- [x] I added or updated tests where needed
- [x] I have successfully run tests with my changes locally
- [ ] My branch is up to date with `develop`

*Review*

- [ ] CI checks are green
- [x] I requested a review from a core contributor

This branch has not been deployed

No deployments
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