// Copyright 2016 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/api-arguments.h" #include "src/tracing/trace-event.h" #include "src/vm-state-inl.h" namespace v8 { namespace internal { Handle FunctionCallbackArguments::Call(FunctionCallback f) { Isolate* isolate = this->isolate(); RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::FunctionCallback); VMState state(isolate); ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); FunctionCallbackInfo info(begin(), argv_, argc_); f(info); return GetReturnValue(isolate); } Handle PropertyCallbackArguments::Call( IndexedPropertyEnumeratorCallback f) { Isolate* isolate = this->isolate(); RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::PropertyCallback); VMState state(isolate); ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); PropertyCallbackInfo info(begin()); f(info); return GetReturnValue(isolate); } } // namespace internal } // namespace v8