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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 builder.Call(reg, reg, 0); 53 builder.Call(reg, reg, 0);
54 builder.CallRuntime(Runtime::kIsArray, reg, 1); 54 builder.CallRuntime(Runtime::kIsArray, reg, 1);
55 55
56 // Emit binary operator invocations. 56 // Emit binary operator invocations.
57 builder.BinaryOperation(Token::Value::ADD, reg) 57 builder.BinaryOperation(Token::Value::ADD, reg)
58 .BinaryOperation(Token::Value::SUB, reg) 58 .BinaryOperation(Token::Value::SUB, reg)
59 .BinaryOperation(Token::Value::MUL, reg) 59 .BinaryOperation(Token::Value::MUL, reg)
60 .BinaryOperation(Token::Value::DIV, reg) 60 .BinaryOperation(Token::Value::DIV, reg)
61 .BinaryOperation(Token::Value::MOD, reg); 61 .BinaryOperation(Token::Value::MOD, reg);
62 62
63 // Emit bitwise operator invocations
64 builder.BinaryOperation(Token::Value::BIT_OR, reg)
65 .BinaryOperation(Token::Value::BIT_XOR, reg)
66 .BinaryOperation(Token::Value::BIT_AND, reg);
67
63 // Emit test operator invocations. 68 // Emit test operator invocations.
64 builder.CompareOperation(Token::Value::EQ, reg, LanguageMode::SLOPPY) 69 builder.CompareOperation(Token::Value::EQ, reg, LanguageMode::SLOPPY)
65 .CompareOperation(Token::Value::NE, reg, LanguageMode::SLOPPY) 70 .CompareOperation(Token::Value::NE, reg, LanguageMode::SLOPPY)
66 .CompareOperation(Token::Value::EQ_STRICT, reg, LanguageMode::SLOPPY) 71 .CompareOperation(Token::Value::EQ_STRICT, reg, LanguageMode::SLOPPY)
67 .CompareOperation(Token::Value::NE_STRICT, reg, LanguageMode::SLOPPY) 72 .CompareOperation(Token::Value::NE_STRICT, reg, LanguageMode::SLOPPY)
68 .CompareOperation(Token::Value::LT, reg, LanguageMode::SLOPPY) 73 .CompareOperation(Token::Value::LT, reg, LanguageMode::SLOPPY)
69 .CompareOperation(Token::Value::GT, reg, LanguageMode::SLOPPY) 74 .CompareOperation(Token::Value::GT, reg, LanguageMode::SLOPPY)
70 .CompareOperation(Token::Value::LTE, reg, LanguageMode::SLOPPY) 75 .CompareOperation(Token::Value::LTE, reg, LanguageMode::SLOPPY)
71 .CompareOperation(Token::Value::GTE, reg, LanguageMode::SLOPPY) 76 .CompareOperation(Token::Value::GTE, reg, LanguageMode::SLOPPY)
72 .CompareOperation(Token::Value::INSTANCEOF, reg, LanguageMode::SLOPPY) 77 .CompareOperation(Token::Value::INSTANCEOF, reg, LanguageMode::SLOPPY)
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 440
436 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 441 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
437 iterator.Advance(); 442 iterator.Advance();
438 CHECK(iterator.done()); 443 CHECK(iterator.done());
439 } 444 }
440 445
441 446
442 } // namespace interpreter 447 } // namespace interpreter
443 } // namespace internal 448 } // namespace internal
444 } // namespace v8 449 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698