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

Unified Diff: src/interpreter/bytecodes.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/bytecodes.h ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecodes.cc
diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc
index ca831c9c363c9e30900f52909b159dc7f0f4b5d0..c3b17c7b10573f4712d5377258212d381f66dd28 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -71,6 +71,21 @@ Bytecode Bytecodes::FromByte(uint8_t value) {
// static
+Bytecode Bytecodes::GetDebugBreak(Bytecode bytecode) {
+ switch (Size(bytecode)) {
+#define CASE(Name, ...) \
+ case BytecodeTraits<__VA_ARGS__, OPERAND_TERM>::kSize: \
+ return Bytecode::k##Name;
+ DEBUG_BREAK_BYTECODE_LIST(CASE)
+#undef CASE
+ default:
+ break;
+ }
+ UNREACHABLE();
+ return static_cast<Bytecode>(-1);
+}
+
+// static
int Bytecodes::Size(Bytecode bytecode) {
DCHECK(bytecode <= Bytecode::kLast);
switch (bytecode) {
@@ -268,6 +283,19 @@ bool Bytecodes::IsCallOrNew(Bytecode bytecode) {
}
// static
+bool Bytecodes::IsDebugBreak(Bytecode bytecode) {
+ switch (bytecode) {
+#define CASE(Name, ...) case Bytecode::k##Name:
+ DEBUG_BREAK_BYTECODE_LIST(CASE);
+#undef CASE
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+// static
bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) {
return bytecode == Bytecode::kReturn || IsJump(bytecode);
}
@@ -384,6 +412,9 @@ std::ostream& Bytecodes::Decode(std::ostream& os, const uint8_t* bytecode_start,
os << bytecode << " ";
+ // Operands for the debug break are from the original instruction.
+ if (IsDebugBreak(bytecode)) return os;
+
int number_of_operands = NumberOfOperands(bytecode);
int range = 0;
for (int i = 0; i < number_of_operands; i++) {
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698