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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 .CreateArguments(CreateArgumentsType::kUnmappedArguments); | 96 .CreateArguments(CreateArgumentsType::kUnmappedArguments); |
97 | 97 |
98 // Emit literal creation operations. | 98 // Emit literal creation operations. |
99 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) | 99 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) |
100 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) | 100 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) |
101 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0); | 101 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0); |
102 | 102 |
103 // Call operations. | 103 // Call operations. |
104 builder.Call(reg, other, 1, 0) | 104 builder.Call(reg, other, 1, 0) |
105 .Call(reg, wide, 1, 0) | 105 .Call(reg, wide, 1, 0) |
106 .CallRuntime(Runtime::kIsArray, reg, 1) | 106 .CallRuntime(Runtime::kInlineIsArray, reg, 1) |
107 .CallRuntime(Runtime::kIsArray, wide, 1) | 107 .CallRuntime(Runtime::kIsStrong, reg, 1) |
| 108 .CallRuntime(Runtime::kIsStrong, wide, 1) |
108 .CallRuntimeForPair(Runtime::kLoadLookupSlot, reg, 1, other) | 109 .CallRuntimeForPair(Runtime::kLoadLookupSlot, reg, 1, other) |
109 .CallRuntimeForPair(Runtime::kLoadLookupSlot, wide, 1, other) | 110 .CallRuntimeForPair(Runtime::kLoadLookupSlot, wide, 1, other) |
110 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1) | 111 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1) |
111 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, wide, 1); | 112 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, wide, 1); |
112 | 113 |
113 // Emit binary operator invocations. | 114 // Emit binary operator invocations. |
114 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) | 115 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) |
115 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) | 116 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) |
116 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) | 117 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) |
117 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) | 118 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 iterator.Advance(); | 682 iterator.Advance(); |
682 } | 683 } |
683 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 684 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
684 iterator.Advance(); | 685 iterator.Advance(); |
685 CHECK(iterator.done()); | 686 CHECK(iterator.done()); |
686 } | 687 } |
687 | 688 |
688 } // namespace interpreter | 689 } // namespace interpreter |
689 } // namespace internal | 690 } // namespace internal |
690 } // namespace v8 | 691 } // namespace v8 |
OLD | NEW |