Heap profiler: guard calls to Producer profile.

Patch by Steve Block.

TBR=ager@chromium.org

Review URL: http://codereview.chromium.org/307018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3105 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9da793a2
...@@ -2133,7 +2133,9 @@ Object* Heap::Allocate(Map* map, AllocationSpace space) { ...@@ -2133,7 +2133,9 @@ Object* Heap::Allocate(Map* map, AllocationSpace space) {
TargetSpaceId(map->instance_type())); TargetSpaceId(map->instance_type()));
if (result->IsFailure()) return result; if (result->IsFailure()) return result;
HeapObject::cast(result)->set_map(map); HeapObject::cast(result)->set_map(map);
#ifdef ENABLE_LOGGING_AND_PROFILING
ProducerHeapProfile::RecordJSObjectAllocation(result); ProducerHeapProfile::RecordJSObjectAllocation(result);
#endif
return result; return result;
} }
...@@ -2455,7 +2457,9 @@ Object* Heap::CopyJSObject(JSObject* source) { ...@@ -2455,7 +2457,9 @@ Object* Heap::CopyJSObject(JSObject* source) {
JSObject::cast(clone)->set_properties(FixedArray::cast(prop)); JSObject::cast(clone)->set_properties(FixedArray::cast(prop));
} }
// Return the new clone. // Return the new clone.
#ifdef ENABLE_LOGGING_AND_PROFILING
ProducerHeapProfile::RecordJSObjectAllocation(clone); ProducerHeapProfile::RecordJSObjectAllocation(clone);
#endif
return clone; return clone;
} }
...@@ -3422,8 +3426,10 @@ bool Heap::Setup(bool create_heap_objects) { ...@@ -3422,8 +3426,10 @@ bool Heap::Setup(bool create_heap_objects) {
LOG(IntEvent("heap-capacity", Capacity())); LOG(IntEvent("heap-capacity", Capacity()));
LOG(IntEvent("heap-available", Available())); LOG(IntEvent("heap-available", Available()));
#ifdef ENABLE_LOGGING_AND_PROFILING
// This should be called only after initial objects have been created. // This should be called only after initial objects have been created.
ProducerHeapProfile::Setup(); ProducerHeapProfile::Setup();
#endif
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment