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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 // Emit load / store lookup slots with context fast paths. | 109 // Emit load / store lookup slots with context fast paths. |
110 builder.LoadLookupContextSlot(name, TypeofMode::NOT_INSIDE_TYPEOF, 1, 0) | 110 builder.LoadLookupContextSlot(name, TypeofMode::NOT_INSIDE_TYPEOF, 1, 0) |
111 .LoadLookupContextSlot(name, TypeofMode::INSIDE_TYPEOF, 1, 0); | 111 .LoadLookupContextSlot(name, TypeofMode::INSIDE_TYPEOF, 1, 0); |
112 | 112 |
113 // Emit load / store lookup slots with global fast paths. | 113 // Emit load / store lookup slots with global fast paths. |
114 builder.LoadLookupGlobalSlot(name, TypeofMode::NOT_INSIDE_TYPEOF, 1, 0) | 114 builder.LoadLookupGlobalSlot(name, TypeofMode::NOT_INSIDE_TYPEOF, 1, 0) |
115 .LoadLookupGlobalSlot(name, TypeofMode::INSIDE_TYPEOF, 1, 0); | 115 .LoadLookupGlobalSlot(name, TypeofMode::INSIDE_TYPEOF, 1, 0); |
116 | 116 |
117 // Emit closure operations. | 117 // Emit closure operations. |
118 builder.CreateClosure(0, 1, NOT_TENURED); | 118 builder.CreateClosure(0, NOT_TENURED); |
119 | 119 |
120 // Emit create context operation. | 120 // Emit create context operation. |
121 builder.CreateBlockContext(factory->NewScopeInfo(1)); | 121 builder.CreateBlockContext(factory->NewScopeInfo(1)); |
122 builder.CreateCatchContext(reg, name, factory->NewScopeInfo(1)); | 122 builder.CreateCatchContext(reg, name, factory->NewScopeInfo(1)); |
123 builder.CreateFunctionContext(1); | 123 builder.CreateFunctionContext(1); |
124 builder.CreateEvalContext(1); | 124 builder.CreateEvalContext(1); |
125 builder.CreateWithContext(reg, factory->NewScopeInfo(1)); | 125 builder.CreateWithContext(reg, factory->NewScopeInfo(1)); |
126 | 126 |
127 // Emit literal creation operations. | 127 // Emit literal creation operations. |
128 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) | 128 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // Emit wide context operations. | 330 // Emit wide context operations. |
331 builder.LoadContextSlot(reg, 1024, 0).StoreContextSlot(reg, 1024, 0); | 331 builder.LoadContextSlot(reg, 1024, 0).StoreContextSlot(reg, 1024, 0); |
332 | 332 |
333 // Emit wide load / store lookup slots. | 333 // Emit wide load / store lookup slots. |
334 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) | 334 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) |
335 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) | 335 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) |
336 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) | 336 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) |
337 .StoreLookupSlot(wide_name, LanguageMode::STRICT); | 337 .StoreLookupSlot(wide_name, LanguageMode::STRICT); |
338 | 338 |
339 // CreateClosureWide | 339 // CreateClosureWide |
340 builder.CreateClosure(1000, 321, NOT_TENURED); | 340 builder.CreateClosure(1000, NOT_TENURED); |
341 | 341 |
342 // Emit wide variant of literal creation operations. | 342 // Emit wide variant of literal creation operations. |
343 builder | 343 builder |
344 .CreateRegExpLiteral(factory->NewStringFromStaticChars("wide_literal"), 0, | 344 .CreateRegExpLiteral(factory->NewStringFromStaticChars("wide_literal"), 0, |
345 0) | 345 0) |
346 .CreateArrayLiteral(factory->NewConstantElementsPair( | 346 .CreateArrayLiteral(factory->NewConstantElementsPair( |
347 FAST_ELEMENTS, factory->empty_fixed_array()), | 347 FAST_ELEMENTS, factory->empty_fixed_array()), |
348 0, 0) | 348 0, 0) |
349 .CreateObjectLiteral(factory->NewFixedArray(2), 0, 0, reg); | 349 .CreateObjectLiteral(factory->NewFixedArray(2), 0, 0, reg); |
350 | 350 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 iterator.Advance(); | 759 iterator.Advance(); |
760 } | 760 } |
761 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 761 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
762 iterator.Advance(); | 762 iterator.Advance(); |
763 CHECK(iterator.done()); | 763 CHECK(iterator.done()); |
764 } | 764 } |
765 | 765 |
766 } // namespace interpreter | 766 } // namespace interpreter |
767 } // namespace internal | 767 } // namespace internal |
768 } // namespace v8 | 768 } // namespace v8 |
OLD | NEW |