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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1392913002: [Interpreter] Adds shift operators to interpreter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed a test for shift operators and comments Created 5 years, 2 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.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-bytecode-generator.cc
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc
index 388ef0ef1292d3a0d8306b6ea867259c374c5442..c0a0df33998305b0da607b86b913027a8e3c3fad 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -220,8 +220,7 @@ TEST(PrimitiveExpressions) {
B(Ldar), R(0), //
B(Return) //
},
- 0
- },
+ 0},
{"var x = 0; return x + 3;",
2 * kPointerSize,
1,
@@ -235,8 +234,49 @@ TEST(PrimitiveExpressions) {
B(Add), R(1), //
B(Return) //
},
- 0
- }};
+ 0},
+ {"var x = 10; return x << 3;",
+ 2 * kPointerSize,
+ 1,
+ 13,
+ {
+ B(LdaSmi8), U8(10), //
+ B(Star), R(0), //
+ B(Ldar), R(0), // Easy to spot r1 not really needed here.
+ B(Star), R(1), // Dead store.
+ B(LdaSmi8), U8(3), //
+ B(ShiftLeft), R(1), //
+ B(Return) //
+ },
+ 0},
+ {"var x = 10; return x >> 3;",
+ 2 * kPointerSize,
+ 1,
+ 13,
+ {
+ B(LdaSmi8), U8(10), //
+ B(Star), R(0), //
+ B(Ldar), R(0), // Easy to spot r1 not really needed here.
+ B(Star), R(1), // Dead store.
+ B(LdaSmi8), U8(3), //
+ B(ShiftRight), R(1), //
+ B(Return) //
+ },
+ 0},
+ {"var x = 10; return x >>> 3;",
+ 2 * kPointerSize,
+ 1,
+ 13,
+ {
+ B(LdaSmi8), U8(10), //
+ B(Star), R(0), //
+ B(Ldar), R(0), // Easy to spot r1 not really needed here.
+ B(Star), R(1), // Dead store.
+ B(LdaSmi8), U8(3), //
+ B(ShiftRightLogical), R(1), //
+ B(Return) //
+ },
+ 0}};
for (size_t i = 0; i < arraysize(snippets); i++) {
Handle<BytecodeArray> bytecode_array =
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698