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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 builder.CreateClosure(0, 1, NOT_TENURED); | 119 builder.CreateClosure(0, 1, NOT_TENURED); |
120 | 120 |
121 // Emit create context operation. | 121 // Emit create context operation. |
122 builder.CreateBlockContext(factory->NewScopeInfo(1)); | 122 builder.CreateBlockContext(factory->NewScopeInfo(1)); |
123 builder.CreateCatchContext(reg, name, factory->NewScopeInfo(1)); | 123 builder.CreateCatchContext(reg, name, factory->NewScopeInfo(1)); |
124 builder.CreateFunctionContext(1); | 124 builder.CreateFunctionContext(1); |
125 builder.CreateEvalContext(1); | 125 builder.CreateEvalContext(1); |
126 builder.CreateWithContext(reg, factory->NewScopeInfo(1)); | 126 builder.CreateWithContext(reg, factory->NewScopeInfo(1)); |
127 | 127 |
128 // Emit literal creation operations. | 128 // Emit literal creation operations. |
129 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) | 129 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0); |
130 .CreateArrayLiteral(factory->NewConstantElementsPair( | 130 builder.CreateArrayLiteral(0, 0, 0); |
131 FAST_ELEMENTS, factory->empty_fixed_array()), | 131 builder.CreateObjectLiteral(0, 0, 0, reg); |
132 0, 0) | |
133 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0, reg); | |
134 | 132 |
135 // Call operations. | 133 // Call operations. |
136 builder.Call(reg, reg_list, 1, Call::GLOBAL_CALL) | 134 builder.Call(reg, reg_list, 1, Call::GLOBAL_CALL) |
137 .Call(reg, reg_list, 1, Call::NAMED_PROPERTY_CALL, | 135 .Call(reg, reg_list, 1, Call::NAMED_PROPERTY_CALL, |
138 TailCallMode::kDisallow) | 136 TailCallMode::kDisallow) |
139 .Call(reg, reg_list, 1, Call::GLOBAL_CALL, TailCallMode::kAllow) | 137 .Call(reg, reg_list, 1, Call::GLOBAL_CALL, TailCallMode::kAllow) |
140 .CallRuntime(Runtime::kIsArray, reg) | 138 .CallRuntime(Runtime::kIsArray, reg) |
141 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg_list, pair) | 139 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg_list, pair) |
142 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg_list) | 140 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg_list) |
143 .NewWithSpread(reg_list); | 141 .NewWithSpread(reg_list); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) | 335 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) |
338 .StoreLookupSlot(wide_name, LanguageMode::STRICT); | 336 .StoreLookupSlot(wide_name, LanguageMode::STRICT); |
339 | 337 |
340 // CreateClosureWide | 338 // CreateClosureWide |
341 builder.CreateClosure(1000, 321, NOT_TENURED); | 339 builder.CreateClosure(1000, 321, NOT_TENURED); |
342 | 340 |
343 // Emit wide variant of literal creation operations. | 341 // Emit wide variant of literal creation operations. |
344 builder | 342 builder |
345 .CreateRegExpLiteral(factory->NewStringFromStaticChars("wide_literal"), 0, | 343 .CreateRegExpLiteral(factory->NewStringFromStaticChars("wide_literal"), 0, |
346 0) | 344 0) |
347 .CreateArrayLiteral(factory->NewConstantElementsPair( | 345 .CreateArrayLiteral(0, 0, 0) |
348 FAST_ELEMENTS, factory->empty_fixed_array()), | 346 .CreateObjectLiteral(0, 0, 0, reg); |
349 0, 0) | |
350 .CreateObjectLiteral(factory->NewFixedArray(2), 0, 0, reg); | |
351 | 347 |
352 // Emit load and store operations for module variables. | 348 // Emit load and store operations for module variables. |
353 builder.LoadModuleVariable(-1, 42) | 349 builder.LoadModuleVariable(-1, 42) |
354 .LoadModuleVariable(0, 42) | 350 .LoadModuleVariable(0, 42) |
355 .LoadModuleVariable(1, 42) | 351 .LoadModuleVariable(1, 42) |
356 .StoreModuleVariable(-1, 42) | 352 .StoreModuleVariable(-1, 42) |
357 .StoreModuleVariable(0, 42) | 353 .StoreModuleVariable(0, 42) |
358 .StoreModuleVariable(1, 42); | 354 .StoreModuleVariable(1, 42); |
359 | 355 |
360 // Emit generator operations. | 356 // Emit generator operations. |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 iterator.Advance(); | 756 iterator.Advance(); |
761 } | 757 } |
762 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 758 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
763 iterator.Advance(); | 759 iterator.Advance(); |
764 CHECK(iterator.done()); | 760 CHECK(iterator.done()); |
765 } | 761 } |
766 | 762 |
767 } // namespace interpreter | 763 } // namespace interpreter |
768 } // namespace internal | 764 } // namespace internal |
769 } // namespace v8 | 765 } // namespace v8 |
OLD | NEW |