| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 builder.LoadGlobal(1); | 44 builder.LoadGlobal(1); |
| 45 | 45 |
| 46 // Emit load / store property operations. | 46 // Emit load / store property operations. |
| 47 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) | 47 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) |
| 48 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) | 48 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) |
| 49 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) | 49 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) |
| 50 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY); | 50 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY); |
| 51 | 51 |
| 52 // Call operations. | 52 // Call operations. |
| 53 builder.Call(reg, reg, 0); | 53 builder.Call(reg, reg, 0); |
| 54 builder.CallRuntime(Runtime::kIsArray, reg, 1); |
| 54 | 55 |
| 55 // Emit binary operator invocations. | 56 // Emit binary operator invocations. |
| 56 builder.BinaryOperation(Token::Value::ADD, reg) | 57 builder.BinaryOperation(Token::Value::ADD, reg) |
| 57 .BinaryOperation(Token::Value::SUB, reg) | 58 .BinaryOperation(Token::Value::SUB, reg) |
| 58 .BinaryOperation(Token::Value::MUL, reg) | 59 .BinaryOperation(Token::Value::MUL, reg) |
| 59 .BinaryOperation(Token::Value::DIV, reg) | 60 .BinaryOperation(Token::Value::DIV, reg) |
| 60 .BinaryOperation(Token::Value::MOD, reg); | 61 .BinaryOperation(Token::Value::MOD, reg); |
| 61 | 62 |
| 62 // Emit test operator invocations. | 63 // Emit test operator invocations. |
| 63 builder.CompareOperation(Token::Value::EQ, reg, LanguageMode::SLOPPY) | 64 builder.CompareOperation(Token::Value::EQ, reg, LanguageMode::SLOPPY) |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 | 435 |
| 435 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 436 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
| 436 iterator.Advance(); | 437 iterator.Advance(); |
| 437 CHECK(iterator.done()); | 438 CHECK(iterator.done()); |
| 438 } | 439 } |
| 439 | 440 |
| 440 | 441 |
| 441 } // namespace interpreter | 442 } // namespace interpreter |
| 442 } // namespace internal | 443 } // namespace internal |
| 443 } // namespace v8 | 444 } // namespace v8 |
| OLD | NEW |