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