| 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 "src/interpreter/bytecode-label.h" | 9 #include "src/interpreter/bytecode-label.h" |
| 10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 builder.CreateCatchContext(reg, name, factory->NewScopeInfo(1)); | 118 builder.CreateCatchContext(reg, name, factory->NewScopeInfo(1)); |
| 119 builder.CreateFunctionContext(1); | 119 builder.CreateFunctionContext(1); |
| 120 builder.CreateWithContext(reg, factory->NewScopeInfo(1)); | 120 builder.CreateWithContext(reg, factory->NewScopeInfo(1)); |
| 121 | 121 |
| 122 // Emit literal creation operations. | 122 // Emit literal creation operations. |
| 123 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) | 123 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) |
| 124 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) | 124 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) |
| 125 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0, reg); | 125 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0, reg); |
| 126 | 126 |
| 127 // Call operations. | 127 // Call operations. |
| 128 builder.Call(reg, reg_list, 1) | 128 builder.Call(reg, reg_list, 1, Call::GLOBAL_CALL) |
| 129 .Call(reg, reg_list, 1, TailCallMode::kAllow) | 129 .Call(reg, reg_list, 1, Call::NAMED_PROPERTY_CALL, |
| 130 TailCallMode::kDisallow) |
| 131 .Call(reg, reg_list, 1, Call::GLOBAL_CALL, TailCallMode::kAllow) |
| 130 .CallRuntime(Runtime::kIsArray, reg) | 132 .CallRuntime(Runtime::kIsArray, reg) |
| 131 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg_list, pair) | 133 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg_list, pair) |
| 132 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg_list); | 134 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg_list); |
| 133 | 135 |
| 134 // Emit binary operator invocations. | 136 // Emit binary operator invocations. |
| 135 builder.BinaryOperation(Token::Value::ADD, reg, 1) | 137 builder.BinaryOperation(Token::Value::ADD, reg, 1) |
| 136 .BinaryOperation(Token::Value::SUB, reg, 2) | 138 .BinaryOperation(Token::Value::SUB, reg, 2) |
| 137 .BinaryOperation(Token::Value::MUL, reg, 3) | 139 .BinaryOperation(Token::Value::MUL, reg, 3) |
| 138 .BinaryOperation(Token::Value::DIV, reg, 4) | 140 .BinaryOperation(Token::Value::DIV, reg, 4) |
| 139 .BinaryOperation(Token::Value::MOD, reg, 5); | 141 .BinaryOperation(Token::Value::MOD, reg, 5); |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 iterator.Advance(); | 731 iterator.Advance(); |
| 730 } | 732 } |
| 731 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 733 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
| 732 iterator.Advance(); | 734 iterator.Advance(); |
| 733 CHECK(iterator.done()); | 735 CHECK(iterator.done()); |
| 734 } | 736 } |
| 735 | 737 |
| 736 } // namespace interpreter | 738 } // namespace interpreter |
| 737 } // namespace internal | 739 } // namespace internal |
| 738 } // namespace v8 | 740 } // namespace v8 |
| OLD | NEW |