Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Unified Diff: src/interpreter/interpreter.cc

Issue 1806883002: [interpreter] Print name together with bytecode handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 76c248ccc918a7d8a5a24a6917e32c7bf153a5cd..56bcc14332f83c2e6870fd824f21061ba01624d9 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -37,11 +37,11 @@ void Interpreter::Initialize() {
InterpreterAssembler assembler(isolate_, &zone, Bytecode::k##Name); \
Do##Name(&assembler); \
Handle<Code> code = assembler.GenerateCode(); \
- TraceCodegen(code, #Name); \
+ dispatch_table_[Bytecodes::ToByte(Bytecode::k##Name)] = *code; \
+ TraceCodegen(code); \
LOG_CODE_EVENT(isolate_, \
CodeCreateEvent(Logger::BYTECODE_HANDLER_TAG, \
AbstractCode::cast(*code), #Name)); \
- dispatch_table_[Bytecodes::ToByte(Bytecode::k##Name)] = *code; \
}
BYTECODE_LIST(GENERATE_CODE)
#undef GENERATE_CODE
@@ -116,16 +116,28 @@ bool Interpreter::IsDispatchTableInitialized() {
return dispatch_table_[0] != nullptr;
}
-void Interpreter::TraceCodegen(Handle<Code> code, const char* name) {
+void Interpreter::TraceCodegen(Handle<Code> code) {
#ifdef ENABLE_DISASSEMBLER
if (FLAG_trace_ignition_codegen) {
OFStream os(stdout);
- code->Disassemble(name, os);
+ code->Disassemble(nullptr, os);
os << std::flush;
}
#endif // ENABLE_DISASSEMBLER
}
+const char* Interpreter::LookupNameOfBytecodeHandler(Code* code) {
+#ifdef ENABLE_DISASSEMBLER
+#define RETURN_NAME(Name, ...) \
+ if (dispatch_table_[Bytecodes::ToByte(Bytecode::k##Name)] == code) { \
+ return #Name; \
+ }
+ BYTECODE_LIST(RETURN_NAME)
+#undef RETURN_NAME
+#endif // ENABLE_DISASSEMBLER
+ return nullptr;
+}
+
// LdaZero
//
// Load literal '0' into the accumulator.
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698