2016-03-10 12:14:46 +00:00
|
|
|
// 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"
|
|
|
|
|
2016-06-07 09:48:04 +00:00
|
|
|
#include "src/tracing/trace-event.h"
|
|
|
|
#include "src/vm-state-inl.h"
|
|
|
|
|
2016-03-10 12:14:46 +00:00
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2016-03-10 15:45:28 +00:00
|
|
|
Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) {
|
2016-03-10 12:14:46 +00:00
|
|
|
Isolate* isolate = this->isolate();
|
2016-05-13 15:53:27 +00:00
|
|
|
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::FunctionCallback);
|
2016-03-10 12:14:46 +00:00
|
|
|
VMState<EXTERNAL> state(isolate);
|
|
|
|
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
|
2016-04-27 18:07:21 +00:00
|
|
|
FunctionCallbackInfo<v8::Value> info(begin(), argv_, argc_);
|
2016-03-10 12:14:46 +00:00
|
|
|
f(info);
|
2016-03-10 15:45:28 +00:00
|
|
|
return GetReturnValue<Object>(isolate);
|
2016-03-10 12:14:46 +00:00
|
|
|
}
|
|
|
|
|
2016-03-10 15:45:28 +00:00
|
|
|
Handle<JSObject> PropertyCallbackArguments::Call(
|
|
|
|
IndexedPropertyEnumeratorCallback f) {
|
|
|
|
Isolate* isolate = this->isolate();
|
2016-05-13 15:53:27 +00:00
|
|
|
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::PropertyCallback);
|
2016-03-10 15:45:28 +00:00
|
|
|
VMState<EXTERNAL> state(isolate);
|
|
|
|
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
|
|
|
|
PropertyCallbackInfo<v8::Array> info(begin());
|
|
|
|
f(info);
|
|
|
|
return GetReturnValue<JSObject>(isolate);
|
|
|
|
}
|
2016-03-10 12:14:46 +00:00
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|