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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 // Emit closure operations. | 102 // Emit closure operations. |
103 builder.CreateClosure(0, NOT_TENURED); | 103 builder.CreateClosure(0, NOT_TENURED); |
104 | 104 |
105 // Emit create context operation. | 105 // Emit create context operation. |
106 builder.CreateFunctionContext(1); | 106 builder.CreateFunctionContext(1); |
107 | 107 |
108 // Emit literal creation operations. | 108 // Emit literal creation operations. |
109 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) | 109 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) |
110 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) | 110 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) |
111 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0); | 111 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0, reg); |
112 | 112 |
113 // Call operations. | 113 // Call operations. |
114 builder.Call(reg, other, 0, 1) | 114 builder.Call(reg, other, 0, 1) |
115 .Call(reg, wide, 0, 1) | 115 .Call(reg, wide, 0, 1) |
116 .TailCall(reg, other, 0, 1) | 116 .TailCall(reg, other, 0, 1) |
117 .TailCall(reg, wide, 0, 1) | 117 .TailCall(reg, wide, 0, 1) |
118 .CallRuntime(Runtime::kIsArray, reg, 1) | 118 .CallRuntime(Runtime::kIsArray, reg, 1) |
119 .CallRuntime(Runtime::kIsArray, wide, 1) | 119 .CallRuntime(Runtime::kIsArray, wide, 1) |
120 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg, 1, other) | 120 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg, 1, other) |
121 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, wide, 1, other) | 121 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, wide, 1, other) |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 .LoadUndefined() | 325 .LoadUndefined() |
326 .StoreAccumulatorInRegister(reg); | 326 .StoreAccumulatorInRegister(reg); |
327 | 327 |
328 // CreateClosureWide | 328 // CreateClosureWide |
329 builder.CreateClosure(1000, NOT_TENURED); | 329 builder.CreateClosure(1000, NOT_TENURED); |
330 | 330 |
331 // Emit wide variant of literal creation operations. | 331 // Emit wide variant of literal creation operations. |
332 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("wide_literal"), | 332 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("wide_literal"), |
333 0, 0) | 333 0, 0) |
334 .CreateArrayLiteral(factory->NewFixedArray(2), 0, 0) | 334 .CreateArrayLiteral(factory->NewFixedArray(2), 0, 0) |
335 .CreateObjectLiteral(factory->NewFixedArray(2), 0, 0); | 335 .CreateObjectLiteral(factory->NewFixedArray(2), 0, 0, reg); |
336 | 336 |
337 // Longer jumps requiring ConstantWide operand | 337 // Longer jumps requiring ConstantWide operand |
338 { | 338 { |
339 BytecodeLabel after_jump; | 339 BytecodeLabel after_jump; |
340 builder.Jump(&start) | 340 builder.Jump(&start) |
341 .Bind(&after_jump) | 341 .Bind(&after_jump) |
342 .JumpIfNull(&start) | 342 .JumpIfNull(&start) |
343 .JumpIfUndefined(&start) | 343 .JumpIfUndefined(&start) |
344 .JumpIfNotHole(&start); | 344 .JumpIfNotHole(&start); |
345 } | 345 } |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 iterator.Advance(); | 849 iterator.Advance(); |
850 } | 850 } |
851 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 851 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
852 iterator.Advance(); | 852 iterator.Advance(); |
853 CHECK(iterator.done()); | 853 CHECK(iterator.done()); |
854 } | 854 } |
855 | 855 |
856 } // namespace interpreter | 856 } // namespace interpreter |
857 } // namespace internal | 857 } // namespace internal |
858 } // namespace v8 | 858 } // namespace v8 |
OLD | NEW |