OLD | NEW |
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 Loading... |
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 |
OLD | NEW |