OLD | NEW |
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 builder.Call(reg, reg, 0); | 61 builder.Call(reg, reg, 0); |
62 builder.CallRuntime(Runtime::kIsArray, reg, 1); | 62 builder.CallRuntime(Runtime::kIsArray, reg, 1); |
63 | 63 |
64 // Emit binary operator invocations. | 64 // Emit binary operator invocations. |
65 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) | 65 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) |
66 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) | 66 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) |
67 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) | 67 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) |
68 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) | 68 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) |
69 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK); | 69 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK); |
70 | 70 |
| 71 // Emit bitwise operator invocations |
| 72 builder.BinaryOperation(Token::Value::BIT_OR, reg, Strength::WEAK) |
| 73 .BinaryOperation(Token::Value::BIT_XOR, reg, Strength::WEAK) |
| 74 .BinaryOperation(Token::Value::BIT_AND, reg, Strength::WEAK); |
| 75 |
71 // Emit shift operator invocations | 76 // Emit shift operator invocations |
72 builder.BinaryOperation(Token::Value::SHL, reg, Strength::WEAK) | 77 builder.BinaryOperation(Token::Value::SHL, reg, Strength::WEAK) |
73 .BinaryOperation(Token::Value::SAR, reg, Strength::WEAK) | 78 .BinaryOperation(Token::Value::SAR, reg, Strength::WEAK) |
74 .BinaryOperation(Token::Value::SHR, reg, Strength::WEAK); | 79 .BinaryOperation(Token::Value::SHR, reg, Strength::WEAK); |
75 | 80 |
76 // Emit unary operator invocations. | 81 // Emit unary operator invocations. |
77 builder.LogicalNot().TypeOf(); | 82 builder.LogicalNot().TypeOf(); |
78 | 83 |
79 // Emit test operator invocations. | 84 // Emit test operator invocations. |
80 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) | 85 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 | 456 |
452 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 457 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
453 iterator.Advance(); | 458 iterator.Advance(); |
454 CHECK(iterator.done()); | 459 CHECK(iterator.done()); |
455 } | 460 } |
456 | 461 |
457 | 462 |
458 } // namespace interpreter | 463 } // namespace interpreter |
459 } // namespace internal | 464 } // namespace internal |
460 } // namespace v8 | 465 } // namespace v8 |
OLD | NEW |