Commit b4c9706e authored by lpy's avatar lpy Committed by Commit bot

Add delegating initialize method for RuntimeCallTimerScope.

BUG=v8:5089

Review-Url: https://codereview.chromium.org/2329053002
Cr-Commit-Position: refs/heads/master@{#39324}
parent c9516ded
......@@ -14,9 +14,7 @@ RuntimeCallTimerScope::RuntimeCallTimerScope(
Isolate* isolate, RuntimeCallStats::CounterId counter_id) {
if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED() ||
FLAG_runtime_call_stats)) {
isolate_ = isolate;
RuntimeCallStats::Enter(isolate_->counters()->runtime_call_stats(), &timer_,
counter_id);
Initialize(isolate, counter_id);
}
}
......@@ -24,7 +22,7 @@ RuntimeCallTimerScope::RuntimeCallTimerScope(
HeapObject* heap_object, RuntimeCallStats::CounterId counter_id) {
if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED() ||
FLAG_runtime_call_stats)) {
RuntimeCallTimerScope(heap_object->GetIsolate(), counter_id);
Initialize(heap_object->GetIsolate(), counter_id);
}
}
......
......@@ -1257,6 +1257,13 @@ class RuntimeCallTimerScope {
}
private:
V8_INLINE void Initialize(Isolate* isolate,
RuntimeCallStats::CounterId counter_id) {
isolate_ = isolate;
RuntimeCallStats::Enter(isolate_->counters()->runtime_call_stats(), &timer_,
counter_id);
}
Isolate* isolate_ = nullptr;
RuntimeCallTimer timer_;
};
......
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