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

Side by Side Diff: src/allocation-tracker.cc

Issue 882443004: Revert of Only use FreeSpace objects in the free list. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/api.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/allocation-tracker.h" 7 #include "src/allocation-tracker.h"
8 #include "src/frames-inl.h" 8 #include "src/frames-inl.h"
9 #include "src/heap-snapshot-generator.h" 9 #include "src/heap-snapshot-generator.h"
10 10
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 } 221 }
222 222
223 223
224 void AllocationTracker::AllocationEvent(Address addr, int size) { 224 void AllocationTracker::AllocationEvent(Address addr, int size) {
225 DisallowHeapAllocation no_allocation; 225 DisallowHeapAllocation no_allocation;
226 Heap* heap = ids_->heap(); 226 Heap* heap = ids_->heap();
227 227
228 // Mark the new block as FreeSpace to make sure the heap is iterable 228 // Mark the new block as FreeSpace to make sure the heap is iterable
229 // while we are capturing stack trace. 229 // while we are capturing stack trace.
230 heap->CreateFillerObjectAt(addr, size); 230 FreeListNode::FromAddress(addr)->set_size(heap, size);
231 DCHECK_EQ(HeapObject::FromAddress(addr)->Size(), size);
232 DCHECK(FreeListNode::IsFreeListNode(HeapObject::FromAddress(addr)));
231 233
232 Isolate* isolate = heap->isolate(); 234 Isolate* isolate = heap->isolate();
233 int length = 0; 235 int length = 0;
234 StackTraceFrameIterator it(isolate); 236 StackTraceFrameIterator it(isolate);
235 while (!it.done() && length < kMaxAllocationTraceLength) { 237 while (!it.done() && length < kMaxAllocationTraceLength) {
236 JavaScriptFrame* frame = it.frame(); 238 JavaScriptFrame* frame = it.frame();
237 SharedFunctionInfo* shared = frame->function()->shared(); 239 SharedFunctionInfo* shared = frame->function()->shared();
238 SnapshotObjectId id = ids_->FindOrAddEntry( 240 SnapshotObjectId id = ids_->FindOrAddEntry(
239 shared->address(), shared->Size(), false); 241 shared->address(), shared->Size(), false);
240 allocation_trace_buffer_[length++] = AddFunctionInfo(shared, id); 242 allocation_trace_buffer_[length++] = AddFunctionInfo(shared, id);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 void AllocationTracker::UnresolvedLocation::HandleWeakScript( 333 void AllocationTracker::UnresolvedLocation::HandleWeakScript(
332 const v8::WeakCallbackData<v8::Value, void>& data) { 334 const v8::WeakCallbackData<v8::Value, void>& data) {
333 UnresolvedLocation* loc = 335 UnresolvedLocation* loc =
334 reinterpret_cast<UnresolvedLocation*>(data.GetParameter()); 336 reinterpret_cast<UnresolvedLocation*>(data.GetParameter());
335 GlobalHandles::Destroy(reinterpret_cast<Object**>(loc->script_.location())); 337 GlobalHandles::Destroy(reinterpret_cast<Object**>(loc->script_.location()));
336 loc->script_ = Handle<Script>::null(); 338 loc->script_ = Handle<Script>::null();
337 } 339 }
338 340
339 341
340 } } // namespace v8::internal 342 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698