Commit a3aa9e96 authored by kasperl@chromium.org's avatar kasperl@chromium.org

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
parent f4251cc4
......@@ -667,8 +667,9 @@ void ProducerHeapProfile::Setup() {
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;
......
......@@ -261,8 +261,12 @@ class RetainerHeapProfile BASE_EMBEDDED {
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_;
};
......
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