diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-03-18 13:49:34 -0700 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-03-20 01:11:01 +0100 |
commit | 83261e789eb903da39f279cb5a161611482e7df5 (patch) | |
tree | 4133b5ca9f53bed4365e1a94544a227d68a0cf12 /deps/v8/src/heap-profiler.cc | |
parent | a05f973f82d2be8527aad4c371d40d3c7e4c564e (diff) | |
download | node-83261e789eb903da39f279cb5a161611482e7df5.tar.gz |
deps: update v8 to 3.17.13
Diffstat (limited to 'deps/v8/src/heap-profiler.cc')
-rw-r--r-- | deps/v8/src/heap-profiler.cc | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/deps/v8/src/heap-profiler.cc b/deps/v8/src/heap-profiler.cc index 301b09993..c9f1d501d 100644 --- a/deps/v8/src/heap-profiler.cc +++ b/deps/v8/src/heap-profiler.cc @@ -28,13 +28,13 @@ #include "v8.h" #include "heap-profiler.h" -#include "profile-generator.h" +#include "heap-snapshot-generator-inl.h" namespace v8 { namespace internal { -HeapProfiler::HeapProfiler() - : snapshots_(new HeapSnapshotsCollection()), +HeapProfiler::HeapProfiler(Heap* heap) + : snapshots_(new HeapSnapshotsCollection(heap)), next_snapshot_uid_(1) { } @@ -45,15 +45,16 @@ HeapProfiler::~HeapProfiler() { void HeapProfiler::ResetSnapshots() { + Heap* the_heap = heap(); delete snapshots_; - snapshots_ = new HeapSnapshotsCollection(); + snapshots_ = new HeapSnapshotsCollection(the_heap); } void HeapProfiler::SetUp() { Isolate* isolate = Isolate::Current(); if (isolate->heap_profiler() == NULL) { - isolate->set_heap_profiler(new HeapProfiler()); + isolate->set_heap_profiler(new HeapProfiler(isolate->heap())); } } @@ -65,23 +66,29 @@ void HeapProfiler::TearDown() { } -HeapSnapshot* HeapProfiler::TakeSnapshot(const char* name, - int type, - v8::ActivityControl* control) { +HeapSnapshot* HeapProfiler::TakeSnapshot( + const char* name, + int type, + v8::ActivityControl* control, + v8::HeapProfiler::ObjectNameResolver* resolver) { ASSERT(Isolate::Current()->heap_profiler() != NULL); return Isolate::Current()->heap_profiler()->TakeSnapshotImpl(name, type, - control); + control, + resolver); } -HeapSnapshot* HeapProfiler::TakeSnapshot(String* name, - int type, - v8::ActivityControl* control) { +HeapSnapshot* HeapProfiler::TakeSnapshot( + String* name, + int type, + v8::ActivityControl* control, + v8::HeapProfiler::ObjectNameResolver* resolver) { ASSERT(Isolate::Current()->heap_profiler() != NULL); return Isolate::Current()->heap_profiler()->TakeSnapshotImpl(name, type, - control); + control, + resolver); } @@ -122,16 +129,18 @@ v8::RetainedObjectInfo* HeapProfiler::ExecuteWrapperClassCallback( } -HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name, - int type, - v8::ActivityControl* control) { +HeapSnapshot* HeapProfiler::TakeSnapshotImpl( + const char* name, + int type, + v8::ActivityControl* control, + v8::HeapProfiler::ObjectNameResolver* resolver) { HeapSnapshot::Type s_type = static_cast<HeapSnapshot::Type>(type); HeapSnapshot* result = snapshots_->NewSnapshot(s_type, name, next_snapshot_uid_++); bool generation_completed = true; switch (s_type) { case HeapSnapshot::kFull: { - HeapSnapshotGenerator generator(result, control); + HeapSnapshotGenerator generator(result, control, resolver, heap()); generation_completed = generator.GenerateSnapshot(); break; } @@ -147,10 +156,13 @@ HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name, } -HeapSnapshot* HeapProfiler::TakeSnapshotImpl(String* name, - int type, - v8::ActivityControl* control) { - return TakeSnapshotImpl(snapshots_->names()->GetName(name), type, control); +HeapSnapshot* HeapProfiler::TakeSnapshotImpl( + String* name, + int type, + v8::ActivityControl* control, + v8::HeapProfiler::ObjectNameResolver* resolver) { + return TakeSnapshotImpl(snapshots_->names()->GetName(name), type, control, + resolver); } void HeapProfiler::StartHeapObjectsTrackingImpl() { |