Skip to content

Disambiguate local variable names to fix debugger issues.#2177

Merged
gbrail merged 4 commits into
mozilla:masterfrom
aardvark179:aardvark179-debugger-variables-fix
Dec 5, 2025
Merged

Disambiguate local variable names to fix debugger issues.#2177
gbrail merged 4 commits into
mozilla:masterfrom
aardvark179:aardvark179-debugger-variables-fix

Conversation

@aardvark179

Copy link
Copy Markdown
Contributor

This fixes the problems seen with blocks and the debugger in #2174.

* is used.
*/
private static String[] disambiguateNames(String[] names, int paramCount) {
String[] result = new String[names.length];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How hot is this method?
Would it make sense to add a fast exit like if (names.length <= paramCount) return names to avoid some object creation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's called once per method during compilation, so not very hot.

@aardvark179

Copy link
Copy Markdown
Contributor Author

Thanks to @andreabergia for adding a specific test around this≥

varDbls[state.indexReg] = frame.sDbl[state.stackTop];
}
} else {
// This only occurs if we are using the deubgger, in

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please fix this (repeated) typo? Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Fixed.

@aardvark179
aardvark179 force-pushed the aardvark179-debugger-variables-fix branch 2 times, most recently from 5b3e7d8 to d1e479a Compare December 1, 2025 12:17
@aardvark179
aardvark179 force-pushed the aardvark179-debugger-variables-fix branch from d1e479a to b32314e Compare December 4, 2025 17:13
@gbrail

gbrail commented Dec 5, 2025

Copy link
Copy Markdown
Collaborator

This is a nice fix -- thanks!

@gbrail
gbrail merged commit db95c68 into mozilla:master Dec 5, 2025
11 checks passed
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.

4 participants