diff --git a/src/log.cc b/src/log.cc index 563fe3c5f0..edd883976d 100644 --- a/src/log.cc +++ b/src/log.cc @@ -2011,10 +2011,10 @@ FILE* Logger::TearDown() { } void ExistingCodeLogger::LogCodeObject(Object* object) { - AbstractCode* code_object = AbstractCode::cast(object); + AbstractCode* abstract_code = AbstractCode::cast(object); CodeEventListener::LogEventsAndTags tag = CodeEventListener::STUB_TAG; const char* description = "Unknown code from before profiling"; - switch (code_object->kind()) { + switch (abstract_code->kind()) { case AbstractCode::INTERPRETED_FUNCTION: case AbstractCode::OPTIMIZED_FUNCTION: return; // We log this later using LogCompiledFunctions. @@ -2022,7 +2022,7 @@ void ExistingCodeLogger::LogCodeObject(Object* object) { return; // We log it later by walking the dispatch table. case AbstractCode::STUB: description = - CodeStub::MajorName(CodeStub::GetMajorKey(code_object->GetCode())); + CodeStub::MajorName(CodeStub::GetMajorKey(abstract_code->GetCode())); if (description == nullptr) description = "A stub from before profiling"; tag = CodeEventListener::STUB_TAG; break; @@ -2031,8 +2031,13 @@ void ExistingCodeLogger::LogCodeObject(Object* object) { tag = CodeEventListener::REG_EXP_TAG; break; case AbstractCode::BUILTIN: + if (Code::cast(object)->is_interpreter_trampoline_builtin() && + Code::cast(object) == + *BUILTIN_CODE(isolate_, InterpreterEntryTrampoline)) { + return; + } description = - isolate_->builtins()->name(code_object->GetCode()->builtin_index()); + isolate_->builtins()->name(abstract_code->GetCode()->builtin_index()); tag = CodeEventListener::BUILTIN_TAG; break; case AbstractCode::WASM_FUNCTION: @@ -2058,7 +2063,7 @@ void ExistingCodeLogger::LogCodeObject(Object* object) { case AbstractCode::NUMBER_OF_KINDS: UNIMPLEMENTED(); } - CALL_CODE_EVENT_HANDLER(CodeCreateEvent(tag, code_object, description)) + CALL_CODE_EVENT_HANDLER(CodeCreateEvent(tag, abstract_code, description)) } void ExistingCodeLogger::LogCodeObjects() { @@ -2084,6 +2089,12 @@ void ExistingCodeLogger::LogCompiledFunctions() { // During iteration, there can be heap allocation due to // GetScriptLineNumber call. for (int i = 0; i < compiled_funcs_count; ++i) { + if (sfis[i]->function_data()->IsInterpreterData()) { + LogExistingFunction(sfis[i], + Handle(AbstractCode::cast( + sfis[i]->InterpreterTrampoline())), + CodeEventListener::INTERPRETED_FUNCTION_TAG); + } if (code_objects[i].is_identical_to(BUILTIN_CODE(isolate_, CompileLazy))) continue; LogExistingFunction(sfis[i], code_objects[i]); @@ -2128,8 +2139,9 @@ void ExistingCodeLogger::LogBytecodeHandlers() { } } -void ExistingCodeLogger::LogExistingFunction(Handle shared, - Handle code) { +void ExistingCodeLogger::LogExistingFunction( + Handle shared, Handle code, + CodeEventListener::LogEventsAndTags tag) { if (shared->script()->IsScript()) { Handle