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

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

Issue 1386133002: [Interpreter] Add bitwise operators (Or, Xor, And) to interpreter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
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 c41dee3df9beae2c73dda7ea0252e570974e97ea..bb398649716c488c3a6e1716b07be9ccd2f1d220 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -804,6 +804,48 @@ TEST(CallRuntime) {
},
},
{
+ "function f() { return %BitwiseOr(1, 2) }\nf()",
rmcilroy 2015/10/06 11:09:29 This isn't testing your binary operators, it is ch
mythria 2015/10/06 13:47:40 Done.
+ 2 * kPointerSize,
+ 1,
+ 14,
+ {
+ B(LdaSmi8), U8(1), //
+ B(Star), R(0), //
+ B(LdaSmi8), U8(2), //
+ B(Star), R(1), //
+ B(CallRuntime), U16(Runtime::kBitwiseOr), R(0), U8(2), //
+ B(Return) //
+ },
+ },
+ {
+ "function f() { return %BitwiseXor(1, 2) }\nf()",
rmcilroy 2015/10/06 11:09:29 ditto, with '^'.
mythria 2015/10/06 13:47:40 Done.
+ 2 * kPointerSize,
+ 1,
+ 14,
+ {
+ B(LdaSmi8), U8(1), //
+ B(Star), R(0), //
+ B(LdaSmi8), U8(2), //
+ B(Star), R(1), //
+ B(CallRuntime), U16(Runtime::kBitwiseXor), R(0), U8(2), //
+ B(Return) //
+ },
+ },
+ {
+ "function f() { return %BitwiseAnd(1, 2) }\nf()",
rmcilroy 2015/10/06 11:09:28 ditto with '&'
mythria 2015/10/06 13:47:40 Done.
+ 2 * kPointerSize,
+ 1,
+ 14,
+ {
+ B(LdaSmi8), U8(1), //
+ B(Star), R(0), //
+ B(LdaSmi8), U8(2), //
+ B(Star), R(1), //
+ B(CallRuntime), U16(Runtime::kBitwiseAnd), R(0), U8(2), //
+ B(Return) //
+ },
+ },
+ {
"function f() { return %Add(1, 2) }\nf()",
2 * kPointerSize,
1,

Powered by Google App Engine
This is Rietveld 408576698