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

Unified Diff: src/interpreter/bytecodes.cc

Issue 2622863003: [debugger] infrastructure for side-effect-free debug-evaluate. (Closed)
Patch Set: Created 3 years, 11 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
Index: src/interpreter/bytecodes.cc
diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc
index 15c4e98a023a90e025e26ab95cd4d9ff881f286b..08b89a0d61cf2e577bac47f403a7040860fd3de1 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -289,6 +289,30 @@ bool Bytecodes::BytecodeHasHandler(Bytecode bytecode,
Bytecodes::IsBytecodeWithScalableOperands(bytecode);
}
+// static
+bool Bytecodes::BytecodeIsReadOnly(Bytecode bytecode) {
+ // TODO(yangguo): whitelist more bytecodes.
+ if (IsWithoutExternalSideEffects(bytecode)) return true;
+ if (IsCallRuntime(bytecode)) return true;
jgruber 2017/01/10 12:46:37 Is CallRuntime really side-effect-free? What about
+ if (IsCallOrNew(bytecode)) return true;
jgruber 2017/01/10 12:46:37 This is considered side-effect-free because we re-
Yang 2017/01/10 14:14:06 Yes.
+ switch (bytecode) {
+ case Bytecode::kStackCheck:
+ case Bytecode::kLdaLookupSlot:
+ case Bytecode::kLdaGlobal:
+ case Bytecode::kLdaNamedProperty:
+ case Bytecode::kLdaKeyedProperty:
+ case Bytecode::kAdd:
+ case Bytecode::kReturn:
+ case Bytecode::kCreateCatchContext:
+ case Bytecode::kSetPendingMessage:
+ case Bytecode::kPushContext:
+ case Bytecode::kPopContext:
+ return true;
+ default:
+ return false;
+ }
+}
+
std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode) {
return os << Bytecodes::ToString(bytecode);
}

Powered by Google App Engine
This is Rietveld 408576698