| 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 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 | 9 |
| 10 Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) { | 10 Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) { |
| 11 Isolate* isolate = this->isolate(); | 11 Isolate* isolate = this->isolate(); |
| 12 RuntimeCallTimerScope timer( |
| 13 isolate, &isolate->counters()->runtime_call_stats()->FunctionCallback); |
| 12 VMState<EXTERNAL> state(isolate); | 14 VMState<EXTERNAL> state(isolate); |
| 13 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | 15 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
| 14 FunctionCallbackInfo<v8::Value> info(begin(), argv_, argc_); | 16 FunctionCallbackInfo<v8::Value> info(begin(), argv_, argc_); |
| 15 f(info); | 17 f(info); |
| 16 return GetReturnValue<Object>(isolate); | 18 return GetReturnValue<Object>(isolate); |
| 17 } | 19 } |
| 18 | 20 |
| 19 Handle<JSObject> PropertyCallbackArguments::Call( | 21 Handle<JSObject> PropertyCallbackArguments::Call( |
| 20 IndexedPropertyEnumeratorCallback f) { | 22 IndexedPropertyEnumeratorCallback f) { |
| 21 Isolate* isolate = this->isolate(); | 23 Isolate* isolate = this->isolate(); |
| 24 RuntimeCallTimerScope timer( |
| 25 isolate, &isolate->counters()->runtime_call_stats()->PropertyCallback); |
| 22 VMState<EXTERNAL> state(isolate); | 26 VMState<EXTERNAL> state(isolate); |
| 23 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | 27 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
| 24 PropertyCallbackInfo<v8::Array> info(begin()); | 28 PropertyCallbackInfo<v8::Array> info(begin()); |
| 25 f(info); | 29 f(info); |
| 26 return GetReturnValue<JSObject>(isolate); | 30 return GetReturnValue<JSObject>(isolate); |
| 27 } | 31 } |
| 28 | 32 |
| 29 } // namespace internal | 33 } // namespace internal |
| 30 } // namespace v8 | 34 } // namespace v8 |
| OLD | NEW |