[logging] Fix logging of lazy deserialized bytecode handlers.

Bug: v8:7180
Change-Id: If246db425a493e52092cba0fc28b1f02bd8d5db8
Reviewed-on: https://chromium-review.googlesource.com/816835
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49957}
This commit is contained in:
Jaroslav Sevcik 2017-12-08 09:44:22 +01:00 committed by Commit Bot
parent f9fe6d8d48
commit 27642eb00b
3 changed files with 14 additions and 6 deletions

View File

@ -1573,6 +1573,16 @@ void Logger::LogCodeObjects() {
}
}
void Logger::LogBytecodeHandler(interpreter::Bytecode bytecode,
interpreter::OperandScale operand_scale,
Code* code) {
std::string bytecode_name =
interpreter::Bytecodes::ToString(bytecode, operand_scale);
PROFILE(isolate_,
CodeCreateEvent(CodeEventListener::BYTECODE_HANDLER_TAG,
AbstractCode::cast(code), bytecode_name.c_str()));
}
void Logger::LogBytecodeHandlers() {
const interpreter::OperandScale kOperandScales[] = {
#define VALUE(Name, _) interpreter::OperandScale::k##Name,
@ -1588,11 +1598,7 @@ void Logger::LogBytecodeHandlers() {
if (interpreter::Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) {
Code* code = interpreter->GetBytecodeHandler(bytecode, operand_scale);
if (isolate_->heap()->IsDeserializeLazyHandler(code)) continue;
std::string bytecode_name =
interpreter::Bytecodes::ToString(bytecode, operand_scale);
PROFILE(isolate_, CodeCreateEvent(
CodeEventListener::BYTECODE_HANDLER_TAG,
AbstractCode::cast(code), bytecode_name.c_str()));
LogBytecodeHandler(bytecode, operand_scale, code);
}
}
}

View File

@ -258,6 +258,8 @@ class Logger : public CodeEventListener {
void LogCodeObjects();
// Used for logging bytecode handlers found in the snapshot.
void LogBytecodeHandlers();
void LogBytecodeHandler(interpreter::Bytecode bytecode,
interpreter::OperandScale operand_scale, Code* code);
// Logs all Mpas foind in the heap.
void LogMaps();

View File

@ -139,7 +139,7 @@ Code* Snapshot::DeserializeHandler(Isolate* isolate,
}
if (isolate->logger()->is_logging_code_events() || isolate->is_profiling()) {
isolate->logger()->LogCodeObject(code);
isolate->logger()->LogBytecodeHandler(bytecode, operand_scale, code);
}
return code;