Make api-arguments.h not include inline headers.

This avoids the inclusion of inline headers (i.e. vm-state-inl.h in this
case) in a normal header. There are three more such violations left in
the code-base after this change.

R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2039913002
Cr-Commit-Position: refs/heads/master@{#36781}
This commit is contained in:
mstarzinger 2016-06-07 02:48:04 -07:00 committed by Commit bot
parent 3e0be8d7fc
commit ea59da53ba
7 changed files with 128 additions and 88 deletions

View File

@ -737,6 +737,7 @@ v8_source_set("v8_base") {
"src/allocation-site-scopes.h", "src/allocation-site-scopes.h",
"src/allocation.cc", "src/allocation.cc",
"src/allocation.h", "src/allocation.h",
"src/api-arguments-inl.h",
"src/api-arguments.cc", "src/api-arguments.cc",
"src/api-arguments.h", "src/api-arguments.h",
"src/api-experimental.cc", "src/api-experimental.cc",

105
src/api-arguments-inl.h Normal file
View File

@ -0,0 +1,105 @@
// 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 {
#define FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(F) \
F(AccessorNameGetterCallback, "get", v8::Value, Object) \
F(GenericNamedPropertyQueryCallback, "has", v8::Integer, Object) \
F(GenericNamedPropertyDeleterCallback, "delete", v8::Boolean, Object)
#define WRITE_CALL_1_NAME(Function, type, ApiReturn, InternalReturn) \
Handle<InternalReturn> PropertyCallbackArguments::Call(Function f, \
Handle<Name> name) { \
Isolate* isolate = this->isolate(); \
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
VMState<EXTERNAL> state(isolate); \
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
PropertyCallbackInfo<ApiReturn> info(begin()); \
LOG(isolate, \
ApiNamedPropertyAccess("interceptor-named-" type, holder(), *name)); \
f(v8::Utils::ToLocal(name), info); \
return GetReturnValue<InternalReturn>(isolate); \
}
FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(WRITE_CALL_1_NAME)
#undef FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME
#undef WRITE_CALL_1_NAME
#define FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX(F) \
F(IndexedPropertyGetterCallback, "get", v8::Value, Object) \
F(IndexedPropertyQueryCallback, "has", v8::Integer, Object) \
F(IndexedPropertyDeleterCallback, "delete", v8::Boolean, Object)
#define WRITE_CALL_1_INDEX(Function, type, ApiReturn, InternalReturn) \
Handle<InternalReturn> PropertyCallbackArguments::Call(Function f, \
uint32_t index) { \
Isolate* isolate = this->isolate(); \
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
VMState<EXTERNAL> state(isolate); \
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
PropertyCallbackInfo<ApiReturn> info(begin()); \
LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-" type, \
holder(), index)); \
f(index, info); \
return GetReturnValue<InternalReturn>(isolate); \
}
FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX(WRITE_CALL_1_INDEX)
#undef FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX
#undef WRITE_CALL_1_INDEX
Handle<Object> PropertyCallbackArguments::Call(
GenericNamedPropertySetterCallback f, Handle<Name> name,
Handle<Object> value) {
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(
isolate, &RuntimeCallStats::GenericNamedPropertySetterCallback);
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Value> info(begin());
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-set", holder(), *name));
f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info);
return GetReturnValue<Object>(isolate);
}
Handle<Object> PropertyCallbackArguments::Call(IndexedPropertySetterCallback f,
uint32_t index,
Handle<Object> value) {
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::IndexedPropertySetterCallback);
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Value> info(begin());
LOG(isolate,
ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index));
f(index, v8::Utils::ToLocal(value), info);
return GetReturnValue<Object>(isolate);
}
void PropertyCallbackArguments::Call(AccessorNameSetterCallback f,
Handle<Name> name, Handle<Object> value) {
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::AccessorNameSetterCallback);
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<void> info(begin());
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-set", holder(), *name));
f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info);
}
} // namespace internal
} // namespace v8

View File

@ -4,6 +4,9 @@
#include "src/api-arguments.h" #include "src/api-arguments.h"
#include "src/tracing/trace-event.h"
#include "src/vm-state-inl.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {

View File

