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 #include "src/api-arguments.h" | 5 #include "src/api-arguments.h" |
6 | 6 |
7 #include "src/tracing/trace-event.h" | 7 #include "src/tracing/trace-event.h" |
8 #include "src/vm-state-inl.h" | 8 #include "src/vm-state-inl.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) { | 13 Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) { |
14 Isolate* isolate = this->isolate(); | 14 Isolate* isolate = this->isolate(); |
15 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::FunctionCallback); | 15 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::FunctionCallback); |
16 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | |
17 isolate, &internal::tracing::TraceEventStatsTable::FunctionCallback); | |
18 VMState<EXTERNAL> state(isolate); | 16 VMState<EXTERNAL> state(isolate); |
19 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | 17 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
20 FunctionCallbackInfo<v8::Value> info(begin(), argv_, argc_); | 18 FunctionCallbackInfo<v8::Value> info(begin(), argv_, argc_); |
21 f(info); | 19 f(info); |
22 return GetReturnValue<Object>(isolate); | 20 return GetReturnValue<Object>(isolate); |
23 } | 21 } |
24 | 22 |
25 Handle<JSObject> PropertyCallbackArguments::Call( | 23 Handle<JSObject> PropertyCallbackArguments::Call( |
26 IndexedPropertyEnumeratorCallback f) { | 24 IndexedPropertyEnumeratorCallback f) { |
27 Isolate* isolate = this->isolate(); | 25 Isolate* isolate = this->isolate(); |
28 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::PropertyCallback); | 26 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::PropertyCallback); |
29 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | |
30 isolate, &internal::tracing::TraceEventStatsTable::PropertyCallback); | |
31 VMState<EXTERNAL> state(isolate); | 27 VMState<EXTERNAL> state(isolate); |
32 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | 28 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
33 PropertyCallbackInfo<v8::Array> info(begin()); | 29 PropertyCallbackInfo<v8::Array> info(begin()); |
34 f(info); | 30 f(info); |
35 return GetReturnValue<JSObject>(isolate); | 31 return GetReturnValue<JSObject>(isolate); |
36 } | 32 } |
37 | 33 |
38 } // namespace internal | 34 } // namespace internal |
39 } // namespace v8 | 35 } // namespace v8 |
OLD | NEW |