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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Emit argument creation operations. | 87 // Emit argument creation operations. |
88 builder.CreateArguments(CreateArgumentsType::kMappedArguments) | 88 builder.CreateArguments(CreateArgumentsType::kMappedArguments) |
89 .CreateArguments(CreateArgumentsType::kUnmappedArguments); | 89 .CreateArguments(CreateArgumentsType::kUnmappedArguments); |
90 | 90 |
91 // Emit literal creation operations | 91 // Emit literal creation operations |
92 builder.CreateRegExpLiteral(0, reg) | 92 builder.CreateRegExpLiteral(0, reg) |
93 .CreateArrayLiteral(0, 0) | 93 .CreateArrayLiteral(0, 0) |
94 .CreateObjectLiteral(0, 0); | 94 .CreateObjectLiteral(0, 0); |
95 | 95 |
96 // Call operations. | 96 // Call operations. |
97 builder.Call(reg, reg, 0); | 97 builder.Call(reg, reg, 0) |
98 builder.CallRuntime(Runtime::kIsArray, reg, 1); | 98 .CallRuntime(Runtime::kIsArray, reg, 1) |
| 99 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1); |
99 | 100 |
100 // Emit binary operator invocations. | 101 // Emit binary operator invocations. |
101 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) | 102 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) |
102 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) | 103 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) |
103 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) | 104 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) |
104 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) | 105 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) |
105 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK); | 106 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK); |
106 | 107 |
107 // Emit bitwise operator invocations | 108 // Emit bitwise operator invocations |
108 builder.BinaryOperation(Token::Value::BIT_OR, reg, Strength::WEAK) | 109 builder.BinaryOperation(Token::Value::BIT_OR, reg, Strength::WEAK) |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 | 677 |
677 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 678 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
678 iterator.Advance(); | 679 iterator.Advance(); |
679 CHECK(iterator.done()); | 680 CHECK(iterator.done()); |
680 } | 681 } |
681 | 682 |
682 | 683 |
683 } // namespace interpreter | 684 } // namespace interpreter |
684 } // namespace internal | 685 } // namespace internal |
685 } // namespace v8 | 686 } // namespace v8 |
OLD | NEW |