@ -7,8 +7,6 @@
#include "src/api.h" #include "src/api.h"
#include "src/isolate.h" #include "src/isolate.h"
#include "src/tracing/trace-event.h"
#include "src/vm-state-inl.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
@ -108,92 +106,24 @@ class PropertyCallbackArguments
*/ */
Handle<JSObject> Call(IndexedPropertyEnumeratorCallback f); Handle<JSObject> Call(IndexedPropertyEnumeratorCallback f);
#define FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(F) \ inline Handle<Object> Call(AccessorNameGetterCallback f, Handle<Name> name);
F(AccessorNameGetterCallback, "get", v8::Value, Object) \ inline Handle<Object> Call(GenericNamedPropertyQueryCallback f,
F(GenericNamedPropertyQueryCallback, "has", v8::Integer, Object) \ Handle<Name> name);
F(GenericNamedPropertyDeleterCallback, "delete", v8::Boolean, Object) inline Handle<Object> Call(GenericNamedPropertyDeleterCallback f,
Handle<Name> name);
#define WRITE_CALL_1_NAME(Function, type, ApiReturn, InternalReturn) \ inline Handle<Object> Call(IndexedPropertyGetterCallback f, uint32_t index);
Handle<InternalReturn> Call(Function f, Handle<Name> name) { \ inline Handle<Object> Call(IndexedPropertyQueryCallback f, uint32_t index);
Isolate* isolate = this->isolate(); \ inline Handle<Object> Call(IndexedPropertyDeleterCallback f, uint32_t index);
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
VMState<EXTERNAL> state(isolate); \
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
PropertyCallbackInfo<ApiReturn> info(begin()); \
LOG(isolate, \
ApiNamedPropertyAccess("interceptor-named-" type, holder(), *name)); \
f(v8::Utils::ToLocal(name), info); \
return GetReturnValue<InternalReturn>(isolate); \
}
FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(WRITE_CALL_1_NAME) inline Handle<Object> Call(GenericNamedPropertySetterCallback f,
Handle<Name> name, Handle<Object> value);
#undef FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME inline Handle<Object> Call(IndexedPropertySetterCallback f, uint32_t index,
#undef WRITE_CALL_1_NAME Handle<Object> value);
#define FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX(F) \ inline void Call(AccessorNameSetterCallback f, Handle<Name> name,
F(IndexedPropertyGetterCallback, "get", v8::Value, Object) \ Handle<Object> value);
F(IndexedPropertyQueryCallback, "has", v8::Integer, Object) \
F(IndexedPropertyDeleterCallback, "delete", v8::Boolean, Object)
#define WRITE_CALL_1_INDEX(Function, type, ApiReturn, InternalReturn) \
Handle<InternalReturn> Call(Function f, uint32_t index) { \
Isolate* isolate = this->isolate(); \
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
VMState<EXTERNAL> state(isolate); \
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
PropertyCallbackInfo<ApiReturn> info(begin()); \
LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-" type, \
holder(), index)); \
f(index, info); \
return GetReturnValue<InternalReturn>(isolate); \
}
FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX(WRITE_CALL_1_INDEX)
#undef FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX
#undef WRITE_CALL_1_INDEX
Handle<Object> Call(GenericNamedPropertySetterCallback f, Handle<Name> name,
Handle<Object> value) {
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(
isolate, &RuntimeCallStats::GenericNamedPropertySetterCallback);
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Value> info(begin());
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-set", holder(), *name));
f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info);
return GetReturnValue<Object>(isolate);
}
Handle<Object> Call(IndexedPropertySetterCallback f, uint32_t index,
Handle<Object> value) {
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(
isolate, &RuntimeCallStats::IndexedPropertySetterCallback);
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Value> info(begin());
LOG(isolate,
ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index));
f(index, v8::Utils::ToLocal(value), info);
return GetReturnValue<Object>(isolate);
}
void Call(AccessorNameSetterCallback f, Handle<Name> name,
Handle<Object> value) {
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::AccessorNameSetterCallback);
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<void> info(begin());
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-set", holder(), *name));
f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info);
}
private: private:
inline JSObject* holder() { inline JSObject* holder() {

View File

@ -5,8 +5,8 @@
#include "src/ic/ic.h" #include "src/ic/ic.h"
#include "src/accessors.h" #include "src/accessors.h"
#include "src/api-arguments-inl.h"
#include "src/api.h" #include "src/api.h"
#include "src/api-arguments.h"
#include "src/arguments.h" #include "src/arguments.h"
#include "src/base/bits.h" #include "src/base/bits.h"
#include "src/codegen.h" #include "src/codegen.h"
@ -16,14 +16,14 @@
#include "src/frames-inl.h" #include "src/frames-inl.h"
#include "src/ic/call-optimization.h" #include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h" #include "src/ic/handler-compiler.h"
#include "src/ic/ic-inl.h"
#include "src/ic/ic-compiler.h" #include "src/ic/ic-compiler.h"
#include "src/ic/ic-inl.h"
#include "src/ic/stub-cache.h" #include "src/ic/stub-cache.h"
#include "src/isolate-inl.h" #include "src/isolate-inl.h"
#include "src/macro-assembler.h" #include "src/macro-assembler.h"
#include "src/prototype.h" #include "src/prototype.h"
#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h" #include "src/runtime/runtime-utils.h"
#include "src/runtime/runtime.h"
#include "src/tracing/trace-event.h" #include "src/tracing/trace-event.h"
namespace v8 { namespace v8 {

View File

@ -12,7 +12,7 @@
#include "src/accessors.h" #include "src/accessors.h"
#include "src/allocation-site-scopes.h" #include "src/allocation-site-scopes.h"
#include "src/api-arguments.h" #include "src/api-arguments-inl.h"
#include "src/api-natives.h" #include "src/api-natives.h"
#include "src/api.h" #include "src/api.h"
#include "src/base/bits.h" #include "src/base/bits.h"

View File

@ -413,6 +413,7 @@
'api-experimental.h', 'api-experimental.h',
'api.cc', 'api.cc',
'api.h', 'api.h',
'api-arguments-inl.h',
'api-arguments.cc', 'api-arguments.cc',
'api-arguments.h', 'api-arguments.h',
'api-natives.cc', 'api-natives.cc',