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;
|
||||
}
|
||||
|
||||
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_;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user