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:
parent
f4251cc42c
commit
a3aa9e96ef
@ -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;
|
||||||
|
@ -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_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user