[feedback] Only take read lock for data pairs on the background thread
Slight performance regression by adding locking around feedback vector get/set. The lock isn't necessary for reads on the main thread, since the main thread is the only source of change. Bug: chromium:1144777 Change-Id: I7cc9898ad0d8e8c468ba150c0bc6bef3176fd256 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2516475 Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org> Commit-Queue: Michael Stanton <mvstanton@chromium.org> Cr-Commit-Position: refs/heads/master@{#70947}
This commit is contained in:
parent
70a1de97c6
commit
8574179a90
@ -500,11 +500,16 @@ void NexusConfig::SetFeedbackPair(FeedbackVector vector,
|
||||
|
||||
std::pair<MaybeObject, MaybeObject> NexusConfig::GetFeedbackPair(
|
||||
FeedbackVector vector, FeedbackSlot slot) const {
|
||||
base::SharedMutexGuard<base::kShared> shared_mutex_guard(
|
||||
isolate()->feedback_vector_access());
|
||||
if (mode() == BackgroundThread) {
|
||||
isolate()->feedback_vector_access()->LockShared();
|
||||
}
|
||||
MaybeObject feedback = vector.Get(slot);
|
||||
MaybeObject feedback_extra = vector.Get(slot.WithOffset(1));
|
||||
return std::make_pair(feedback, feedback_extra);
|
||||
auto return_value = std::make_pair(feedback, feedback_extra);
|
||||
if (mode() == BackgroundThread) {
|
||||
isolate()->feedback_vector_access()->UnlockShared();
|
||||
}
|
||||
return return_value;
|
||||
}
|
||||
|
||||
FeedbackNexus::FeedbackNexus(Handle<FeedbackVector> vector, FeedbackSlot slot)
|
||||
|
Loading…
Reference in New Issue
Block a user