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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 factory->NewStringFromStaticChars("function_a"), MaybeHandle<Code>(), | 87 factory->NewStringFromStaticChars("function_a"), MaybeHandle<Code>(), |
88 false); | 88 false); |
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) |
98 .Call(reg, wide, 1, 0) | 98 .Call(reg, wide, 1) |
99 .TailCall(reg, other, 1, 0) | 99 .TailCall(reg, other, 1) |
100 .TailCall(reg, wide, 1, 0) | 100 .TailCall(reg, wide, 1) |
| 101 .CallIC(reg, other, 1, 0, TailCallMode::kDisallow) |
| 102 .CallIC(reg, other, 1, 0, TailCallMode::kAllow) |
| 103 .CallIC(reg, wide, 1, 0, TailCallMode::kDisallow) |
| 104 .CallIC(reg, wide, 1, 0, TailCallMode::kAllow) |
101 .CallRuntime(Runtime::kIsArray, reg, 1) | 105 .CallRuntime(Runtime::kIsArray, reg, 1) |
102 .CallRuntime(Runtime::kIsArray, wide, 1) | 106 .CallRuntime(Runtime::kIsArray, wide, 1) |
103 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg, 1, other) | 107 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg, 1, other) |
104 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, wide, 1, other) | 108 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, wide, 1, other) |
105 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1) | 109 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1) |
106 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, wide, 1); | 110 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, wide, 1); |
107 | 111 |
108 // Emit binary operator invocations. | 112 // Emit binary operator invocations. |
109 builder.BinaryOperation(Token::Value::ADD, reg) | 113 builder.BinaryOperation(Token::Value::ADD, reg) |
110 .BinaryOperation(Token::Value::SUB, reg) | 114 .BinaryOperation(Token::Value::SUB, reg) |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 iterator.Advance(); | 650 iterator.Advance(); |
647 } | 651 } |
648 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 652 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
649 iterator.Advance(); | 653 iterator.Advance(); |
650 CHECK(iterator.done()); | 654 CHECK(iterator.done()); |
651 } | 655 } |
652 | 656 |
653 } // namespace interpreter | 657 } // namespace interpreter |
654 } // namespace internal | 658 } // namespace internal |
655 } // namespace v8 | 659 } // namespace v8 |
OLD | NEW |