Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: src/heap/array-buffer-tracker.cc

Issue 2826593004: [heap] Reland: Take page lock when scavenging old to new references in Scavenger. (Closed)
Patch Set: Use recursive mutex. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/array-buffer-tracker-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/array-buffer-tracker.h" 5 #include "src/heap/array-buffer-tracker.h"
6 #include "src/heap/array-buffer-tracker-inl.h" 6 #include "src/heap/array-buffer-tracker-inl.h"
7 #include "src/heap/heap.h" 7 #include "src/heap/heap.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return mode == kUpdateForwardedKeepOthers 123 return mode == kUpdateForwardedKeepOthers
124 ? LocalArrayBufferTracker::kKeepEntry 124 ? LocalArrayBufferTracker::kKeepEntry
125 : LocalArrayBufferTracker::kRemoveEntry; 125 : LocalArrayBufferTracker::kRemoveEntry;
126 }); 126 });
127 return tracker->IsEmpty(); 127 return tracker->IsEmpty();
128 } 128 }
129 129
130 bool ArrayBufferTracker::IsTracked(JSArrayBuffer* buffer) { 130 bool ArrayBufferTracker::IsTracked(JSArrayBuffer* buffer) {
131 Page* page = Page::FromAddress(buffer->address()); 131 Page* page = Page::FromAddress(buffer->address());
132 { 132 {
133 base::LockGuard<base::Mutex> guard(page->mutex()); 133 base::LockGuard<base::RecursiveMutex> guard(page->mutex());
134 LocalArrayBufferTracker* tracker = page->local_tracker(); 134 LocalArrayBufferTracker* tracker = page->local_tracker();
135 if (tracker == nullptr) return false; 135 if (tracker == nullptr) return false;
136 return tracker->IsTracked(buffer); 136 return tracker->IsTracked(buffer);
137 } 137 }
138 } 138 }
139 139
140 } // namespace internal 140 } // namespace internal
141 } // namespace v8 141 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/array-buffer-tracker-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698