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-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "test/unittests/test-utils.h" | 10 #include "test/unittests/test-utils.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 builder.CreateClosure(shared_info, NOT_TENURED); | 89 builder.CreateClosure(shared_info, NOT_TENURED); |
90 | 90 |
91 // Emit literal creation operations. | 91 // Emit literal creation operations. |
92 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) | 92 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) |
93 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) | 93 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) |
94 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0); | 94 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0); |
95 | 95 |
96 // Call operations. | 96 // Call operations. |
97 builder.Call(reg, other, 1, 0) | 97 builder.Call(reg, other, 1, 0) |
98 .Call(reg, wide, 1, 0) | 98 .Call(reg, wide, 1, 0) |
| 99 .TailCall(reg, other, 1, 0) |
| 100 .TailCall(reg, wide, 1, 0) |
99 .CallRuntime(Runtime::kIsArray, reg, 1) | 101 .CallRuntime(Runtime::kIsArray, reg, 1) |
100 .CallRuntime(Runtime::kIsArray, wide, 1) | 102 .CallRuntime(Runtime::kIsArray, wide, 1) |
101 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg, 1, other) | 103 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg, 1, other) |
102 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, wide, 1, other) | 104 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, wide, 1, other) |
103 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1) | 105 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1) |
104 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, wide, 1); | 106 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, wide, 1); |
105 | 107 |
106 // Emit binary operator invocations. | 108 // Emit binary operator invocations. |
107 builder.BinaryOperation(Token::Value::ADD, reg) | 109 builder.BinaryOperation(Token::Value::ADD, reg) |
108 .BinaryOperation(Token::Value::SUB, reg) | 110 .BinaryOperation(Token::Value::SUB, reg) |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 iterator.Advance(); | 646 iterator.Advance(); |
645 } | 647 } |
646 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 648 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
647 iterator.Advance(); | 649 iterator.Advance(); |
648 CHECK(iterator.done()); | 650 CHECK(iterator.done()); |
649 } | 651 } |
650 | 652 |
651 } // namespace interpreter | 653 } // namespace interpreter |
652 } // namespace internal | 654 } // namespace internal |
653 } // namespace v8 | 655 } // namespace v8 |
OLD | NEW |