1 // Copyright 2016 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_COUNTERS_INL_H_ 6 #define V8_COUNTERS_INL_H_ 7 8 #include "src/counters.h" 9 10 namespace v8 { 11 namespace internal { 12 RuntimeCallTimerScope(Isolate * isolate,RuntimeCallStats::CounterId counter_id)13RuntimeCallTimerScope::RuntimeCallTimerScope( 14 Isolate* isolate, RuntimeCallStats::CounterId counter_id) { 15 if (V8_UNLIKELY(FLAG_runtime_stats)) { 16 Initialize(isolate->counters()->runtime_call_stats(), counter_id); 17 } 18 } 19 RuntimeCallTimerScope(HeapObject * heap_object,RuntimeCallStats::CounterId counter_id)20RuntimeCallTimerScope::RuntimeCallTimerScope( 21 HeapObject* heap_object, RuntimeCallStats::CounterId counter_id) { 22 RuntimeCallTimerScope(heap_object->GetIsolate(), counter_id); 23 } 24 RuntimeCallTimerScope(RuntimeCallStats * stats,RuntimeCallStats::CounterId counter_id)25RuntimeCallTimerScope::RuntimeCallTimerScope( 26 RuntimeCallStats* stats, RuntimeCallStats::CounterId counter_id) { 27 if (V8_UNLIKELY(FLAG_runtime_stats)) { 28 Initialize(stats, counter_id); 29 } 30 } 31 32 } // namespace internal 33 } // namespace v8 34 35 #endif // V8_COUNTERS_INL_H_ 36