[api] Remove FLAG_log_api
API logging has not been used in a while and we have valid alternatives: - Runtime call stats - Profiling - Timer events Together they make --log-api superfluous and we can remove it and reduce the number of branches when calling into the V8 API. Change-Id: Ie10f70b61ebdb82166270e7630ebcf20a27c4902 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574549 Reviewed-by: Marja Hölttä <marja@chromium.org> Auto-Submit: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Jakob Linke <jgruber@chromium.org> Commit-Queue: Jakob Linke <jgruber@chromium.org> Cr-Commit-Position: refs/heads/main@{#79904}
This commit is contained in:
parent
e94b84a893
commit
1b8d4e3adb
@ -87,24 +87,22 @@ inline JSReceiver FunctionCallbackArguments::holder() {
|
||||
ExternalCallbackScope call_scope(ISOLATE, FUNCTION_ADDR(F)); \
|
||||
PropertyCallbackInfo<API_RETURN_TYPE> callback_info(values_);
|
||||
|
||||
#define CREATE_NAMED_CALLBACK(FUNCTION, TYPE, RETURN_TYPE, API_RETURN_TYPE, \
|
||||
INFO_FOR_SIDE_EFFECT) \
|
||||
Handle<RETURN_TYPE> PropertyCallbackArguments::CallNamed##FUNCTION( \
|
||||
Handle<InterceptorInfo> interceptor, Handle<Name> name) { \
|
||||
DCHECK_NAME_COMPATIBLE(interceptor, name); \
|
||||
Isolate* isolate = this->isolate(); \
|
||||
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamed##FUNCTION##Callback); \
|
||||
Handle<Object> receiver_check_unsupported; \
|
||||
GenericNamedProperty##FUNCTION##Callback f = \
|
||||
ToCData<GenericNamedProperty##FUNCTION##Callback>( \
|
||||
interceptor->TYPE()); \
|
||||
PREPARE_CALLBACK_INFO(isolate, f, Handle<RETURN_TYPE>, API_RETURN_TYPE, \
|
||||
INFO_FOR_SIDE_EFFECT, receiver_check_unsupported, \
|
||||
NotAccessor); \
|
||||
LOG(isolate, \
|
||||
ApiNamedPropertyAccess("interceptor-named-" #TYPE, holder(), *name)); \
|
||||
f(v8::Utils::ToLocal(name), callback_info); \
|
||||
return GetReturnValue<RETURN_TYPE>(isolate); \
|
||||
#define CREATE_NAMED_CALLBACK(FUNCTION, TYPE, RETURN_TYPE, API_RETURN_TYPE, \
|
||||
INFO_FOR_SIDE_EFFECT) \
|
||||
Handle<RETURN_TYPE> PropertyCallbackArguments::CallNamed##FUNCTION( \
|
||||
Handle<InterceptorInfo> interceptor, Handle<Name> name) { \
|
||||
DCHECK_NAME_COMPATIBLE(interceptor, name); \
|
||||
Isolate* isolate = this->isolate(); \
|
||||
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamed##FUNCTION##Callback); \
|
||||
Handle<Object> receiver_check_unsupported; \
|
||||
GenericNamedProperty##FUNCTION##Callback f = \
|
||||
ToCData<GenericNamedProperty##FUNCTION##Callback>( \
|
||||
interceptor->TYPE()); \
|
||||
PREPARE_CALLBACK_INFO(isolate, f, Handle<RETURN_TYPE>, API_RETURN_TYPE, \
|
||||
INFO_FOR_SIDE_EFFECT, receiver_check_unsupported, \
|
||||
NotAccessor); \
|
||||
f(v8::Utils::ToLocal(name), callback_info); \
|
||||
return GetReturnValue<RETURN_TYPE>(isolate); \
|
||||
}
|
||||
|
||||
FOR_EACH_CALLBACK(CREATE_NAMED_CALLBACK)
|
||||
@ -123,8 +121,6 @@ FOR_EACH_CALLBACK(CREATE_NAMED_CALLBACK)
|
||||
PREPARE_CALLBACK_INFO(isolate, f, Handle<RETURN_TYPE>, API_RETURN_TYPE, \
|
||||
INFO_FOR_SIDE_EFFECT, receiver_check_unsupported, \
|
||||
NotAccessor); \
|
||||
LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-" #TYPE, \
|
||||
holder(), index)); \
|
||||
f(index, callback_info); \
|
||||
return GetReturnValue<RETURN_TYPE>(isolate); \
|
||||
}
|
||||
@ -136,7 +132,6 @@ FOR_EACH_CALLBACK(CREATE_INDEXED_CALLBACK)
|
||||
|
||||
Handle<Object> FunctionCallbackArguments::Call(CallHandlerInfo handler) {
|
||||
Isolate* isolate = this->isolate();
|
||||
LOG(isolate, ApiObjectAccess("call", holder()));
|
||||
RCS_SCOPE(isolate, RuntimeCallCounterId::kFunctionCallback);
|
||||
v8::FunctionCallback f =
|
||||
v8::ToCData<v8::FunctionCallback>(handler.callback());
|
||||
@ -156,7 +151,6 @@ Handle<Object> FunctionCallbackArguments::Call(CallHandlerInfo handler) {
|
||||
Handle<JSObject> PropertyCallbackArguments::CallNamedEnumerator(
|
||||
Handle<InterceptorInfo> interceptor) {
|
||||
DCHECK(interceptor->is_named());
|
||||
LOG(isolate(), ApiObjectAccess("interceptor-named-enumerator", holder()));
|
||||
RCS_SCOPE(isolate(), RuntimeCallCounterId::kNamedEnumeratorCallback);
|
||||
return CallPropertyEnumerator(interceptor);
|
||||
}
|
||||
@ -164,7 +158,6 @@ Handle<JSObject> PropertyCallbackArguments::CallNamedEnumerator(
|
||||
Handle<JSObject> PropertyCallbackArguments::CallIndexedEnumerator(
|
||||
Handle<InterceptorInfo> interceptor) {
|
||||
DCHECK(!interceptor->is_named());
|
||||
LOG(isolate(), ApiObjectAccess("interceptor-indexed-enumerator", holder()));
|
||||
RCS_SCOPE(isolate(), RuntimeCallCounterId::kIndexedEnumeratorCallback);
|
||||
return CallPropertyEnumerator(interceptor);
|
||||
}
|
||||
@ -174,8 +167,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedGetter(
|
||||
DCHECK_NAME_COMPATIBLE(interceptor, name);
|
||||
Isolate* isolate = this->isolate();
|
||||
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedGetterCallback);
|
||||
LOG(isolate,
|
||||
ApiNamedPropertyAccess("interceptor-named-getter", holder(), *name));
|
||||
GenericNamedPropertyGetterCallback f =
|
||||
ToCData<GenericNamedPropertyGetterCallback>(interceptor->getter());
|
||||
return BasicCallNamedGetterCallback(f, name, interceptor);
|
||||
@ -186,8 +177,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedDescriptor(
|
||||
DCHECK_NAME_COMPATIBLE(interceptor, name);
|
||||
Isolate* isolate = this->isolate();
|
||||
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedDescriptorCallback);
|
||||
LOG(isolate,
|
||||
ApiNamedPropertyAccess("interceptor-named-descriptor", holder(), *name));
|
||||
GenericNamedPropertyDescriptorCallback f =
|
||||
ToCData<GenericNamedPropertyDescriptorCallback>(
|
||||
interceptor->descriptor());
|
||||
@ -215,8 +204,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedSetter(
|
||||
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedSetterCallback);
|
||||
PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>,
|
||||
v8::Value);
|
||||
LOG(isolate,
|
||||
ApiNamedPropertyAccess("interceptor-named-set", holder(), *name));
|
||||
f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), callback_info);
|
||||
return GetReturnValue<Object>(isolate);
|
||||
}
|
||||
@ -231,8 +218,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedDefiner(
|
||||
ToCData<GenericNamedPropertyDefinerCallback>(interceptor->definer());
|
||||
PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>,
|
||||
v8::Value);
|
||||
LOG(isolate,
|
||||
ApiNamedPropertyAccess("interceptor-named-define", holder(), *name));
|
||||
f(v8::Utils::ToLocal(name), desc, callback_info);
|
||||
return GetReturnValue<Object>(isolate);
|
||||
}
|
||||
@ -246,8 +231,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedSetter(
|
||||
ToCData<IndexedPropertySetterCallback>(interceptor->setter());
|
||||
PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>,
|
||||
v8::Value);
|
||||
LOG(isolate,
|
||||
ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index));
|
||||
f(index, v8::Utils::ToLocal(value), callback_info);
|
||||
return GetReturnValue<Object>(isolate);
|
||||
}
|
||||
@ -262,8 +245,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedDefiner(
|
||||
ToCData<IndexedPropertyDefinerCallback>(interceptor->definer());
|
||||
PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>,
|
||||
v8::Value);
|
||||
LOG(isolate,
|
||||
ApiIndexedPropertyAccess("interceptor-indexed-define", holder(), index));
|
||||
f(index, desc, callback_info);
|
||||
return GetReturnValue<Object>(isolate);
|
||||
}
|
||||
@ -273,8 +254,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedGetter(
|
||||
DCHECK(!interceptor->is_named());
|
||||
Isolate* isolate = this->isolate();
|
||||
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedGetterCallback);
|
||||
LOG(isolate,
|
||||
ApiIndexedPropertyAccess("interceptor-indexed-getter", holder(), index));
|
||||
IndexedPropertyGetterCallback f =
|
||||
ToCData<IndexedPropertyGetterCallback>(interceptor->getter());
|
||||
return BasicCallIndexedGetterCallback(f, index, interceptor);
|
||||
@ -285,8 +264,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedDescriptor(
|
||||
DCHECK(!interceptor->is_named());
|
||||
Isolate* isolate = this->isolate();
|
||||
RCS_SCOPE(isolate, RuntimeCallCounterId::kIndexedDescriptorCallback);
|
||||
LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-descriptor",
|
||||
holder(), index));
|
||||
IndexedPropertyDescriptorCallback f =
|
||||
ToCData<IndexedPropertyDescriptorCallback>(interceptor->descriptor());
|
||||
return BasicCallIndexedGetterCallback(f, index, interceptor);
|
||||
@ -323,7 +300,6 @@ Handle<Object> PropertyCallbackArguments::CallAccessorGetter(
|
||||
Handle<AccessorInfo> info, Handle<Name> name) {
|
||||
Isolate* isolate = this->isolate();
|
||||
RCS_SCOPE(isolate, RuntimeCallCounterId::kAccessorGetterCallback);
|
||||
LOG(isolate, ApiNamedPropertyAccess("accessor-getter", holder(), *name));
|
||||
AccessorNameGetterCallback f =
|
||||
ToCData<AccessorNameGetterCallback>(info->getter());
|
||||
return BasicCallNamedGetterCallback(f, name, info,
|
||||
@ -339,7 +315,6 @@ Handle<Object> PropertyCallbackArguments::CallAccessorSetter(
|
||||
ToCData<AccessorNameSetterCallback>(accessor_info->setter());
|
||||
PREPARE_CALLBACK_INFO(isolate, f, Handle<Object>, void, accessor_info,
|
||||
handle(receiver(), isolate), Setter);
|
||||
LOG(isolate, ApiNamedPropertyAccess("accessor-setter", holder(), *name));
|
||||
f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), callback_info);
|
||||
return GetReturnValue<Object>(isolate);
|
||||
}
|
||||
|
@ -35,10 +35,9 @@
|
||||
* TODO(verwaest): Remove calls form API methods to DO_NOT_USE macros.
|
||||
*/
|
||||
|
||||
#define LOG_API(isolate, class_name, function_name) \
|
||||
RCS_SCOPE(isolate, \
|
||||
i::RuntimeCallCounterId::kAPI_##class_name##_##function_name); \
|
||||
LOG(isolate, ApiEntryCall("v8::" #class_name "::" #function_name))
|
||||
#define API_RCS_SCOPE(isolate, class_name, function_name) \
|
||||
RCS_SCOPE(isolate, \
|
||||
i::RuntimeCallCounterId::kAPI_##class_name##_##function_name);
|
||||
|
||||
#define ENTER_V8_DO_NOT_USE(isolate) i::VMState<v8::OTHER> __state__((isolate))
|
||||
|
||||
@ -50,7 +49,7 @@
|
||||
} \
|
||||
HandleScopeClass handle_scope(isolate); \
|
||||
CallDepthScope<do_callback> call_depth_scope(isolate, context); \
|
||||
LOG_API(isolate, class_name, function_name); \
|
||||
API_RCS_SCOPE(isolate, class_name, function_name); \
|
||||
i::VMState<v8::OTHER> __state__((isolate)); \
|
||||
bool has_pending_exception = false
|
||||
|
||||
|
132
src/api/api.cc
132
src/api/api.cc
@ -814,7 +814,7 @@ namespace internal {
|
||||
i::Address* GlobalizeTracedReference(i::Isolate* isolate, i::Address* obj,
|
||||
internal::Address* slot,
|
||||
GlobalHandleStoreMode store_mode) {
|
||||
LOG_API(isolate, TracedGlobal, New);
|
||||
API_RCS_SCOPE(isolate, TracedGlobal, New);
|
||||
#ifdef DEBUG
|
||||
Utils::ApiCheck((slot != nullptr), "v8::GlobalizeTracedReference",
|
||||
"the address slot must be not null");
|
||||
@ -847,7 +847,7 @@ void DisposeTracedReference(internal::Address* location) {
|
||||
namespace api_internal {
|
||||
|
||||
i::Address* GlobalizeReference(i::Isolate* isolate, i::Address* obj) {
|
||||
LOG_API(isolate, Persistent, New);
|
||||
API_RCS_SCOPE(isolate, Persistent, New);
|
||||
i::Handle<i::Object> result = isolate->global_handles()->Create(*obj);
|
||||
#ifdef VERIFY_HEAP
|
||||
if (i::FLAG_verify_heap) {
|
||||
@ -1338,7 +1338,7 @@ Local<FunctionTemplate> FunctionTemplate::New(
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
// Changes to the environment cannot be captured in the snapshot. Expect no
|
||||
// function templates when the isolate is created for serialization.
|
||||
LOG_API(i_isolate, FunctionTemplate, New);
|
||||
API_RCS_SCOPE(i_isolate, FunctionTemplate, New);
|
||||
|
||||
if (!Utils::ApiCheck(
|
||||
!c_function || behavior == ConstructorBehavior::kThrow,
|
||||
@ -1363,7 +1363,7 @@ Local<FunctionTemplate> FunctionTemplate::NewWithCFunctionOverloads(
|
||||
SideEffectType side_effect_type,
|
||||
const MemorySpan<const CFunction>& c_function_overloads) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, FunctionTemplate, New);
|
||||
API_RCS_SCOPE(i_isolate, FunctionTemplate, New);
|
||||
|
||||
if (!Utils::ApiCheck(
|
||||
c_function_overloads.size() == 0 ||
|
||||
@ -1384,7 +1384,7 @@ Local<FunctionTemplate> FunctionTemplate::NewWithCache(
|
||||
Local<Value> data, Local<Signature> signature, int length,
|
||||
SideEffectType side_effect_type) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, FunctionTemplate, NewWithCache);
|
||||
API_RCS_SCOPE(i_isolate, FunctionTemplate, NewWithCache);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
return FunctionTemplateNew(i_isolate, callback, data, signature, length,
|
||||
ConstructorBehavior::kAllow, false, cache_property,
|
||||
@ -1567,7 +1567,7 @@ Local<ObjectTemplate> ObjectTemplate::New(
|
||||
static Local<ObjectTemplate> ObjectTemplateNew(
|
||||
i::Isolate* isolate, v8::Local<FunctionTemplate> constructor,
|
||||
bool do_not_cache) {
|
||||
LOG_API(isolate, ObjectTemplate, New);
|
||||
API_RCS_SCOPE(isolate, ObjectTemplate, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
i::Handle<i::Struct> struct_obj = isolate->factory()->NewStruct(
|
||||
i::OBJECT_TEMPLATE_INFO_TYPE, i::AllocationType::kOld);
|
||||
@ -2032,7 +2032,7 @@ Local<Script> UnboundScript::BindToCurrentContext() {
|
||||
int UnboundScript::GetId() const {
|
||||
auto function_info = i::SharedFunctionInfo::cast(*Utils::OpenHandle(this));
|
||||
i::Isolate* isolate = function_info.GetIsolate();
|
||||
LOG_API(isolate, UnboundScript, GetId);
|
||||
API_RCS_SCOPE(isolate, UnboundScript, GetId);
|
||||
return i::Script::cast(function_info.script()).id();
|
||||
}
|
||||
|
||||
@ -2041,7 +2041,7 @@ int UnboundScript::GetLineNumber(int code_pos) {
|
||||
i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(this));
|
||||
i::Isolate* isolate = obj->GetIsolate();
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
LOG_API(isolate, UnboundScript, GetLineNumber);
|
||||
API_RCS_SCOPE(isolate, UnboundScript, GetLineNumber);
|
||||
if (obj->script().IsScript()) {
|
||||
i::Handle<i::Script> script(i::Script::cast(obj->script()), isolate);
|
||||
return i::Script::GetLineNumber(script, code_pos);
|
||||
@ -2055,7 +2055,7 @@ Local<Value> UnboundScript::GetScriptName() {
|
||||
i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(this));
|
||||
i::Isolate* isolate = obj->GetIsolate();
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
LOG_API(isolate, UnboundScript, GetName);
|
||||
API_RCS_SCOPE(isolate, UnboundScript, GetName);
|
||||
if (obj->script().IsScript()) {
|
||||
i::Object name = i::Script::cast(obj->script()).name();
|
||||
return Utils::ToLocal(i::Handle<i::Object>(name, isolate));
|
||||
@ -2069,7 +2069,7 @@ Local<Value> UnboundScript::GetSourceURL() {
|
||||
i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(this));
|
||||
i::Isolate* isolate = obj->GetIsolate();
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
LOG_API(isolate, UnboundScript, GetSourceURL);
|
||||
API_RCS_SCOPE(isolate, UnboundScript, GetSourceURL);
|
||||
if (obj->script().IsScript()) {
|
||||
i::Object url = i::Script::cast(obj->script()).source_url();
|
||||
return Utils::ToLocal(i::Handle<i::Object>(url, isolate));
|
||||
@ -2082,7 +2082,7 @@ Local<Value> UnboundScript::GetSourceMappingURL() {
|
||||
i::Handle<i::SharedFunctionInfo> obj =
|
||||
i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(this));
|
||||
i::Isolate* isolate = obj->GetIsolate();
|
||||
LOG_API(isolate, UnboundScript, GetSourceMappingURL);
|
||||
API_RCS_SCOPE(isolate, UnboundScript, GetSourceMappingURL);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
if (obj->script().IsScript()) {
|
||||
i::Object url = i::Script::cast(obj->script()).source_mapping_url();
|
||||
@ -4011,7 +4011,7 @@ std::unique_ptr<v8::BackingStore> v8::BackingStore::Reallocate(
|
||||
v8::Isolate* isolate, std::unique_ptr<v8::BackingStore> backing_store,
|
||||
size_t byte_length) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, ArrayBuffer, BackingStore_Reallocate);
|
||||
API_RCS_SCOPE(i_isolate, ArrayBuffer, BackingStore_Reallocate);
|
||||
Utils::ApiCheck(byte_length <= i::JSArrayBuffer::kMaxByteLength,
|
||||
"v8::BackingStore::Reallocate", "byte_lenght is too large");
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
@ -4241,7 +4241,7 @@ bool Value::SameValue(Local<Value> that) const {
|
||||
Local<String> Value::TypeOf(v8::Isolate* external_isolate) {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
LOG_API(isolate, Value, TypeOf);
|
||||
API_RCS_SCOPE(isolate, Value, TypeOf);
|
||||
return Utils::ToLocal(i::Object::TypeOf(isolate, Utils::OpenHandle(this)));
|
||||
}
|
||||
|
||||
@ -5171,7 +5171,7 @@ MaybeLocal<Function> Function::New(Local<Context> context,
|
||||
int length, ConstructorBehavior behavior,
|
||||
SideEffectType side_effect_type) {
|
||||
i::Isolate* isolate = Utils::OpenHandle(*context)->GetIsolate();
|
||||
LOG_API(isolate, Function, New);
|
||||
API_RCS_SCOPE(isolate, Function, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
auto templ =
|
||||
FunctionTemplateNew(isolate, callback, data, Local<Signature>(), length,
|
||||
@ -5677,7 +5677,7 @@ int String::WriteUtf8(Isolate* v8_isolate, char* buffer, int capacity,
|
||||
int* nchars_ref, int options) const {
|
||||
i::Handle<i::String> str = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
||||
LOG_API(isolate, String, WriteUtf8);
|
||||
API_RCS_SCOPE(isolate, String, WriteUtf8);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
str = i::String::Flatten(isolate, str);
|
||||
i::DisallowGarbageCollection no_gc;
|
||||
@ -5695,7 +5695,7 @@ template <typename CharType>
|
||||
static inline int WriteHelper(i::Isolate* isolate, const String* string,
|
||||
CharType* buffer, int start, int length,
|
||||
int options) {
|
||||
LOG_API(isolate, String, Write);
|
||||
API_RCS_SCOPE(isolate, String, Write);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
DCHECK(start >= 0 && length >= -1);
|
||||
i::Handle<i::String> str = Utils::OpenHandle(string);
|
||||
@ -6376,7 +6376,7 @@ Local<Context> NewContext(
|
||||
CHECK(isolate->builtins()->code(i::Builtin::kIllegal).IsCodeT());
|
||||
|
||||
TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.NewContext");
|
||||
LOG_API(isolate, Context, New);
|
||||
API_RCS_SCOPE(isolate, Context, New);
|
||||
i::HandleScope scope(isolate);
|
||||
ExtensionConfiguration no_extensions;
|
||||
if (extensions == nullptr) extensions = &no_extensions;
|
||||
@ -6421,7 +6421,7 @@ MaybeLocal<Object> v8::Context::NewRemoteContext(
|
||||
v8::Isolate* external_isolate, v8::Local<ObjectTemplate> global_template,
|
||||
v8::MaybeLocal<v8::Value> global_object) {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate);
|
||||
LOG_API(isolate, Context, NewRemoteContext);
|
||||
API_RCS_SCOPE(isolate, Context, NewRemoteContext);
|
||||
i::HandleScope scope(isolate);
|
||||
i::Handle<i::FunctionTemplateInfo> global_constructor =
|
||||
EnsureConstructor(isolate, *global_template);
|
||||
@ -6691,7 +6691,7 @@ MaybeLocal<v8::Function> FunctionTemplate::GetFunction(Local<Context> context) {
|
||||
MaybeLocal<v8::Object> FunctionTemplate::NewRemoteInstance() {
|
||||
auto self = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = self->GetIsolate();
|
||||
LOG_API(isolate, FunctionTemplate, NewRemoteInstance);
|
||||
API_RCS_SCOPE(isolate, FunctionTemplate, NewRemoteInstance);
|
||||
i::HandleScope scope(isolate);
|
||||
i::Handle<i::FunctionTemplateInfo> constructor =
|
||||
EnsureConstructor(isolate, *InstanceTemplate());
|
||||
@ -6752,7 +6752,7 @@ Local<External> v8::External::New(Isolate* isolate, void* value) {
|
||||
// constructors.
|
||||
DCHECK_NOT_NULL(value);
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, External, New);
|
||||
API_RCS_SCOPE(i_isolate, External, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::JSObject> external = i_isolate->factory()->NewExternal(value);
|
||||
return Utils::ExternalToLocal(external);
|
||||
@ -6828,7 +6828,7 @@ STATIC_ASSERT(v8::String::kMaxLength == i::String::kMaxLength);
|
||||
} else { \
|
||||
i::Isolate* i_isolate = reinterpret_cast<internal::Isolate*>(isolate); \
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); \
|
||||
LOG_API(i_isolate, class_name, function_name); \
|
||||
API_RCS_SCOPE(i_isolate, class_name, function_name); \
|
||||
if (length < 0) length = StringLength(data); \
|
||||
i::Handle<i::String> handle_result = \
|
||||
NewString(i_isolate->factory(), type, \
|
||||
@ -6842,7 +6842,7 @@ Local<String> String::NewFromUtf8Literal(Isolate* isolate, const char* literal,
|
||||
DCHECK_LE(length, i::String::kMaxLength);
|
||||
i::Isolate* i_isolate = reinterpret_cast<internal::Isolate*>(isolate);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
LOG_API(i_isolate, String, NewFromUtf8Literal);
|
||||
API_RCS_SCOPE(i_isolate, String, NewFromUtf8Literal);
|
||||
i::Handle<i::String> handle_result =
|
||||
NewString(i_isolate->factory(), type,
|
||||
base::Vector<const char>(literal, length))
|
||||
@ -6874,7 +6874,7 @@ Local<String> v8::String::Concat(Isolate* v8_isolate, Local<String> left,
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
||||
i::Handle<i::String> left_string = Utils::OpenHandle(*left);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
LOG_API(isolate, String, Concat);
|
||||
API_RCS_SCOPE(isolate, String, Concat);
|
||||
i::Handle<i::String> right_string = Utils::OpenHandle(*right);
|
||||
// If we are steering towards a range error, do not wait for the error to be
|
||||
// thrown, and return the null handle instead.
|
||||
@ -6896,7 +6896,7 @@ MaybeLocal<String> v8::String::NewExternalTwoByte(
|
||||
}
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
LOG_API(i_isolate, String, NewExternalTwoByte);
|
||||
API_RCS_SCOPE(i_isolate, String, NewExternalTwoByte);
|
||||
if (resource->length() > 0) {
|
||||
i::Handle<i::String> string = i_isolate->factory()
|
||||
->NewExternalStringFromTwoByte(resource)
|
||||
@ -6918,7 +6918,7 @@ MaybeLocal<String> v8::String::NewExternalOneByte(
|
||||
}
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
LOG_API(i_isolate, String, NewExternalOneByte);
|
||||
API_RCS_SCOPE(i_isolate, String, NewExternalOneByte);
|
||||
if (resource->length() == 0) {
|
||||
// The resource isn't going to be used, free it immediately.
|
||||
resource->Dispose();
|
||||
@ -7011,7 +7011,7 @@ Isolate* v8::Object::GetIsolate() {
|
||||
|
||||
Local<v8::Object> v8::Object::New(Isolate* isolate) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, Object, New);
|
||||
API_RCS_SCOPE(i_isolate, Object, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::JSObject> obj =
|
||||
i_isolate->factory()->NewJSObject(i_isolate->object_function());
|
||||
@ -7085,7 +7085,7 @@ Local<v8::Object> v8::Object::New(Isolate* isolate,
|
||||
"v8::Object::New", "prototype must be null or object")) {
|
||||
return Local<v8::Object>();
|
||||
}
|
||||
LOG_API(i_isolate, Object, New);
|
||||
API_RCS_SCOPE(i_isolate, Object, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
|
||||
i::Handle<i::FixedArrayBase> elements =
|
||||
@ -7118,7 +7118,7 @@ Local<v8::Object> v8::Object::New(Isolate* isolate,
|
||||
|
||||
Local<v8::Value> v8::NumberObject::New(Isolate* isolate, double value) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, NumberObject, New);
|
||||
API_RCS_SCOPE(i_isolate, NumberObject, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::Object> number = i_isolate->factory()->NewNumber(value);
|
||||
i::Handle<i::Object> obj =
|
||||
@ -7131,13 +7131,13 @@ double v8::NumberObject::ValueOf() const {
|
||||
i::Handle<i::JSPrimitiveWrapper> js_primitive_wrapper =
|
||||
i::Handle<i::JSPrimitiveWrapper>::cast(obj);
|
||||
i::Isolate* isolate = js_primitive_wrapper->GetIsolate();
|
||||
LOG_API(isolate, NumberObject, NumberValue);
|
||||
API_RCS_SCOPE(isolate, NumberObject, NumberValue);
|
||||
return js_primitive_wrapper->value().Number();
|
||||
}
|
||||
|
||||
Local<v8::Value> v8::BigIntObject::New(Isolate* isolate, int64_t value) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, BigIntObject, New);
|
||||
API_RCS_SCOPE(i_isolate, BigIntObject, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::Object> bigint = i::BigInt::FromInt64(i_isolate, value);
|
||||
i::Handle<i::Object> obj =
|
||||
@ -7150,14 +7150,14 @@ Local<v8::BigInt> v8::BigIntObject::ValueOf() const {
|
||||
i::Handle<i::JSPrimitiveWrapper> js_primitive_wrapper =
|
||||
i::Handle<i::JSPrimitiveWrapper>::cast(obj);
|
||||
i::Isolate* isolate = js_primitive_wrapper->GetIsolate();
|
||||
LOG_API(isolate, BigIntObject, BigIntValue);
|
||||
API_RCS_SCOPE(isolate, BigIntObject, BigIntValue);
|
||||
return Utils::ToLocal(i::Handle<i::BigInt>(
|
||||
i::BigInt::cast(js_primitive_wrapper->value()), isolate));
|
||||
}
|
||||
|
||||
Local<v8::Value> v8::BooleanObject::New(Isolate* isolate, bool value) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, BooleanObject, New);
|
||||
API_RCS_SCOPE(i_isolate, BooleanObject, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::Object> boolean(value
|
||||
? i::ReadOnlyRoots(i_isolate).true_value()
|
||||
@ -7172,7 +7172,7 @@ bool v8::BooleanObject::ValueOf() const {
|
||||
i::Object obj = *Utils::OpenHandle(this);
|
||||
i::JSPrimitiveWrapper js_primitive_wrapper = i::JSPrimitiveWrapper::cast(obj);
|
||||
i::Isolate* isolate = js_primitive_wrapper.GetIsolate();
|
||||
LOG_API(isolate, BooleanObject, BooleanValue);
|
||||
API_RCS_SCOPE(isolate, BooleanObject, BooleanValue);
|
||||
return js_primitive_wrapper.value().IsTrue(isolate);
|
||||
}
|
||||
|
||||
@ -7180,7 +7180,7 @@ Local<v8::Value> v8::StringObject::New(Isolate* v8_isolate,
|
||||
Local<String> value) {
|
||||
i::Handle<i::String> string = Utils::OpenHandle(*value);
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
||||
LOG_API(isolate, StringObject, New);
|
||||
API_RCS_SCOPE(isolate, StringObject, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
i::Handle<i::Object> obj =
|
||||
i::Object::ToObject(isolate, string).ToHandleChecked();
|
||||
@ -7192,14 +7192,14 @@ Local<v8::String> v8::StringObject::ValueOf() const {
|
||||
i::Handle<i::JSPrimitiveWrapper> js_primitive_wrapper =
|
||||
i::Handle<i::JSPrimitiveWrapper>::cast(obj);
|
||||
i::Isolate* isolate = js_primitive_wrapper->GetIsolate();
|
||||
LOG_API(isolate, StringObject, StringValue);
|
||||
API_RCS_SCOPE(isolate, StringObject, StringValue);
|
||||
return Utils::ToLocal(i::Handle<i::String>(
|
||||
i::String::cast(js_primitive_wrapper->value()), isolate));
|
||||
}
|
||||
|
||||
Local<v8::Value> v8::SymbolObject::New(Isolate* isolate, Local<Symbol> value) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, SymbolObject, New);
|
||||
API_RCS_SCOPE(i_isolate, SymbolObject, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::Object> obj =
|
||||
i::Object::ToObject(i_isolate, Utils::OpenHandle(*value))
|
||||
@ -7212,7 +7212,7 @@ Local<v8::Symbol> v8::SymbolObject::ValueOf() const {
|
||||
i::Handle<i::JSPrimitiveWrapper> js_primitive_wrapper =
|
||||
i::Handle<i::JSPrimitiveWrapper>::cast(obj);
|
||||
i::Isolate* isolate = js_primitive_wrapper->GetIsolate();
|
||||
LOG_API(isolate, SymbolObject, SymbolValue);
|
||||
API_RCS_SCOPE(isolate, SymbolObject, SymbolValue);
|
||||
return Utils::ToLocal(i::Handle<i::Symbol>(
|
||||
i::Symbol::cast(js_primitive_wrapper->value()), isolate));
|
||||
}
|
||||
@ -7235,7 +7235,7 @@ double v8::Date::ValueOf() const {
|
||||
i::Handle<i::Object> obj = Utils::OpenHandle(this);
|
||||
i::Handle<i::JSDate> jsdate = i::Handle<i::JSDate>::cast(obj);
|
||||
i::Isolate* isolate = jsdate->GetIsolate();
|
||||
LOG_API(isolate, Date, NumberValue);
|
||||
API_RCS_SCOPE(isolate, Date, NumberValue);
|
||||
return jsdate->value().Number();
|
||||
}
|
||||
|
||||
@ -7328,7 +7328,7 @@ MaybeLocal<v8::Object> v8::RegExp::Exec(Local<Context> context,
|
||||
|
||||
Local<v8::Array> v8::Array::New(Isolate* isolate, int length) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, Array, New);
|
||||
API_RCS_SCOPE(i_isolate, Array, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
int real_length = length > 0 ? length : 0;
|
||||
i::Handle<i::JSArray> obj = i_isolate->factory()->NewJSArray(real_length);
|
||||
@ -7342,7 +7342,7 @@ Local<v8::Array> v8::Array::New(Isolate* isolate, Local<Value>* elements,
|
||||
size_t length) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
i::Factory* factory = i_isolate->factory();
|
||||
LOG_API(i_isolate, Array, New);
|
||||
API_RCS_SCOPE(i_isolate, Array, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
int len = static_cast<int>(length);
|
||||
|
||||
@ -7368,7 +7368,7 @@ uint32_t v8::Array::Length() const {
|
||||
|
||||
Local<v8::Map> v8::Map::New(Isolate* isolate) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, Map, New);
|
||||
API_RCS_SCOPE(i_isolate, Map, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::JSMap> obj = i_isolate->factory()->NewJSMap();
|
||||
return Utils::ToLocal(obj);
|
||||
@ -7382,7 +7382,7 @@ size_t v8::Map::Size() const {
|
||||
void Map::Clear() {
|
||||
auto self = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = self->GetIsolate();
|
||||
LOG_API(isolate, Map, Clear);
|
||||
API_RCS_SCOPE(isolate, Map, Clear);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
i::JSMap::Clear(isolate, self);
|
||||
}
|
||||
@ -7493,7 +7493,7 @@ i::Handle<i::JSArray> MapAsArray(i::Isolate* isolate, i::Object table_obj,
|
||||
Local<Array> Map::AsArray() const {
|
||||
i::Handle<i::JSMap> obj = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = obj->GetIsolate();
|
||||
LOG_API(isolate, Map, AsArray);
|
||||
API_RCS_SCOPE(isolate, Map, AsArray);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
return Utils::ToLocal(
|
||||
MapAsArray(isolate, obj->table(), 0, MapAsArrayKind::kEntries));
|
||||
@ -7501,7 +7501,7 @@ Local<Array> Map::AsArray() const {
|
||||
|
||||
Local<v8::Set> v8::Set::New(Isolate* isolate) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, Set, New);
|
||||
API_RCS_SCOPE(i_isolate, Set, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::JSSet> obj = i_isolate->factory()->NewJSSet();
|
||||
return Utils::ToLocal(obj);
|
||||
@ -7515,7 +7515,7 @@ size_t v8::Set::Size() const {
|
||||
void Set::Clear() {
|
||||
auto self = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = self->GetIsolate();
|
||||
LOG_API(isolate, Set, Clear);
|
||||
API_RCS_SCOPE(isolate, Set, Clear);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
i::JSSet::Clear(isolate, self);
|
||||
}
|
||||
@ -7596,7 +7596,7 @@ i::Handle<i::JSArray> SetAsArray(i::Isolate* isolate, i::Object table_obj,
|
||||
Local<Array> Set::AsArray() const {
|
||||
i::Handle<i::JSSet> obj = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = obj->GetIsolate();
|
||||
LOG_API(isolate, Set, AsArray);
|
||||
API_RCS_SCOPE(isolate, Set, AsArray);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
return Utils::ToLocal(
|
||||
SetAsArray(isolate, obj->table(), 0, SetAsArrayKind::kValues));
|
||||
@ -7703,7 +7703,7 @@ MaybeLocal<Promise> Promise::Then(Local<Context> context,
|
||||
bool Promise::HasHandler() const {
|
||||
i::JSReceiver promise = *Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = promise.GetIsolate();
|
||||
LOG_API(isolate, Promise, HasRejectHandler);
|
||||
API_RCS_SCOPE(isolate, Promise, HasRejectHandler);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
if (!promise.IsJSPromise()) return false;
|
||||
return i::JSPromise::cast(promise).has_handler();
|
||||
@ -7712,7 +7712,7 @@ bool Promise::HasHandler() const {
|
||||
Local<Value> Promise::Result() {
|
||||
i::Handle<i::JSReceiver> promise = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = promise->GetIsolate();
|
||||
LOG_API(isolate, Promise, Result);
|
||||
API_RCS_SCOPE(isolate, Promise, Result);
|
||||
i::Handle<i::JSPromise> js_promise = i::Handle<i::JSPromise>::cast(promise);
|
||||
Utils::ApiCheck(js_promise->status() != kPending, "v8_Promise_Result",
|
||||
"Promise is still pending");
|
||||
@ -7723,7 +7723,7 @@ Local<Value> Promise::Result() {
|
||||
Promise::PromiseState Promise::State() {
|
||||
i::Handle<i::JSReceiver> promise = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = promise->GetIsolate();
|
||||
LOG_API(isolate, Promise, Status);
|
||||
API_RCS_SCOPE(isolate, Promise, Status);
|
||||
i::Handle<i::JSPromise> js_promise = i::Handle<i::JSPromise>::cast(promise);
|
||||
return static_cast<PromiseState>(js_promise->status());
|
||||
}
|
||||
@ -7924,7 +7924,7 @@ void v8::ArrayBuffer::Detach() {
|
||||
i::Isolate* isolate = obj->GetIsolate();
|
||||
Utils::ApiCheck(obj->is_detachable(), "v8::ArrayBuffer::Detach",
|
||||
"Only detachable ArrayBuffers can be detached");
|
||||
LOG_API(isolate, ArrayBuffer, Detach);
|
||||
API_RCS_SCOPE(isolate, ArrayBuffer, Detach);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
obj->Detach();
|
||||
}
|
||||
@ -7936,7 +7936,7 @@ size_t v8::ArrayBuffer::ByteLength() const {
|
||||
|
||||
Local<ArrayBuffer> v8::ArrayBuffer::New(Isolate* isolate, size_t byte_length) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, ArrayBuffer, New);
|
||||
API_RCS_SCOPE(i_isolate, ArrayBuffer, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::MaybeHandle<i::JSArrayBuffer> result =
|
||||
i_isolate->factory()->NewJSArrayBufferAndBackingStore(
|
||||
@ -7957,7 +7957,7 @@ Local<ArrayBuffer> v8::ArrayBuffer::New(
|
||||
CHECK_IMPLIES(backing_store->ByteLength() != 0,
|
||||
backing_store->Data() != nullptr);
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, ArrayBuffer, New);
|
||||
API_RCS_SCOPE(i_isolate, ArrayBuffer, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
std::shared_ptr<i::BackingStore> i_backing_store(
|
||||
ToInternal(std::move(backing_store)));
|
||||
@ -7972,7 +7972,7 @@ Local<ArrayBuffer> v8::ArrayBuffer::New(
|
||||
std::unique_ptr<v8::BackingStore> v8::ArrayBuffer::NewBackingStore(
|
||||
Isolate* isolate, size_t byte_length) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, ArrayBuffer, NewBackingStore);
|
||||
API_RCS_SCOPE(i_isolate, ArrayBuffer, NewBackingStore);
|
||||
CHECK_LE(byte_length, i::JSArrayBuffer::kMaxByteLength);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
std::unique_ptr<i::BackingStoreBase> backing_store =
|
||||
@ -8063,7 +8063,7 @@ static_assert(
|
||||
Local<Type##Array> Type##Array::New(Local<ArrayBuffer> array_buffer, \
|
||||
size_t byte_offset, size_t length) { \
|
||||
i::Isolate* isolate = Utils::OpenHandle(*array_buffer)->GetIsolate(); \
|
||||
LOG_API(isolate, Type##Array, New); \
|
||||
API_RCS_SCOPE(isolate, Type##Array, New); \
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); \
|
||||
if (!Utils::ApiCheck(length <= kMaxLength, \
|
||||
"v8::" #Type \
|
||||
@ -8082,7 +8082,7 @@ static_assert(
|
||||
CHECK(i::FLAG_harmony_sharedarraybuffer); \
|
||||
i::Isolate* isolate = \
|
||||
Utils::OpenHandle(*shared_array_buffer)->GetIsolate(); \
|
||||
LOG_API(isolate, Type##Array, New); \
|
||||
API_RCS_SCOPE(isolate, Type##Array, New); \
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); \
|
||||
if (!Utils::ApiCheck( \
|
||||
length <= kMaxLength, \
|
||||
@ -8105,7 +8105,7 @@ Local<DataView> DataView::New(Local<ArrayBuffer> array_buffer,
|
||||
size_t byte_offset, size_t byte_length) {
|
||||
i::Handle<i::JSArrayBuffer> buffer = Utils::OpenHandle(*array_buffer);
|
||||
i::Isolate* isolate = buffer->GetIsolate();
|
||||
LOG_API(isolate, DataView, New);
|
||||
API_RCS_SCOPE(isolate, DataView, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
i::Handle<i::JSDataView> obj =
|
||||
isolate->factory()->NewJSDataView(buffer, byte_offset, byte_length);
|
||||
@ -8117,7 +8117,7 @@ Local<DataView> DataView::New(Local<SharedArrayBuffer> shared_array_buffer,
|
||||
CHECK(i::FLAG_harmony_sharedarraybuffer);
|
||||
i::Handle<i::JSArrayBuffer> buffer = Utils::OpenHandle(*shared_array_buffer);
|
||||
i::Isolate* isolate = buffer->GetIsolate();
|
||||
LOG_API(isolate, DataView, New);
|
||||
API_RCS_SCOPE(isolate, DataView, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
i::Handle<i::JSDataView> obj =
|
||||
isolate->factory()->NewJSDataView(buffer, byte_offset, byte_length);
|
||||
@ -8133,7 +8133,7 @@ Local<SharedArrayBuffer> v8::SharedArrayBuffer::New(Isolate* isolate,
|
||||
size_t byte_length) {
|
||||
CHECK(i::FLAG_harmony_sharedarraybuffer);
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, SharedArrayBuffer, New);
|
||||
API_RCS_SCOPE(i_isolate, SharedArrayBuffer, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
|
||||
std::unique_ptr<i::BackingStore> backing_store =
|
||||
@ -8157,7 +8157,7 @@ Local<SharedArrayBuffer> v8::SharedArrayBuffer::New(
|
||||
CHECK_IMPLIES(backing_store->ByteLength() != 0,
|
||||
backing_store->Data() != nullptr);
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, SharedArrayBuffer, New);
|
||||
API_RCS_SCOPE(i_isolate, SharedArrayBuffer, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
std::shared_ptr<i::BackingStore> i_backing_store(ToInternal(backing_store));
|
||||
Utils::ApiCheck(
|
||||
@ -8171,7 +8171,7 @@ Local<SharedArrayBuffer> v8::SharedArrayBuffer::New(
|
||||
std::unique_ptr<v8::BackingStore> v8::SharedArrayBuffer::NewBackingStore(
|
||||
Isolate* isolate, size_t byte_length) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, SharedArrayBuffer, NewBackingStore);
|
||||
API_RCS_SCOPE(i_isolate, SharedArrayBuffer, NewBackingStore);
|
||||
CHECK_LE(byte_length, i::JSArrayBuffer::kMaxByteLength);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
std::unique_ptr<i::BackingStoreBase> backing_store =
|
||||
@ -8198,7 +8198,7 @@ std::unique_ptr<v8::BackingStore> v8::SharedArrayBuffer::NewBackingStore(
|
||||
|
||||
Local<Symbol> v8::Symbol::New(Isolate* isolate, Local<String> name) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, Symbol, New);
|
||||
API_RCS_SCOPE(i_isolate, Symbol, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::Symbol> result = i_isolate->factory()->NewSymbol();
|
||||
if (!name.IsEmpty()) result->set_description(*Utils::OpenHandle(*name));
|
||||
@ -8245,7 +8245,7 @@ WELL_KNOWN_SYMBOLS(SYMBOL_GETTER)
|
||||
|
||||
Local<Private> v8::Private::New(Isolate* isolate, Local<String> name) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, Private, New);
|
||||
API_RCS_SCOPE(i_isolate, Private, New);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::Handle<i::Symbol> symbol = i_isolate->factory()->NewPrivateSymbol();
|
||||
if (!name.IsEmpty()) symbol->set_description(*Utils::OpenHandle(*name));
|
||||
@ -9516,7 +9516,7 @@ void Isolate::SetAllowAtomicsWait(bool allow) {
|
||||
void v8::Isolate::DateTimeConfigurationChangeNotification(
|
||||
TimeZoneDetection time_zone_detection) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(this);
|
||||
LOG_API(i_isolate, Isolate, DateTimeConfigurationChangeNotification);
|
||||
API_RCS_SCOPE(i_isolate, Isolate, DateTimeConfigurationChangeNotification);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i_isolate->date_cache()->ResetDateCache(
|
||||
static_cast<base::TimezoneCache::TimeZoneDetection>(time_zone_detection));
|
||||
@ -9532,7 +9532,7 @@ void v8::Isolate::DateTimeConfigurationChangeNotification(
|
||||
|
||||
void v8::Isolate::LocaleConfigurationChangeNotification() {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(this);
|
||||
LOG_API(i_isolate, Isolate, LocaleConfigurationChangeNotification);
|
||||
API_RCS_SCOPE(i_isolate, Isolate, LocaleConfigurationChangeNotification);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
|
||||
#ifdef V8_INTL_SUPPORT
|
||||
@ -9542,7 +9542,7 @@ void v8::Isolate::LocaleConfigurationChangeNotification() {
|
||||
|
||||
bool v8::Object::IsCodeLike(v8::Isolate* isolate) const {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, Object, IsCodeLike);
|
||||
API_RCS_SCOPE(i_isolate, Object, IsCodeLike);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate);
|
||||
i::HandleScope scope(i_isolate);
|
||||
return Utils::OpenHandle(this)->IsCodeLike(i_isolate);
|
||||
@ -9649,7 +9649,7 @@ String::Value::~Value() { i::DeleteArray(str_); }
|
||||
#define DEFINE_ERROR(NAME, name) \
|
||||
Local<Value> Exception::NAME(v8::Local<v8::String> raw_message) { \
|
||||
i::Isolate* isolate = i::Isolate::Current(); \
|
||||
LOG_API(isolate, NAME, New); \
|
||||
API_RCS_SCOPE(isolate, NAME, New); \
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); \
|
||||
i::Object error; \
|
||||
{ \
|
||||
|
@ -267,7 +267,6 @@ V8_WARN_UNUSED_RESULT static Object HandleApiCallAsFunctionOrConstructor(
|
||||
Object result;
|
||||
{
|
||||
HandleScope scope(isolate);
|
||||
LOG(isolate, ApiObjectAccess("call non-function", obj));
|
||||
FunctionCallbackArguments custom(
|
||||
isolate, call_data.data(), constructor, obj, new_target,
|
||||
args.address_of_first_argument(), args.length() - 1);
|
||||
|
@ -183,7 +183,7 @@ bool GetPrivateMembers(Local<Context> context, Local<Object> object,
|
||||
std::vector<Local<Value>>* names_out,
|
||||
std::vector<Local<Value>>* values_out) {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
LOG_API(isolate, debug, GetPrivateMembers);
|
||||
API_RCS_SCOPE(isolate, debug, GetPrivateMembers);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
i::Handle<i::JSReceiver> receiver = Utils::OpenHandle(*object);
|
||||
i::Handle<i::JSArray> names;
|
||||
|
@ -1528,8 +1528,6 @@ bool Isolate::MayAccess(Handle<Context> accessing_context,
|
||||
data = handle(access_check_info.data(), this);
|
||||
}
|
||||
|
||||
LOG(this, ApiSecurityCheck());
|
||||
|
||||
{
|
||||
// Leaving JavaScript.
|
||||
VMState<EXTERNAL> state(this);
|
||||
|
@ -2009,7 +2009,6 @@ DEFINE_BOOL(log, false,
|
||||
"Minimal logging (no API, code, GC, suspect, or handles samples).")
|
||||
DEFINE_BOOL(log_all, false, "Log all events to the log file.")
|
||||
|
||||
DEFINE_BOOL(log_api, false, "Log API events to the log file.")
|
||||
DEFINE_BOOL(log_code, false,
|
||||
"Log code events to the log file without profiling.")
|
||||
DEFINE_BOOL(log_code_disassemble, false,
|
||||
|
@ -135,7 +135,6 @@ void V8::Initialize() {
|
||||
// Update logging information before enforcing flag implications.
|
||||
bool* log_all_flags[] = {&FLAG_turbo_profiling_log_builtins,
|
||||
&FLAG_log_all,
|
||||
&FLAG_log_api,
|
||||
&FLAG_log_code,
|
||||
&FLAG_log_code_disassemble,
|
||||
&FLAG_log_source_code,
|
||||
|
@ -1074,13 +1074,6 @@ void Logger::IntPtrTEvent(const char* name, intptr_t value) {
|
||||
msg.WriteToLogFile();
|
||||
}
|
||||
|
||||
void Logger::WriteApiSecurityCheck() {
|
||||
DCHECK(FLAG_log_api);
|
||||
MSG_BUILDER();
|
||||
msg << "api" << kNext << "check-security";
|
||||
msg.WriteToLogFile();
|
||||
}
|
||||
|
||||
void Logger::SharedLibraryEvent(const std::string& library_path,
|
||||
uintptr_t start, uintptr_t end,
|
||||
intptr_t aslr_slide) {
|
||||
@ -1152,39 +1145,6 @@ bool Logger::is_logging() {
|
||||
TIMER_EVENTS_LIST(V)
|
||||
#undef V
|
||||
|
||||
void Logger::WriteApiNamedPropertyAccess(const char* tag, JSObject holder,
|
||||
Object property_name) {
|
||||
DCHECK(FLAG_log_api);
|
||||
DCHECK(property_name.IsName());
|
||||
MSG_BUILDER();
|
||||
msg << "api" << kNext << tag << kNext << holder.class_name() << kNext
|
||||
<< Name::cast(property_name);
|
||||
msg.WriteToLogFile();
|
||||
}
|
||||
|
||||
void Logger::WriteApiIndexedPropertyAccess(const char* tag, JSObject holder,
|
||||
uint32_t index) {
|
||||
DCHECK(FLAG_log_api);
|
||||
MSG_BUILDER();
|
||||
msg << "api" << kNext << tag << kNext << holder.class_name() << kNext
|
||||
<< index;
|
||||
msg.WriteToLogFile();
|
||||
}
|
||||
|
||||
void Logger::WriteApiObjectAccess(const char* tag, JSReceiver object) {
|
||||
DCHECK(FLAG_log_api);
|
||||
MSG_BUILDER();
|
||||
msg << "api" << kNext << tag << kNext << object.class_name();
|
||||
msg.WriteToLogFile();
|
||||
}
|
||||
|
||||
void Logger::WriteApiEntryCall(const char* name) {
|
||||
DCHECK(FLAG_log_api);
|
||||
MSG_BUILDER();
|
||||
msg << "api" << kNext << name;
|
||||
msg.WriteToLogFile();
|
||||
}
|
||||
|
||||
void Logger::NewEvent(const char* name, void* object, size_t size) {
|
||||
if (!FLAG_log) return;
|
||||
MSG_BUILDER();
|
||||
|
@ -160,30 +160,6 @@ class Logger : public CodeEventListener {
|
||||
void ScriptEvent(ScriptEventType type, int script_id);
|
||||
void ScriptDetails(Script script);
|
||||
|
||||
// ==== Events logged by --log-api. ====
|
||||
void ApiSecurityCheck() {
|
||||
if (!FLAG_log_api) return;
|
||||
WriteApiSecurityCheck();
|
||||
}
|
||||
void ApiNamedPropertyAccess(const char* tag, JSObject holder, Object name) {
|
||||
if (!FLAG_log_api) return;
|
||||
WriteApiNamedPropertyAccess(tag, holder, name);
|
||||
}
|
||||
void ApiIndexedPropertyAccess(const char* tag, JSObject holder,
|
||||
uint32_t index) {
|
||||
if (!FLAG_log_api) return;
|
||||
WriteApiIndexedPropertyAccess(tag, holder, index);
|
||||
}
|
||||
|
||||
void ApiObjectAccess(const char* tag, JSReceiver obj) {
|
||||
if (!FLAG_log_api) return;
|
||||
WriteApiObjectAccess(tag, obj);
|
||||
}
|
||||
void ApiEntryCall(const char* name) {
|
||||
if (!FLAG_log_api) return;
|
||||
WriteApiEntryCall(name);
|
||||
}
|
||||
|
||||
// ==== Events logged by --log-code. ====
|
||||
V8_EXPORT_PRIVATE void AddCodeEventListener(CodeEventListener* listener);
|
||||
V8_EXPORT_PRIVATE void RemoveCodeEventListener(CodeEventListener* listener);
|
||||
|
@ -513,7 +513,6 @@ UNINITIALIZED_TEST(LogAll) {
|
||||
SETUP_FLAGS();
|
||||
i::FLAG_log_all = true;
|
||||
i::FLAG_log_deopt = true;
|
||||
i::FLAG_log_api = true;
|
||||
i::FLAG_turbo_inlining = false;
|
||||
i::FLAG_log_internal_timer_events = true;
|
||||
i::FLAG_allow_natives_syntax = true;
|
||||
@ -551,11 +550,9 @@ UNINITIALIZED_TEST(LogAll) {
|
||||
logger.StopLogging();
|
||||
|
||||
// We should find at least one code-creation even for testAddFn();
|
||||
CHECK(logger.ContainsLine({"api,v8::Context::New"}));
|
||||
CHECK(logger.ContainsLine({"timer-event-start", "V8.CompileCode"}));
|
||||
CHECK(logger.ContainsLine({"timer-event-end", "V8.CompileCode"}));
|
||||
CHECK(logger.ContainsLine({"code-creation,Script", ":1:1"}));
|
||||
CHECK(logger.ContainsLine({"api,v8::Script::Run"}));
|
||||
CHECK(logger.ContainsLine({"code-creation,LazyCompile,", "testAddFn"}));
|
||||
|
||||
if (i::FLAG_opt && !i::FLAG_always_opt) {
|
||||
|
@ -17,7 +17,6 @@ class State {
|
||||
_mapTimeline;
|
||||
_deoptTimeline;
|
||||
_codeTimeline;
|
||||
_apiTimeline;
|
||||
_tickTimeline;
|
||||
_timerTimeline;
|
||||
_minStartTime = Number.POSITIVE_INFINITY;
|
||||
@ -42,13 +41,12 @@ class State {
|
||||
}
|
||||
|
||||
setTimelines(
|
||||
mapTimeline, icTimeline, deoptTimeline, codeTimeline, apiTimeline,
|
||||
tickTimeline, timerTimeline) {
|
||||
mapTimeline, icTimeline, deoptTimeline, codeTimeline, tickTimeline,
|
||||
timerTimeline) {
|
||||
this._mapTimeline = mapTimeline;
|
||||
this._icTimeline = icTimeline;
|
||||
this._deoptTimeline = deoptTimeline;
|
||||
this._codeTimeline = codeTimeline;
|
||||
this._apiTimeline = apiTimeline;
|
||||
this._tickTimeline = tickTimeline;
|
||||
this._timerTimeline = timerTimeline;
|
||||
for (let timeline of arguments) {
|
||||
@ -78,10 +76,6 @@ class State {
|
||||
return this._codeTimeline;
|
||||
}
|
||||
|
||||
get apiTimeline() {
|
||||
return this._apiTimeline;
|
||||
}
|
||||
|
||||
get tickTimeline() {
|
||||
return this._tickTimeline;
|
||||
}
|
||||
@ -93,8 +87,7 @@ class State {
|
||||
get timelines() {
|
||||
return [
|
||||
this._mapTimeline, this._icTimeline, this._deoptTimeline,
|
||||
this._codeTimeline, this._apiTimeline, this._tickTimeline,
|
||||
this._timerTimeline
|
||||
this._codeTimeline, this._tickTimeline, this._timerTimeline
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,6 @@ found in the LICENSE file. -->
|
||||
<timeline-track id="ic-track" title="IC"></timeline-track>
|
||||
<timeline-track id="deopt-track" title="Deopt"></timeline-track>
|
||||
<timeline-track id="code-track" title="Code"></timeline-track>
|
||||
<timeline-track id="api-track" title="API"></timeline-track>
|
||||
</timeline-panel>
|
||||
|
||||
<div class="panels">
|
||||
@ -92,7 +91,6 @@ found in the LICENSE file. -->
|
||||
<list-panel id="map-list" title="Map Events"></list-panel>
|
||||
<list-panel id="deopt-list" title="Deopt Events"></list-panel>
|
||||
<list-panel id="code-list" title="Code Events"></list-panel>
|
||||
<list-panel id="api-list" title="API Events"></list-panel>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -155,8 +153,8 @@ found in the LICENSE file. -->
|
||||
</dt>
|
||||
<dd>Log detailed generated generated code</dd>
|
||||
<dt>
|
||||
<a href="https://source.chromium.org/search?q=FLAG_log_api">
|
||||
<code>--log-api</code>
|
||||
<a href="https://source.chromium.org/search?q=FLAG_log_code">
|
||||
<code>--log-code</code>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>Log details about deoptimized code</dd>
|
||||
|
@ -5,7 +5,6 @@
|
||||
import {Script, SourcePosition} from '../profile.mjs';
|
||||
|
||||
import {State} from './app-model.mjs';
|
||||
import {ApiLogEntry} from './log/api.mjs';
|
||||
import {CodeLogEntry} from './log/code.mjs';
|
||||
import {DeoptLogEntry} from './log/code.mjs';
|
||||
import {SharedLibLogEntry} from './log/code.mjs';
|
||||
@ -34,14 +33,12 @@ class App {
|
||||
icTrack: $('#ic-track'),
|
||||
deoptTrack: $('#deopt-track'),
|
||||
codeTrack: $('#code-track'),
|
||||
apiTrack: $('#api-track'),
|
||||
timerTrack: $('#timer-track'),
|
||||
|
||||
icList: $('#ic-list'),
|
||||
mapList: $('#map-list'),
|
||||
codeList: $('#code-list'),
|
||||
deoptList: $('#deopt-list'),
|
||||
apiList: $('#api-list'),
|
||||
|
||||
mapPanel: $('#map-panel'),
|
||||
codePanel: $('#code-panel'),
|
||||
@ -64,7 +61,6 @@ class App {
|
||||
SourcePosition,
|
||||
MapLogEntry,
|
||||
IcLogEntry,
|
||||
ApiLogEntry,
|
||||
CodeLogEntry,
|
||||
DeoptLogEntry,
|
||||
SharedLibLogEntry,
|
||||
@ -125,7 +121,6 @@ class App {
|
||||
entries = entry.entries.concat(entry.sourcePositions);
|
||||
break;
|
||||
case TimerLogEntry:
|
||||
case ApiLogEntry:
|
||||
case CodeLogEntry:
|
||||
case TickLogEntry:
|
||||
case SharedLibLogEntry:
|
||||
@ -175,8 +170,6 @@ class App {
|
||||
return this.showMapEntries(entries, focusView);
|
||||
case IcLogEntry:
|
||||
return this.showIcEntries(entries, focusView);
|
||||
case ApiLogEntry:
|
||||
return this.showApiEntries(entries, focusView);
|
||||
case CodeLogEntry:
|
||||
return this.showCodeEntries(entries, focusView);
|
||||
case DeoptLogEntry:
|
||||
@ -215,11 +208,6 @@ class App {
|
||||
if (focusView) this._view.codePanel.show();
|
||||
}
|
||||
|
||||
showApiEntries(entries, focusView = true) {
|
||||
this._view.apiList.selectedLogEntries = entries;
|
||||
if (focusView) this._view.apiList.show();
|
||||
}
|
||||
|
||||
showTickEntries(entries, focusView = true) {}
|
||||
showTimerEntries(entries, focusView = true) {}
|
||||
|
||||
@ -239,7 +227,6 @@ class App {
|
||||
this.showIcEntries(this._state.icTimeline.selectionOrSelf, false);
|
||||
this.showDeoptEntries(this._state.deoptTimeline.selectionOrSelf, false);
|
||||
this.showCodeEntries(this._state.codeTimeline.selectionOrSelf, false);
|
||||
this.showApiEntries(this._state.apiTimeline.selectionOrSelf, false);
|
||||
this.showTickEntries(this._state.tickTimeline.selectionOrSelf, false);
|
||||
this.showTimerEntries(this._state.timerTimeline.selectionOrSelf, false);
|
||||
this._view.timelinePanel.timeSelection = {start, end, focus, zoom};
|
||||
@ -260,8 +247,6 @@ class App {
|
||||
return this.focusMapLogEntry(entry);
|
||||
case IcLogEntry:
|
||||
return this.focusIcLogEntry(entry);
|
||||
case ApiLogEntry:
|
||||
return this.focusApiLogEntry(entry);
|
||||
case CodeLogEntry:
|
||||
return this.focusCodeLogEntry(entry);
|
||||
case DeoptLogEntry:
|
||||
@ -312,12 +297,6 @@ class App {
|
||||
// no-op.
|
||||
}
|
||||
|
||||
focusApiLogEntry(entry) {
|
||||
this._state.apiLogEntry = entry;
|
||||
this._view.apiTrack.focusedEntry = entry;
|
||||
this.focusSourcePosition(entry.sourcePosition);
|
||||
}
|
||||
|
||||
focusTickLogEntry(entry) {
|
||||
this._state.tickLogEntry = entry;
|
||||
this._view.tickTrack.focusedEntry = entry;
|
||||
@ -380,18 +359,16 @@ class App {
|
||||
const icTimeline = processor.icTimeline;
|
||||
const deoptTimeline = processor.deoptTimeline;
|
||||
const codeTimeline = processor.codeTimeline;
|
||||
const apiTimeline = processor.apiTimeline;
|
||||
const tickTimeline = processor.tickTimeline;
|
||||
const timerTimeline = processor.timerTimeline;
|
||||
this._state.setTimelines(
|
||||
mapTimeline, icTimeline, deoptTimeline, codeTimeline, apiTimeline,
|
||||
tickTimeline, timerTimeline);
|
||||
mapTimeline, icTimeline, deoptTimeline, codeTimeline, tickTimeline,
|
||||
timerTimeline);
|
||||
this._view.mapPanel.timeline = mapTimeline;
|
||||
this._view.icList.timeline = icTimeline;
|
||||
this._view.mapList.timeline = mapTimeline;
|
||||
this._view.deoptList.timeline = deoptTimeline;
|
||||
this._view.codeList.timeline = codeTimeline;
|
||||
this._view.apiList.timeline = apiTimeline;
|
||||
this._view.scriptPanel.scripts = processor.scripts;
|
||||
this._view.codePanel.timeline = codeTimeline;
|
||||
this._view.codePanel.timeline = codeTimeline;
|
||||
@ -410,7 +387,6 @@ class App {
|
||||
this._view.icTrack.data = this._state.icTimeline;
|
||||
this._view.deoptTrack.data = this._state.deoptTimeline;
|
||||
this._view.codeTrack.data = this._state.codeTimeline;
|
||||
this._view.apiTrack.data = this._state.apiTimeline;
|
||||
this._view.tickTrack.data = this._state.tickTimeline;
|
||||
this._view.timerTrack.data = this._state.timerTimeline;
|
||||
}
|
||||
|
@ -1,24 +0,0 @@
|
||||
// Copyright 2020 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.
|
||||
import {LogEntry} from './log.mjs';
|
||||
|
||||
export class ApiLogEntry extends LogEntry {
|
||||
constructor(type, time, name, argument) {
|
||||
super(type, time);
|
||||
this._name = name;
|
||||
this._argument = argument;
|
||||
}
|
||||
|
||||
get name() {
|
||||
return this._name;
|
||||
}
|
||||
|
||||
get argument() {
|
||||
return this._argument;
|
||||
}
|
||||
|
||||
static get propertyNames() {
|
||||
return ['type', 'name', 'argument'];
|
||||
}
|
||||
}
|
@ -6,7 +6,6 @@ import {LogReader, parseString, parseVarArgs} from '../logreader.mjs';
|
||||
import {Profile} from '../profile.mjs';
|
||||
import {RemoteLinuxCppEntriesProvider, RemoteMacOSCppEntriesProvider} from '../tickprocessor.mjs'
|
||||
|
||||
import {ApiLogEntry} from './log/api.mjs';
|
||||
import {CodeLogEntry, DeoptLogEntry, FeedbackVectorEntry, SharedLibLogEntry} from './log/code.mjs';
|
||||
import {IcLogEntry} from './log/ic.mjs';
|
||||
import {Edge, MapLogEntry} from './log/map.mjs';
|
||||
@ -49,7 +48,6 @@ class AsyncConsumer {
|
||||
|
||||
export class Processor extends LogReader {
|
||||
_profile = new Profile();
|
||||
_apiTimeline = new Timeline();
|
||||
_codeTimeline = new Timeline();
|
||||
_deoptTimeline = new Timeline();
|
||||
_icTimeline = new Timeline();
|
||||
@ -580,19 +578,7 @@ export class Processor extends LogReader {
|
||||
}
|
||||
|
||||
processApiEvent(type, varArgs) {
|
||||
let name, arg1;
|
||||
if (varArgs.length == 0) {
|
||||
const index = type.indexOf(':');
|
||||
if (index > 0) {
|
||||
name = type;
|
||||
type = type.substr(0, index);
|
||||
}
|
||||
} else {
|
||||
name = varArgs[0];
|
||||
arg1 = varArgs[1];
|
||||
}
|
||||
this._apiTimeline.push(
|
||||
new ApiLogEntry(type, this._lastTimestamp, name, arg1));
|
||||
// legacy events that are no longer supported
|
||||
}
|
||||
|
||||
processTimerEventStart(type, time) {
|
||||
@ -629,10 +615,6 @@ export class Processor extends LogReader {
|
||||
return this._codeTimeline;
|
||||
}
|
||||
|
||||
get apiTimeline() {
|
||||
return this._apiTimeline;
|
||||
}
|
||||
|
||||
get tickTimeline() {
|
||||
return this._tickTimeline;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user