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

Unified Diff: src/interpreter/bytecodes.cc

Issue 2042633002: [interpreter] Ensure optimizations preserve source positions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nits. Created 4 years, 6 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 46134b7f1d418c52dbecbfe82775ad20586f08cf..bce56728f8be9475a03c1f5bb431b4a811114d98 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -276,6 +276,32 @@ bool Bytecodes::IsAccumulatorLoadWithoutEffects(Bytecode bytecode) {
}
}
+bool Bytecodes::IsJumpWithoutEffects(Bytecode bytecode) {
rmcilroy 2016/06/08 11:31:40 // static
oth 2016/06/08 14:18:25 Done.
+ return IsJump(bytecode) && !IsJumpIfToBoolean(bytecode);
+}
+
rmcilroy 2016/06/08 11:31:40 // static
oth 2016/06/08 14:18:25 Done.
+bool Bytecodes::IsRegisterLoadWithoutEffects(Bytecode bytecode) {
+ switch (bytecode) {
+ case Bytecode::kMov:
+ case Bytecode::kPopContext:
+ case Bytecode::kPushContext:
+ case Bytecode::kStar:
+ case Bytecode::kLdrUndefined:
+ return true;
+ default:
+ return false;
+ }
+}
+
+// static
+bool Bytecodes::IsWithoutExternalSideEffects(Bytecode bytecode) {
+ // These bytecodes only manipulate interpreter frame state and will
+ // never throw.
+ return (IsAccumulatorLoadWithoutEffects(bytecode) ||
+ IsRegisterLoadWithoutEffects(bytecode) ||
+ bytecode == Bytecode::kNop || IsJumpWithoutEffects(bytecode));
+}
+
// static
OperandType Bytecodes::GetOperandType(Bytecode bytecode, int i) {
DCHECK_LE(bytecode, Bytecode::kLast);
@@ -488,15 +514,6 @@ bool Bytecodes::IsPrefixScalingBytecode(Bytecode bytecode) {
}
// static
-bool Bytecodes::IsWithoutExternalSideEffects(Bytecode bytecode) {
- // These bytecodes only manipulate interpreter frame state and will
- // never throw.
- return (IsAccumulatorLoadWithoutEffects(bytecode) || IsLdarOrStar(bytecode) ||
- bytecode == Bytecode::kMov || bytecode == Bytecode::kNop ||
- IsJump(bytecode));
-}
-
-// static
bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) {
return bytecode == Bytecode::kReturn || IsJump(bytecode);
}

Powered by Google App Engine
This is Rietveld 408576698