Revision: 3483
Author: [email protected]
Date: Thu Dec 17 01:16:44 2009
Log: Don't bother callling into the ProducerHeapProfile methods
if logging producers is turned off.
Review URL: http://codereview.chromium.org/500092
http://code.google.com/p/v8/source/detail?r=3483
Modified:
/branches/bleeding_edge/src/heap-profiler.cc
/branches/bleeding_edge/src/heap-profiler.h
=======================================
--- /branches/bleeding_edge/src/heap-profiler.cc Thu Nov 5 07:12:36 2009
+++ /branches/bleeding_edge/src/heap-profiler.cc Thu Dec 17 01:16:44 2009
@@ -667,8 +667,9 @@
can_log_ = true;
}
-void ProducerHeapProfile::RecordJSObjectAllocation(Object* obj) {
- if (!can_log_ || !FLAG_log_producers) return;
+void ProducerHeapProfile::DoRecordJSObjectAllocation(Object* obj) {
+ ASSERT(FLAG_log_producers);
+ if (!can_log_) return;
int framesCount = 0;
for (JavaScriptFrameIterator it; !it.done(); it.Advance()) {
++framesCount;
=======================================
--- /branches/bleeding_edge/src/heap-profiler.h Mon Oct 26 03:51:30 2009
+++ /branches/bleeding_edge/src/heap-profiler.h Thu Dec 17 01:16:44 2009
@@ -261,8 +261,12 @@
class ProducerHeapProfile : public AllStatic {
public:
static void Setup();
- static void RecordJSObjectAllocation(Object* obj);
+ static void RecordJSObjectAllocation(Object* obj) {
+ if (FLAG_log_producers) DoRecordJSObjectAllocation(obj);
+ }
+
private:
+ static void DoRecordJSObjectAllocation(Object* obj);
static bool can_log_;
};
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev