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

Unified Diff: src/interpreter/interpreter.cc

Issue 1703453002: [interpreter, debugger] support debug breaks via bytecode array copy (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 10 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/interpreter/interpreter-assembler.h » ('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 9756020ecf9992aeb9b348fa693e5712b8dc9080..43a7ead2810e1463b9d9f63210aac2c007789f58 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -37,16 +37,21 @@ void Interpreter::Initialize() {
Do##Name(&assembler); \
Handle<Code> code = assembler.GenerateCode(); \
TraceCodegen(code, #Name); \
- int index = static_cast<int>(Bytecode::k##Name); \
- dispatch_table_[index] = *code; \
+ dispatch_table_[Bytecodes::ToByte(Bytecode::k##Name)] = *code; \
}
BYTECODE_LIST(GENERATE_CODE)
#undef GENERATE_CODE
}
+Code* Interpreter::GetBytecodeHandler(Bytecode bytecode) {
+ DCHECK(IsDispatchTableInitialized());
+ return dispatch_table_[Bytecodes::ToByte(bytecode)];
+}
+
void Interpreter::IterateDispatchTable(ObjectVisitor* v) {
- v->VisitPointers(&dispatch_table_[0],
- &dispatch_table_[0] + kDispatchTableSize);
+ v->VisitPointers(
+ reinterpret_cast<Object**>(&dispatch_table_[0]),
+ reinterpret_cast<Object**>(&dispatch_table_[0] + kDispatchTableSize));
}
// static
@@ -1729,6 +1734,18 @@ void Interpreter::DoDebugger(InterpreterAssembler* assembler) {
__ Dispatch();
}
+// DebugBreak
+//
+// Call runtime to handle a debug break.
+#define DEBUG_BREAK(Name, ...) \
+ void Interpreter::Do##Name(InterpreterAssembler* assembler) { \
+ Node* context = __ GetContext(); \
+ Node* original_handler = __ CallRuntime(Runtime::kDebugBreak, context); \
+ __ DispatchToBytecodeHandler(original_handler); \
+ }
+DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK);
+#undef DEBUG_BREAK
+
// ForInPrepare <cache_info_triple>
//
// Returns state for for..in loop execution based on the object in the
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698