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

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

Issue 2225013002: Remove unused isolate parameter from NumberToSize and TryNumberToSize (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | « src/futex-emulation.cc ('k') | src/profiler/heap-snapshot-generator.cc » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/conversions-inl.h" 5 #include "src/conversions-inl.h"
6 #include "src/heap/array-buffer-tracker.h" 6 #include "src/heap/array-buffer-tracker.h"
7 #include "src/heap/heap.h" 7 #include "src/heap/heap.h"
8 #include "src/objects.h" 8 #include "src/objects.h"
9 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 12
13 void ArrayBufferTracker::RegisterNew(Heap* heap, JSArrayBuffer* buffer) { 13 void ArrayBufferTracker::RegisterNew(Heap* heap, JSArrayBuffer* buffer) {
14 void* data = buffer->backing_store(); 14 void* data = buffer->backing_store();
15 if (!data) return; 15 if (!data) return;
16 16
17 size_t length = NumberToSize(heap->isolate(), buffer->byte_length()); 17 size_t length = NumberToSize(buffer->byte_length());
18 Page* page = Page::FromAddress(buffer->address()); 18 Page* page = Page::FromAddress(buffer->address());
19 { 19 {
20 base::LockGuard<base::Mutex> guard(page->mutex()); 20 base::LockGuard<base::Mutex> guard(page->mutex());
21 LocalArrayBufferTracker* tracker = page->local_tracker(); 21 LocalArrayBufferTracker* tracker = page->local_tracker();
22 if (tracker == nullptr) { 22 if (tracker == nullptr) {
23 page->AllocateLocalTracker(); 23 page->AllocateLocalTracker();
24 tracker = page->local_tracker(); 24 tracker = page->local_tracker();
25 } 25 }
26 DCHECK_NOT_NULL(tracker); 26 DCHECK_NOT_NULL(tracker);
27 tracker->Add(buffer, length); 27 tracker->Add(buffer, length);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 TrackingData::iterator it = array_buffers_.find(key); 59 TrackingData::iterator it = array_buffers_.find(key);
60 // Check that we indeed find a key to remove. 60 // Check that we indeed find a key to remove.
61 DCHECK(it != array_buffers_.end()); 61 DCHECK(it != array_buffers_.end());
62 Value value = it->second; 62 Value value = it->second;
63 array_buffers_.erase(it); 63 array_buffers_.erase(it);
64 return value; 64 return value;
65 } 65 }
66 66
67 } // namespace internal 67 } // namespace internal
68 } // namespace v8 68 } // namespace v8
OLDNEW
« no previous file with comments | « src/futex-emulation.cc ('k') | src/profiler/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698