Don't bother callling into the ProducerHeapProfile methods

if logging producers is turned off.
Review URL: http://codereview.chromium.org/500092

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3483 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
kasperl@chromium.org 2009-12-17 09:16:44 +00:00
parent f4251cc42c
commit a3aa9e96ef
2 changed files with 8 additions and 3 deletions

View File

@ -667,8 +667,9 @@ void ProducerHeapProfile::Setup() {
can_log_ = true; can_log_ = true;
} }
void ProducerHeapProfile::RecordJSObjectAllocation(Object* obj) { void ProducerHeapProfile::DoRecordJSObjectAllocation(Object* obj) {
if (!can_log_ || !FLAG_log_producers) return; ASSERT(FLAG_log_producers);
if (!can_log_) return;
int framesCount = 0; int framesCount = 0;
for (JavaScriptFrameIterator it; !it.done(); it.Advance()) { for (JavaScriptFrameIterator it; !it.done(); it.Advance()) {
++framesCount; ++framesCount;

View File

@ -261,8 +261,12 @@ class RetainerHeapProfile BASE_EMBEDDED {
class ProducerHeapProfile : public AllStatic { class ProducerHeapProfile : public AllStatic {
public: public:
static void Setup(); static void Setup();
static void RecordJSObjectAllocation(Object* obj); static void RecordJSObjectAllocation(Object* obj) {
if (FLAG_log_producers) DoRecordJSObjectAllocation(obj);
}
private: private:
static void DoRecordJSObjectAllocation(Object* obj);
static bool can_log_; static bool can_log_;
}; };