fix: clear last_Java_sp/last_Java_pc on exception path in call_VM stub - #558
Open
aminuoshi-378 wants to merge 1 commit into
Open
fix: clear last_Java_sp/last_Java_pc on exception path in call_VM stub#558aminuoshi-378 wants to merge 1 commit into
aminuoshi-378 wants to merge 1 commit into
Conversation
Move the clearing of last_Java_sp and last_Java_pc from no_exception_block to before the exception check, so both the exception and no-exception paths clear these values. This prevents stale last_Java_sp from causing invalid stack walks during GC. Fixes jeandle#483
Contributor
Merge Protections🔴 1 of 2 protections blocking · waiting on 👀 reviews
🔴 Require a review from a maintainer.Waiting for
This rule is failing.
Show 1 satisfied protection🟢 Pull request title format.
|
Author
|
Fix: Move the clearing of last_Java_sp and last_Java_pc to before the exception check, so both paths execute the clearing. This follows the same pattern as C2's GraphKit::gen_stub (see generateOptoStub.cpp:223-226), where the clearing is done unconditionally before the exception branch. |
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.
Related issue
Fixes #483
Summary
Move the clearing of
last_Java_spandlast_Java_pcfromno_exception_blockto before the exception check inJeandleCallVM::generate_call_VM, so both the exception and no-exception paths clear these values. This prevents stalelast_Java_spfrom causing invalid stack walks during GC.Changes
last_Java_sp/last_Java_pcclearing before the exception check (refer to C2'sGraphKit::gen_stub).Testing
Build verified on macOS aarch64. Full jeandle testing requires Linux environment with jeandle feature enabled.