-
Notifications
You must be signed in to change notification settings - Fork 6.3k
8369190: JavaFrameAnchor on AArch64 has unnecessary barriers and wrong store order in MacroAssembler #27645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jcking
wants to merge
5
commits into
openjdk:master
Choose a base branch
from
jcking:aarch64-java-frame-anchor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8
−4
Open
8369190: JavaFrameAnchor on AArch64 has unnecessary barriers and wrong store order in MacroAssembler #27645
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
462c63e
JDK-8369190: JavaFrameAnchor on AArch64 appears to be missing barriers
jcking a0058eb
Update comments
jcking a141449
Rename ACGT -> AGCT
jcking 253417f
Remove barriers and just fix program order for sp store in MacroAssem…
jcking 016769d
Add comment to JavaFrameAnchor regarding no need for fencing
jcking File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,9 +39,11 @@ | |
// 3 - restoring an old state (javaCalls) | ||
|
||
void clear(void) { | ||
// No fencing required, the members are declared volatile so the compiler will not reorder and | ||
// the profiler always reads from the same thread and should observe the state in program order. | ||
|
||
// clearing _last_Java_sp must be first | ||
_last_Java_sp = nullptr; | ||
OrderAccess::release(); | ||
_last_Java_fp = nullptr; | ||
_last_Java_pc = nullptr; | ||
} | ||
|
@@ -54,9 +56,10 @@ | |
// To act like previous version (pd_cache_state) don't null _last_Java_sp | ||
// unless the value is changing | ||
// | ||
// No fencing required, the members are declared volatile so the compiler will not reorder and | ||
// the profiler always reads from the same thread and should observe the state in program order. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think copy() is ever called. Can we remove it? |
||
if (_last_Java_sp != src->_last_Java_sp) { | ||
_last_Java_sp = nullptr; | ||
OrderAccess::release(); | ||
} | ||
_last_Java_fp = src->_last_Java_fp; | ||
_last_Java_pc = src->_last_Java_pc; | ||
|
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still need a compiler fence here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not, if this is the same thread as readers. I don't know what it's for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OrderAccess::release()
is more than a compiler barrier on AArch64. I am guessing this was copied from x86 or one of the others where that same function is a compiler barrier? Should I movecompiler_barrier
from the random source files its in, into globalDefinitions, and use that?