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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 .BinaryOperation(Token::Value::BIT_AND, reg, Strength::WEAK); | 83 .BinaryOperation(Token::Value::BIT_AND, reg, Strength::WEAK); |
84 | 84 |
85 // Emit shift operator invocations | 85 // Emit shift operator invocations |
86 builder.BinaryOperation(Token::Value::SHL, reg, Strength::WEAK) | 86 builder.BinaryOperation(Token::Value::SHL, reg, Strength::WEAK) |
87 .BinaryOperation(Token::Value::SAR, reg, Strength::WEAK) | 87 .BinaryOperation(Token::Value::SAR, reg, Strength::WEAK) |
88 .BinaryOperation(Token::Value::SHR, reg, Strength::WEAK); | 88 .BinaryOperation(Token::Value::SHR, reg, Strength::WEAK); |
89 | 89 |
90 // Emit unary operator invocations. | 90 // Emit unary operator invocations. |
91 builder.LogicalNot().TypeOf(); | 91 builder.LogicalNot().TypeOf(); |
92 | 92 |
| 93 // Emit new. |
| 94 builder.New(reg, reg, 0); |
| 95 |
93 // Emit test operator invocations. | 96 // Emit test operator invocations. |
94 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) | 97 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) |
95 .CompareOperation(Token::Value::NE, reg, Strength::WEAK) | 98 .CompareOperation(Token::Value::NE, reg, Strength::WEAK) |
96 .CompareOperation(Token::Value::EQ_STRICT, reg, Strength::WEAK) | 99 .CompareOperation(Token::Value::EQ_STRICT, reg, Strength::WEAK) |
97 .CompareOperation(Token::Value::NE_STRICT, reg, Strength::WEAK) | 100 .CompareOperation(Token::Value::NE_STRICT, reg, Strength::WEAK) |
98 .CompareOperation(Token::Value::LT, reg, Strength::WEAK) | 101 .CompareOperation(Token::Value::LT, reg, Strength::WEAK) |
99 .CompareOperation(Token::Value::GT, reg, Strength::WEAK) | 102 .CompareOperation(Token::Value::GT, reg, Strength::WEAK) |
100 .CompareOperation(Token::Value::LTE, reg, Strength::WEAK) | 103 .CompareOperation(Token::Value::LTE, reg, Strength::WEAK) |
101 .CompareOperation(Token::Value::GTE, reg, Strength::WEAK) | 104 .CompareOperation(Token::Value::GTE, reg, Strength::WEAK) |
102 .CompareOperation(Token::Value::INSTANCEOF, reg, Strength::WEAK) | 105 .CompareOperation(Token::Value::INSTANCEOF, reg, Strength::WEAK) |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 | 478 |
476 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 479 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
477 iterator.Advance(); | 480 iterator.Advance(); |
478 CHECK(iterator.done()); | 481 CHECK(iterator.done()); |
479 } | 482 } |
480 | 483 |
481 | 484 |
482 } // namespace interpreter | 485 } // namespace interpreter |
483 } // namespace internal | 486 } // namespace internal |
484 } // namespace v8 | 487 } // namespace v8 |
OLD | NEW |