OLD | NEW |
---|---|
1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COUNTERS_INL_H_ | 5 #ifndef V8_COUNTERS_INL_H_ |
6 #define V8_COUNTERS_INL_H_ | 6 #define V8_COUNTERS_INL_H_ |
7 | 7 |
8 #include "src/counters.h" | 8 #include "src/counters.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 RuntimeCallTimerScope::RuntimeCallTimerScope( | 13 RuntimeCallTimerScope::RuntimeCallTimerScope( |
14 HeapObject* heap_object, RuntimeCallStats::CounterId counter_id) { | 14 Isolate* isolate, RuntimeCallStats::CounterId counter_id) { |
15 if (V8_UNLIKELY(FLAG_runtime_call_stats)) { | 15 if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED())) { |
16 isolate_ = heap_object->GetIsolate(); | 16 isolate_ = isolate; |
17 is_tracing_ = true; | |
18 RuntimeCallStats::Enter(isolate_->counters()->tracing_runtime_call_stats(), | |
fmeawad
2016/09/07 17:31:28
Do we still need the runtime_call_stats table and
lpy
2016/09/08 18:23:53
Done.
| |
19 &timer_, counter_id); | |
20 } else if (V8_UNLIKELY(FLAG_runtime_call_stats)) { | |
21 isolate_ = isolate; | |
17 RuntimeCallStats::Enter(isolate_->counters()->runtime_call_stats(), &timer_, | 22 RuntimeCallStats::Enter(isolate_->counters()->runtime_call_stats(), &timer_, |
18 counter_id); | 23 counter_id); |
19 } | 24 } |
20 // TODO(lpy): Add a tracing equivalent for the runtime call stats. | 25 } |
26 | |
27 RuntimeCallTimerScope::RuntimeCallTimerScope( | |
28 HeapObject* heap_object, RuntimeCallStats::CounterId counter_id) { | |
29 if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED() || | |
30 FLAG_runtime_call_stats)) { | |
31 RuntimeCallTimerScope(heap_object->GetIsolate(), counter_id); | |
32 } | |
21 } | 33 } |
22 | 34 |
23 } // namespace internal | 35 } // namespace internal |
24 } // namespace v8 | 36 } // namespace v8 |
25 | 37 |
26 #endif // V8_COUNTERS_INL_H_ | 38 #endif // V8_COUNTERS_INL_H_ |
OLD | NEW |