Commit 1b8d4e3a authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[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/+/3574549Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarJakob Linke <jgruber@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79904}
parent e94b84a8
...@@ -87,24 +87,22 @@ inline JSReceiver FunctionCallbackArguments::holder() { ...@@ -87,24 +87,22 @@ inline JSReceiver FunctionCallbackArguments::holder() {
ExternalCallbackScope call_scope(ISOLATE, FUNCTION_ADDR(F)); \ ExternalCallbackScope call_scope(ISOLATE, FUNCTION_ADDR(F)); \
PropertyCallbackInfo<API_RETURN_TYPE> callback_info(values_); PropertyCallbackInfo<API_RETURN_TYPE> callback_info(values_);
#define CREATE_NAMED_CALLBACK(FUNCTION, TYPE, RETURN_TYPE, API_RETURN_TYPE, \ #define CREATE_NAMED_CALLBACK(FUNCTION, TYPE, RETURN_TYPE, API_RETURN_TYPE, \
INFO_FOR_SIDE_EFFECT) \ INFO_FOR_SIDE_EFFECT) \
Handle<RETURN_TYPE> PropertyCallbackArguments::CallNamed##FUNCTION( \ Handle<RETURN_TYPE> PropertyCallbackArguments::CallNamed##FUNCTION( \
Handle<InterceptorInfo> interceptor, Handle<Name> name) { \ Handle<InterceptorInfo> interceptor, Handle<Name> name) { \
DCHECK_NAME_COMPATIBLE(interceptor, name); \ DCHECK_NAME_COMPATIBLE(interceptor, name); \
Isolate* isolate = this->isolate(); \ Isolate* isolate = this->isolate(); \
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamed##FUNCTION##Callback); \ RCS_SCOPE(isolate, RuntimeCallCounterId::kNamed##FUNCTION##Callback); \
Handle<Object> receiver_check_unsupported; \ Handle<Object> receiver_check_unsupported; \
GenericNamedProperty##FUNCTION##Callback f = \ GenericNamedProperty##FUNCTION##Callback f = \
ToCData<GenericNamedProperty##FUNCTION##Callback>( \ ToCData<GenericNamedProperty##FUNCTION##Callback>( \
interceptor->TYPE()); \ interceptor->TYPE()); \
PREPARE_CALLBACK_INFO(isolate, f, Handle<RETURN_TYPE>, API_RETURN_TYPE, \ PREPARE_CALLBACK_INFO(isolate, f, Handle<RETURN_TYPE>, API_RETURN_TYPE, \
INFO_FOR_SIDE_EFFECT, receiver_check_unsupported, \ INFO_FOR_SIDE_EFFECT, receiver_check_unsupported, \
NotAccessor); \ NotAccessor); \
LOG(isolate, \ f(v8::Utils::ToLocal(name), callback_info); \
ApiNamedPropertyAccess("interceptor-named-" #TYPE, holder(), *name)); \ return GetReturnValue<RETURN_TYPE>(isolate); \
f(v8::Utils::ToLocal(name), callback_info); \
return GetReturnValue<RETURN_TYPE>(isolate); \
} }
FOR_EACH_CALLBACK(CREATE_NAMED_CALLBACK) FOR_EACH_CALLBACK(CREATE_NAMED_CALLBACK)
...@@ -123,8 +121,6 @@ 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, \ PREPARE_CALLBACK_INFO(isolate, f, Handle<RETURN_TYPE>, API_RETURN_TYPE, \
INFO_FOR_SIDE_EFFECT, receiver_check_unsupported, \ INFO_FOR_SIDE_EFFECT, receiver_check_unsupported, \
NotAccessor); \ NotAccessor); \
LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-" #TYPE, \
holder(), index)); \
f(index, callback_info); \ f(index, callback_info); \
return GetReturnValue<RETURN_TYPE>(isolate); \ return GetReturnValue<RETURN_TYPE>(isolate); \
} }
...@@ -136,7 +132,6 @@ FOR_EACH_CALLBACK(CREATE_INDEXED_CALLBACK) ...@@ -136,7 +132,6 @@ FOR_EACH_CALLBACK(CREATE_INDEXED_CALLBACK)
Handle<Object> FunctionCallbackArguments::Call(CallHandlerInfo handler) { Handle<Object> FunctionCallbackArguments::Call(CallHandlerInfo handler) {
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
LOG(isolate, ApiObjectAccess("call", holder()));
RCS_SCOPE(isolate, RuntimeCallCounterId::kFunctionCallback); RCS_SCOPE(isolate, RuntimeCallCounterId::kFunctionCallback);
v8::FunctionCallback f = v8::FunctionCallback f =
v8::ToCData<v8::FunctionCallback>(handler.callback()); v8::ToCData<v8::FunctionCallback>(handler.callback());
...@@ -156,7 +151,6 @@ Handle<Object> FunctionCallbackArguments::Call(CallHandlerInfo handler) { ...@@ -156,7 +151,6 @@ Handle<Object> FunctionCallbackArguments::Call(CallHandlerInfo handler) {
Handle<JSObject> PropertyCallbackArguments::CallNamedEnumerator( Handle<JSObject> PropertyCallbackArguments::CallNamedEnumerator(
Handle<InterceptorInfo> interceptor) { Handle<InterceptorInfo> interceptor) {
DCHECK(interceptor->is_named()); DCHECK(interceptor->is_named());
LOG(isolate(), ApiObjectAccess("interceptor-named-enumerator", holder()));
RCS_SCOPE(isolate(), RuntimeCallCounterId::kNamedEnumeratorCallback); RCS_SCOPE(isolate(), RuntimeCallCounterId::kNamedEnumeratorCallback);
return CallPropertyEnumerator(interceptor); return CallPropertyEnumerator(interceptor);
} }
...@@ -164,7 +158,6 @@ Handle<JSObject> PropertyCallbackArguments::CallNamedEnumerator( ...@@ -164,7 +158,6 @@ Handle<JSObject> PropertyCallbackArguments::CallNamedEnumerator(
Handle<JSObject> PropertyCallbackArguments::CallIndexedEnumerator( Handle<JSObject> PropertyCallbackArguments::CallIndexedEnumerator(
Handle<InterceptorInfo> interceptor) { Handle<InterceptorInfo> interceptor) {
DCHECK(!interceptor->is_named()); DCHECK(!interceptor->is_named());
LOG(isolate(), ApiObjectAccess("interceptor-indexed-enumerator", holder()));
RCS_SCOPE(isolate(), RuntimeCallCounterId::kIndexedEnumeratorCallback); RCS_SCOPE(isolate(), RuntimeCallCounterId::kIndexedEnumeratorCallback);
return CallPropertyEnumerator(interceptor); return CallPropertyEnumerator(interceptor);
} }
...@@ -174,8 +167,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedGetter( ...@@ -174,8 +167,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedGetter(
DCHECK_NAME_COMPATIBLE(interceptor, name); DCHECK_NAME_COMPATIBLE(interceptor, name);
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedGetterCallback); RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedGetterCallback);
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-getter", holder(), *name));
GenericNamedPropertyGetterCallback f = GenericNamedPropertyGetterCallback f =
ToCData<GenericNamedPropertyGetterCallback>(interceptor->getter()); ToCData<GenericNamedPropertyGetterCallback>(interceptor->getter());
return BasicCallNamedGetterCallback(f, name, interceptor); return BasicCallNamedGetterCallback(f, name, interceptor);
...@@ -186,8 +177,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedDescriptor( ...@@ -186,8 +177,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedDescriptor(
DCHECK_NAME_COMPATIBLE(interceptor, name); DCHECK_NAME_COMPATIBLE(interceptor, name);
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedDescriptorCallback); RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedDescriptorCallback);
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-descriptor", holder(), *name));
GenericNamedPropertyDescriptorCallback f = GenericNamedPropertyDescriptorCallback f =
ToCData<GenericNamedPropertyDescriptorCallback>( ToCData<GenericNamedPropertyDescriptorCallback>(
interceptor->descriptor()); interceptor->descriptor());
...@@ -215,8 +204,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedSetter( ...@@ -215,8 +204,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedSetter(
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedSetterCallback); RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedSetterCallback);
PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>, PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>,
v8::Value); v8::Value);
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-set", holder(), *name));
f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), callback_info); f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), callback_info);
return GetReturnValue<Object>(isolate); return GetReturnValue<Object>(isolate);
} }
...@@ -231,8 +218,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedDefiner( ...@@ -231,8 +218,6 @@ Handle<Object> PropertyCallbackArguments::CallNamedDefiner(
ToCData<GenericNamedPropertyDefinerCallback>(interceptor->definer()); ToCData<GenericNamedPropertyDefinerCallback>(interceptor->definer());
PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>, PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>,
v8::Value); v8::Value);
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-define", holder(), *name));
f(v8::Utils::ToLocal(name), desc, callback_info); f(v8::Utils::ToLocal(name), desc, callback_info);
return GetReturnValue<Object>(isolate); return GetReturnValue<Object>(isolate);
} }
...@@ -246,8 +231,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedSetter( ...@@ -246,8 +231,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedSetter(
ToCData<IndexedPropertySetterCallback>(interceptor->setter()); ToCData<IndexedPropertySetterCallback>(interceptor->setter());
PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>, PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>,
v8::Value); v8::Value);
LOG(isolate,
ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index));
f(index, v8::Utils::ToLocal(value), callback_info); f(index, v8::Utils::ToLocal(value), callback_info);
return GetReturnValue<Object>(isolate); return GetReturnValue<Object>(isolate);
} }
...@@ -262,8 +245,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedDefiner( ...@@ -262,8 +245,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedDefiner(
ToCData<IndexedPropertyDefinerCallback>(interceptor->definer()); ToCData<IndexedPropertyDefinerCallback>(interceptor->definer());
PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>, PREPARE_CALLBACK_INFO_FAIL_SIDE_EFFECT_CHECK(isolate, f, Handle<Object>,
v8::Value); v8::Value);
LOG(isolate,
ApiIndexedPropertyAccess("interceptor-indexed-define", holder(), index));
f(index, desc, callback_info); f(index, desc, callback_info);
return GetReturnValue<Object>(isolate); return GetReturnValue<Object>(isolate);
} }
...@@ -273,8 +254,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedGetter( ...@@ -273,8 +254,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedGetter(
DCHECK(!interceptor->is_named()); DCHECK(!interceptor->is_named());
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedGetterCallback); RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedGetterCallback);
LOG(isolate,
ApiIndexedPropertyAccess("interceptor-indexed-getter", holder(), index));
IndexedPropertyGetterCallback f = IndexedPropertyGetterCallback f =
ToCData<IndexedPropertyGetterCallback>(interceptor->getter()); ToCData<IndexedPropertyGetterCallback>(interceptor->getter());
return BasicCallIndexedGetterCallback(f, index, interceptor); return BasicCallIndexedGetterCallback(f, index, interceptor);
...@@ -285,8 +264,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedDescriptor( ...@@ -285,8 +264,6 @@ Handle<Object> PropertyCallbackArguments::CallIndexedDescriptor(
DCHECK(!interceptor->is_named()); DCHECK(!interceptor->is_named());
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RCS_SCOPE(isolate, RuntimeCallCounterId::kIndexedDescriptorCallback); RCS_SCOPE(isolate, RuntimeCallCounterId::kIndexedDescriptorCallback);
LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-descriptor",
holder(), index));
IndexedPropertyDescriptorCallback f = IndexedPropertyDescriptorCallback f =
ToCData<IndexedPropertyDescriptorCallback>(interceptor->descriptor()); ToCData<IndexedPropertyDescriptorCallback>(interceptor->descriptor());
return BasicCallIndexedGetterCallback(f, index, interceptor); return BasicCallIndexedGetterCallback(f, index, interceptor);
...@@ -323,7 +300,6 @@ Handle<Object> PropertyCallbackArguments::CallAccessorGetter( ...@@ -323,7 +300,6 @@ Handle<Object> PropertyCallbackArguments::CallAccessorGetter(
Handle<AccessorInfo> info, Handle<Name> name) { Handle<AccessorInfo> info, Handle<Name> name) {
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RCS_SCOPE(isolate, RuntimeCallCounterId::kAccessorGetterCallback); RCS_SCOPE(isolate, RuntimeCallCounterId::kAccessorGetterCallback);
LOG(isolate, ApiNamedPropertyAccess("accessor-getter", holder(), *name));
AccessorNameGetterCallback f = AccessorNameGetterCallback f =
ToCData<AccessorNameGetterCallback>(info->getter()); ToCData<AccessorNameGetterCallback>(info->getter());
return BasicCallNamedGetterCallback(f, name, info, return BasicCallNamedGetterCallback(f, name, info,
...@@ -339,7 +315,6 @@ Handle<Object> PropertyCallbackArguments::CallAccessorSetter( ...@@ -339,7 +315,6 @@ Handle<Object> PropertyCallbackArguments::CallAccessorSetter(
ToCData<AccessorNameSetterCallback>(accessor_info->setter()); ToCData<AccessorNameSetterCallback>(accessor_info->setter());
PREPARE_CALLBACK_INFO(isolate, f, Handle<Object>, void, accessor_info, PREPARE_CALLBACK_INFO(isolate, f, Handle<Object>, void, accessor_info,
handle(receiver(), isolate), Setter); handle(receiver(), isolate), Setter);
LOG(isolate, ApiNamedPropertyAccess("accessor-setter", holder(), *name));
f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), callback_info); f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), callback_info);
return GetReturnValue<Object>(isolate); return GetReturnValue<Object>(isolate);
} }
......
...@@ -35,10 +35,9 @@ ...@@ -35,10 +35,9 @@
* TODO(verwaest): Remove calls form API methods to DO_NOT_USE macros. * TODO(verwaest): Remove calls form API methods to DO_NOT_USE macros.
*/ */
#define LOG_API(isolate, class_name, function_name) \ #define API_RCS_SCOPE(isolate, class_name, function_name) \
RCS_SCOPE(isolate, \ RCS_SCOPE(isolate, \
i::RuntimeCallCounterId::kAPI_##class_name##_##function_name); \ i::RuntimeCallCounterId::kAPI_##class_name##_##function_name);
LOG(isolate, ApiEntryCall("v8::" #class_name "::" #function_name))
#define ENTER_V8_DO_NOT_USE(isolate) i::VMState<v8::OTHER> __state__((isolate)) #define ENTER_V8_DO_NOT_USE(isolate) i::VMState<v8::OTHER> __state__((isolate))
...@@ -50,7 +49,7 @@ ...@@ -50,7 +49,7 @@
} \ } \
HandleScopeClass handle_scope(isolate); \ HandleScopeClass handle_scope(isolate); \
CallDepthScope<do_callback> call_depth_scope(isolate, context); \ 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)); \ i::VMState<v8::OTHER> __state__((isolate)); \
bool has_pending_exception = false bool has_pending_exception = false
......
This diff is collapsed.
...@@ -267,7 +267,6 @@ V8_WARN_UNUSED_RESULT static Object HandleApiCallAsFunctionOrConstructor( ...@@ -267,7 +267,6 @@ V8_WARN_UNUSED_RESULT static Object HandleApiCallAsFunctionOrConstructor(
Object result; Object result;
{ {
HandleScope scope(isolate); HandleScope scope(isolate);
LOG(isolate, ApiObjectAccess("call non-function", obj));
FunctionCallbackArguments custom( FunctionCallbackArguments custom(
isolate, call_data.data(), constructor, obj, new_target, isolate, call_data.data(), constructor, obj, new_target,
args.address_of_first_argument(), args.length() - 1); args.address_of_first_argument(), args.length() - 1);
......
...@@ -183,7 +183,7 @@ bool GetPrivateMembers(Local<Context> context, Local<Object> object, ...@@ -183,7 +183,7 @@ bool GetPrivateMembers(Local<Context> context, Local<Object> object,
std::vector<Local<Value>>* names_out, std::vector<Local<Value>>* names_out,
std::vector<Local<Value>>* values_out) { std::vector<Local<Value>>* values_out) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate()); 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); ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
i::Handle<i::JSReceiver> receiver = Utils::OpenHandle(*object); i::Handle<i::JSReceiver> receiver = Utils::OpenHandle(*object);
i::Handle<i::JSArray> names; i::Handle<i::JSArray> names;
......
...@@ -1528,8 +1528,6 @@ bool Isolate::MayAccess(Handle<Context> accessing_context, ...@@ -1528,8 +1528,6 @@ bool Isolate::MayAccess(Handle<Context> accessing_context,
data = handle(access_check_info.data(), this); data = handle(access_check_info.data(), this);
} }
LOG(this, ApiSecurityCheck());
{ {
// Leaving JavaScript. // Leaving JavaScript.
VMState<EXTERNAL> state(this); VMState<EXTERNAL> state(this);
......
...@@ -2009,7 +2009,6 @@ DEFINE_BOOL(log, false, ...@@ -2009,7 +2009,6 @@ DEFINE_BOOL(log, false,
"Minimal logging (no API, code, GC, suspect, or handles samples).") "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_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, DEFINE_BOOL(log_code, false,
"Log code events to the log file without profiling.") "Log code events to the log file without profiling.")
DEFINE_BOOL(log_code_disassemble, false, DEFINE_BOOL(log_code_disassemble, false,
......
...@@ -135,7 +135,6 @@ void V8::Initialize() { ...@@ -135,7 +135,6 @@ void V8::Initialize() {
// Update logging information before enforcing flag implications. // Update logging information before enforcing flag implications.
bool* log_all_flags[] = {&FLAG_turbo_profiling_log_builtins, bool* log_all_flags[] = {&FLAG_turbo_profiling_log_builtins,
&FLAG_log_all, &FLAG_log_all,
&FLAG_log_api,
&FLAG_log_code, &FLAG_log_code,
&FLAG_log_code_disassemble, &FLAG_log_code_disassemble,
&FLAG_log_source_code, &FLAG_log_source_code,
......
...@@ -1074,13 +1074,6 @@ void Logger::IntPtrTEvent(const char* name, intptr_t value) { ...@@ -1074,13 +1074,6 @@ void Logger::IntPtrTEvent(const char* name, intptr_t value) {
msg.WriteToLogFile(); 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, void Logger::SharedLibraryEvent(const std::string& library_path,
uintptr_t start, uintptr_t end, uintptr_t start, uintptr_t end,
intptr_t aslr_slide) { intptr_t aslr_slide) {
...@@ -1152,39 +1145,6 @@ bool Logger::is_logging() { ...@@ -1152,39 +1145,6 @@ bool Logger::is_logging() {
TIMER_EVENTS_LIST(V) TIMER_EVENTS_LIST(V)
#undef 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) { void Logger::NewEvent(const char* name, void* object, size_t size) {
if (!FLAG_log) return; if (!FLAG_log) return;
MSG_BUILDER(); MSG_BUILDER();
......
...@@ -160,30 +160,6 @@ class Logger : public CodeEventListener { ...@@ -160,30 +160,6 @@ class Logger : public CodeEventListener {
void ScriptEvent(ScriptEventType type, int script_id); void ScriptEvent(ScriptEventType type, int script_id);
void ScriptDetails(Script script); 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. ==== // ==== Events logged by --log-code. ====
V8_EXPORT_PRIVATE void AddCodeEventListener(CodeEventListener* listener); V8_EXPORT_PRIVATE void AddCodeEventListener(CodeEventListener* listener);
V8_EXPORT_PRIVATE void RemoveCodeEventListener(CodeEventListener* listener); V8_EXPORT_PRIVATE void RemoveCodeEventListener(CodeEventListener* listener);
......
...@@ -513,7 +513,6 @@ UNINITIALIZED_TEST(LogAll) { ...@@ -513,7 +513,6 @@ UNINITIALIZED_TEST(LogAll) {
SETUP_FLAGS(); SETUP_FLAGS();
i::FLAG_log_all = true; i::FLAG_log_all = true;
i::FLAG_log_deopt = true; i::FLAG_log_deopt = true;
i::FLAG_log_api = true;
i::FLAG_turbo_inlining = false; i::FLAG_turbo_inlining = false;
i::FLAG_log_internal_timer_events = true; i::FLAG_log_internal_timer_events = true;
i::FLAG_allow_natives_syntax = true; i::FLAG_allow_natives_syntax = true;
...@@ -551,11 +550,9 @@ UNINITIALIZED_TEST(LogAll) { ...@@ -551,11 +550,9 @@ UNINITIALIZED_TEST(LogAll) {
logger.StopLogging(); logger.StopLogging();
// We should find at least one code-creation even for testAddFn(); // 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-start", "V8.CompileCode"}));
CHECK(logger.ContainsLine({"timer-event-end", "V8.CompileCode"})); CHECK(logger.ContainsLine({"timer-event-end", "V8.CompileCode"}));
CHECK(logger.ContainsLine({"code-creation,Script", ":1:1"})); CHECK(logger.ContainsLine({"code-creation,Script", ":1:1"}));
CHECK(logger.ContainsLine({"api,v8::Script::Run"}));
CHECK(logger.ContainsLine({"code-creation,LazyCompile,", "testAddFn"})); CHECK(logger.ContainsLine({"code-creation,LazyCompile,", "testAddFn"}));
if (i::FLAG_opt && !i::FLAG_always_opt) { if (i::FLAG_opt && !i::FLAG_always_opt) {
......
...@@ -17,7 +17,6 @@ class State { ...@@ -17,7 +17,6 @@ class State {
_mapTimeline; _mapTimeline;
_deoptTimeline; _deoptTimeline;
_codeTimeline; _codeTimeline;
_apiTimeline;
_tickTimeline; _tickTimeline;
_timerTimeline; _timerTimeline;
_minStartTime = Number.POSITIVE_INFINITY; _minStartTime = Number.POSITIVE_INFINITY;
...@@ -42,13 +41,12 @@ class State { ...@@ -42,13 +41,12 @@ class State {
} }
setTimelines( setTimelines(
mapTimeline, icTimeline, deoptTimeline, codeTimeline, apiTimeline, mapTimeline, icTimeline, deoptTimeline, codeTimeline, tickTimeline,
tickTimeline, timerTimeline) { timerTimeline) {
this._mapTimeline = mapTimeline; this._mapTimeline = mapTimeline;
this._icTimeline = icTimeline; this._icTimeline = icTimeline;
this._deoptTimeline = deoptTimeline; this._deoptTimeline = deoptTimeline;
this._codeTimeline = codeTimeline; this._codeTimeline = codeTimeline;
this._apiTimeline = apiTimeline;
this._tickTimeline = tickTimeline; this._tickTimeline = tickTimeline;
this._timerTimeline = timerTimeline; this._timerTimeline = timerTimeline;
for (let timeline of arguments) { for (let timeline of arguments) {
...@@ -78,10 +76,6 @@ class State { ...@@ -78,10 +76,6 @@ class State {
return this._codeTimeline; return this._codeTimeline;
} }
get apiTimeline() {
return this._apiTimeline;
}
get tickTimeline() { get tickTimeline() {
return this._tickTimeline; return this._tickTimeline;
} }
...@@ -93,8 +87,7 @@ class State { ...@@ -93,8 +87,7 @@ class State {
get timelines() { get timelines() {
return [ return [
this._mapTimeline, this._icTimeline, this._deoptTimeline, this._mapTimeline, this._icTimeline, this._deoptTimeline,
this._codeTimeline, this._apiTimeline, this._tickTimeline, this._codeTimeline, this._tickTimeline, this._timerTimeline
this._timerTimeline
]; ];
} }
......
...@@ -61,7 +61,6 @@ found in the LICENSE file. --> ...@@ -61,7 +61,6 @@ found in the LICENSE file. -->
<timeline-track id="ic-track" title="IC"></timeline-track> <timeline-track id="ic-track" title="IC"></timeline-track>
<timeline-track id="deopt-track" title="Deopt"></timeline-track> <timeline-track id="deopt-track" title="Deopt"></timeline-track>
<timeline-track id="code-track" title="Code"></timeline-track> <timeline-track id="code-track" title="Code"></timeline-track>
<timeline-track id="api-track" title="API"></timeline-track>
</timeline-panel> </timeline-panel>
<div class="panels"> <div class="panels">
...@@ -92,7 +91,6 @@ found in the LICENSE file. --> ...@@ -92,7 +91,6 @@ found in the LICENSE file. -->
<list-panel id="map-list" title="Map Events"></list-panel> <list-panel id="map-list" title="Map Events"></list-panel>
<list-panel id="deopt-list" title="Deopt 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="code-list" title="Code Events"></list-panel>
<list-panel id="api-list" title="API Events"></list-panel>
</div> </div>
</section> </section>
...@@ -155,8 +153,8 @@ found in the LICENSE file. --> ...@@ -155,8 +153,8 @@ found in the LICENSE file. -->
</dt> </dt>
<dd>Log detailed generated generated code</dd> <dd>Log detailed generated generated code</dd>
<dt> <dt>
<a href="https://source.chromium.org/search?q=FLAG_log_api"> <a href="https://source.chromium.org/search?q=FLAG_log_code">
<code>--log-api</code> <code>--log-code</code>
</a> </a>
</dt> </dt>
<dd>Log details about deoptimized code</dd> <dd>Log details about deoptimized code</dd>
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
import {Script, SourcePosition} from '../profile.mjs'; import {Script, SourcePosition} from '../profile.mjs';
import {State} from './app-model.mjs'; import {State} from './app-model.mjs';
import {ApiLogEntry} from './log/api.mjs';
import {CodeLogEntry} from './log/code.mjs'; import {CodeLogEntry} from './log/code.mjs';
import {DeoptLogEntry} from './log/code.mjs'; import {DeoptLogEntry} from './log/code.mjs';
import {SharedLibLogEntry} from './log/code.mjs'; import {SharedLibLogEntry} from './log/code.mjs';
...@@ -34,14 +33,12 @@ class App { ...@@ -34,14 +33,12 @@ class App {
icTrack: $('#ic-track'), icTrack: $('#ic-track'),
deoptTrack: $('#deopt-track'), deoptTrack: $('#deopt-track'),
codeTrack: $('#code-track'), codeTrack: $('#code-track'),
apiTrack: $('#api-track'),
timerTrack: $('#timer-track'), timerTrack: $('#timer-track'),
icList: $('#ic-list'), icList: $('#ic-list'),
mapList: $('#map-list'), mapList: $('#map-list'),
codeList: $('#code-list'), codeList: $('#code-list'),
deoptList: $('#deopt-list'), deoptList: $('#deopt-list'),
apiList: $('#api-list'),
mapPanel: $('#map-panel'), mapPanel: $('#map-panel'),
codePanel: $('#code-panel'), codePanel: $('#code-panel'),
...@@ -64,7 +61,6 @@ class App { ...@@ -64,7 +61,6 @@ class App {
SourcePosition, SourcePosition,
MapLogEntry, MapLogEntry,
IcLogEntry, IcLogEntry,
ApiLogEntry,
CodeLogEntry, CodeLogEntry,
DeoptLogEntry, DeoptLogEntry,
SharedLibLogEntry, SharedLibLogEntry,
...@@ -125,7 +121,6 @@ class App { ...@@ -125,7 +121,6 @@ class App {
entries = entry.entries.concat(entry.sourcePositions); entries = entry.entries.concat(entry.sourcePositions);
break; break;
case TimerLogEntry: case TimerLogEntry:
case ApiLogEntry:
case CodeLogEntry: case CodeLogEntry:
case TickLogEntry: case TickLogEntry:
case SharedLibLogEntry: case SharedLibLogEntry:
...@@ -175,8 +170,6 @@ class App { ...@@ -175,8 +170,6 @@ class App {
return this.showMapEntries(entries, focusView); return this.showMapEntries(entries, focusView);
case IcLogEntry: case IcLogEntry:
return this.showIcEntries(entries, focusView); return this.showIcEntries(entries, focusView);
case ApiLogEntry:
return this.showApiEntries(entries, focusView);
case CodeLogEntry: case CodeLogEntry:
return this.showCodeEntries(entries, focusView); return this.showCodeEntries(entries, focusView);
case DeoptLogEntry: case DeoptLogEntry:
...@@ -215,11 +208,6 @@ class App { ...@@ -215,11 +208,6 @@ class App {
if (focusView) this._view.codePanel.show(); 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) {} showTickEntries(entries, focusView = true) {}
showTimerEntries(entries, focusView = true) {} showTimerEntries(entries, focusView = true) {}
...@@ -239,7 +227,6 @@ class App { ...@@ -239,7 +227,6 @@ class App {
this.showIcEntries(this._state.icTimeline.selectionOrSelf, false); this.showIcEntries(this._state.icTimeline.selectionOrSelf, false);
this.showDeoptEntries(this._state.deoptTimeline.selectionOrSelf, false); this.showDeoptEntries(this._state.deoptTimeline.selectionOrSelf, false);
this.showCodeEntries(this._state.codeTimeline.selectionOrSelf, false); this.showCodeEntries(this._state.codeTimeline.selectionOrSelf, false);
this.showApiEntries(this._state.apiTimeline.selectionOrSelf, false);
this.showTickEntries(this._state.tickTimeline.selectionOrSelf, false); this.showTickEntries(this._state.tickTimeline.selectionOrSelf, false);
this.showTimerEntries(this._state.timerTimeline.selectionOrSelf, false); this.showTimerEntries(this._state.timerTimeline.selectionOrSelf, false);
this._view.timelinePanel.timeSelection = {start, end, focus, zoom}; this._view.timelinePanel.timeSelection = {start, end, focus, zoom};
...@@ -260,8 +247,6 @@ class App { ...@@ -260,8 +247,6 @@ class App {
return this.focusMapLogEntry(entry); return this.focusMapLogEntry(entry);
case IcLogEntry: case IcLogEntry:
return this.focusIcLogEntry(entry); return this.focusIcLogEntry(entry);
case ApiLogEntry:
return this.focusApiLogEntry(entry);
case CodeLogEntry: case CodeLogEntry:
return this.focusCodeLogEntry(entry); return this.focusCodeLogEntry(entry);
case DeoptLogEntry: case DeoptLogEntry:
...@@ -312,12 +297,6 @@ class App { ...@@ -312,12 +297,6 @@ class App {
// no-op. // no-op.
} }
focusApiLogEntry(entry) {
this._state.apiLogEntry = entry;
this._view.apiTrack.focusedEntry = entry;
this.focusSourcePosition(entry.sourcePosition);
}
focusTickLogEntry(entry) { focusTickLogEntry(entry) {
this._state.tickLogEntry = entry; this._state.tickLogEntry = entry;
this._view.tickTrack.focusedEntry = entry; this._view.tickTrack.focusedEntry = entry;
...@@ -380,18 +359,16 @@ class App { ...@@ -380,18 +359,16 @@ class App {
const icTimeline = processor.icTimeline; const icTimeline = processor.icTimeline;
const deoptTimeline = processor.deoptTimeline; const deoptTimeline = processor.deoptTimeline;
const codeTimeline = processor.codeTimeline; const codeTimeline = processor.codeTimeline;
const apiTimeline = processor.apiTimeline;
const tickTimeline = processor.tickTimeline; const tickTimeline = processor.tickTimeline;
const timerTimeline = processor.timerTimeline; const timerTimeline = processor.timerTimeline;
this._state.setTimelines( this._state.setTimelines(
mapTimeline, icTimeline, deoptTimeline, codeTimeline, apiTimeline, mapTimeline, icTimeline, deoptTimeline, codeTimeline, tickTimeline,
tickTimeline, timerTimeline); timerTimeline);
this._view.mapPanel.timeline = mapTimeline; this._view.mapPanel.timeline = mapTimeline;
this._view.icList.timeline = icTimeline; this._view.icList.timeline = icTimeline;
this._view.mapList.timeline = mapTimeline; this._view.mapList.timeline = mapTimeline;
this._view.deoptList.timeline = deoptTimeline; this._view.deoptList.timeline = deoptTimeline;
this._view.codeList.timeline = codeTimeline; this._view.codeList.timeline = codeTimeline;
this._view.apiList.timeline = apiTimeline;
this._view.scriptPanel.scripts = processor.scripts; this._view.scriptPanel.scripts = processor.scripts;
this._view.codePanel.timeline = codeTimeline; this._view.codePanel.timeline = codeTimeline;
this._view.codePanel.timeline = codeTimeline; this._view.codePanel.timeline = codeTimeline;
...@@ -410,7 +387,6 @@ class App { ...@@ -410,7 +387,6 @@ class App {
this._view.icTrack.data = this._state.icTimeline; this._view.icTrack.data = this._state.icTimeline;
this._view.deoptTrack.data = this._state.deoptTimeline; this._view.deoptTrack.data = this._state.deoptTimeline;
this._view.codeTrack.data = this._state.codeTimeline; this._view.codeTrack.data = this._state.codeTimeline;
this._view.apiTrack.data = this._state.apiTimeline;
this._view.tickTrack.data = this._state.tickTimeline; this._view.tickTrack.data = this._state.tickTimeline;
this._view.timerTrack.data = this._state.timerTimeline; this._view.timerTrack.data = this._state.timerTimeline;
} }
......
// 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'; ...@@ -6,7 +6,6 @@ import {LogReader, parseString, parseVarArgs} from '../logreader.mjs';
import {Profile} from '../profile.mjs'; import {Profile} from '../profile.mjs';
import {RemoteLinuxCppEntriesProvider, RemoteMacOSCppEntriesProvider} from '../tickprocessor.mjs' import {RemoteLinuxCppEntriesProvider, RemoteMacOSCppEntriesProvider} from '../tickprocessor.mjs'
import {ApiLogEntry} from './log/api.mjs';
import {CodeLogEntry, DeoptLogEntry, FeedbackVectorEntry, SharedLibLogEntry} from './log/code.mjs'; import {CodeLogEntry, DeoptLogEntry, FeedbackVectorEntry, SharedLibLogEntry} from './log/code.mjs';
import {IcLogEntry} from './log/ic.mjs'; import {IcLogEntry} from './log/ic.mjs';
import {Edge, MapLogEntry} from './log/map.mjs'; import {Edge, MapLogEntry} from './log/map.mjs';
...@@ -49,7 +48,6 @@ class AsyncConsumer { ...@@ -49,7 +48,6 @@ class AsyncConsumer {
export class Processor extends LogReader { export class Processor extends LogReader {
_profile = new Profile(); _profile = new Profile();
_apiTimeline = new Timeline();
_codeTimeline = new Timeline(); _codeTimeline = new Timeline();
_deoptTimeline = new Timeline(); _deoptTimeline = new Timeline();
_icTimeline = new Timeline(); _icTimeline = new Timeline();
...@@ -580,19 +578,7 @@ export class Processor extends LogReader { ...@@ -580,19 +578,7 @@ export class Processor extends LogReader {
} }
processApiEvent(type, varArgs) { processApiEvent(type, varArgs) {
let name, arg1; // legacy events that are no longer supported
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));
} }
processTimerEventStart(type, time) { processTimerEventStart(type, time) {
...@@ -629,10 +615,6 @@ export class Processor extends LogReader { ...@@ -629,10 +615,6 @@ export class Processor extends LogReader {
return this._codeTimeline; return this._codeTimeline;
} }
get apiTimeline() {
return this._apiTimeline;
}
get tickTimeline() { get tickTimeline() {
return this._tickTimeline; return this._tickTimeline;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment