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

Side by Side Diff: src/profiler/sampling-heap-profiler.cc

Issue 1733333002: Clear recorded slots when creating filler objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment Created 4 years, 9 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/profiler/allocation-tracker.cc ('k') | src/runtime/runtime-regexp.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 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/profiler/sampling-heap-profiler.h" 5 #include "src/profiler/sampling-heap-profiler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <memory> 8 #include <memory>
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/base/utils/random-number-generator.h" 10 #include "src/base/utils/random-number-generator.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 void SamplingHeapProfiler::SampleObject(Address soon_object, size_t size) { 93 void SamplingHeapProfiler::SampleObject(Address soon_object, size_t size) {
94 DisallowHeapAllocation no_allocation; 94 DisallowHeapAllocation no_allocation;
95 95
96 HandleScope scope(isolate_); 96 HandleScope scope(isolate_);
97 HeapObject* heap_object = HeapObject::FromAddress(soon_object); 97 HeapObject* heap_object = HeapObject::FromAddress(soon_object);
98 Handle<Object> obj(heap_object, isolate_); 98 Handle<Object> obj(heap_object, isolate_);
99 99
100 // Mark the new block as FreeSpace to make sure the heap is iterable while we 100 // Mark the new block as FreeSpace to make sure the heap is iterable while we
101 // are taking the sample. 101 // are taking the sample.
102 heap()->CreateFillerObjectAt(soon_object, static_cast<int>(size)); 102 heap()->CreateFillerObjectAt(soon_object, static_cast<int>(size),
103 ClearRecordedSlots::kNo);
103 104
104 Local<v8::Value> loc = v8::Utils::ToLocal(obj); 105 Local<v8::Value> loc = v8::Utils::ToLocal(obj);
105 106
106 AllocationNode* node = AddStack(); 107 AllocationNode* node = AddStack();
107 node->allocations_[size]++; 108 node->allocations_[size]++;
108 Sample* sample = new Sample(size, node, loc, this); 109 Sample* sample = new Sample(size, node, loc, this);
109 samples_.insert(sample); 110 samples_.insert(sample);
110 sample->global.SetWeak(sample, OnWeakCallback, WeakCallbackType::kParameter); 111 sample->global.SetWeak(sample, OnWeakCallback, WeakCallbackType::kParameter);
111 } 112 }
112 113
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 auto profile = new v8::internal::AllocationProfile(); 246 auto profile = new v8::internal::AllocationProfile();
246 247
247 TranslateAllocationNode(profile, &profile_root_, scripts); 248 TranslateAllocationNode(profile, &profile_root_, scripts);
248 249
249 return profile; 250 return profile;
250 } 251 }
251 252
252 253
253 } // namespace internal 254 } // namespace internal
254 } // namespace v8 255 } // namespace v8
OLDNEW
« no previous file with comments | « src/profiler/allocation-tracker.cc ('k') | src/runtime/runtime-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698