| 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, NOT_TENURED); | 118 builder.CreateClosure(0, 1, 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.CreateWithContext(reg, factory->NewScopeInfo(1)); | 124 builder.CreateWithContext(reg, factory->NewScopeInfo(1)); |
| 125 | 125 |
| 126 // Emit literal creation operations. | 126 // Emit literal creation operations. |
| 127 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) | 127 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) |
| 128 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) | 128 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 // Emit wide context operations. | 319 // Emit wide context operations. |
| 320 builder.LoadContextSlot(reg, 1024, 0).StoreContextSlot(reg, 1024, 0); | 320 builder.LoadContextSlot(reg, 1024, 0).StoreContextSlot(reg, 1024, 0); |
| 321 | 321 |
| 322 // Emit wide load / store lookup slots. | 322 // Emit wide load / store lookup slots. |
| 323 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) | 323 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) |
| 324 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) | 324 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) |
| 325 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) | 325 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) |
| 326 .StoreLookupSlot(wide_name, LanguageMode::STRICT); | 326 .StoreLookupSlot(wide_name, LanguageMode::STRICT); |
| 327 | 327 |
| 328 // CreateClosureWide | 328 // CreateClosureWide |
| 329 builder.CreateClosure(1000, NOT_TENURED); | 329 builder.CreateClosure(1000, 321, 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, reg); | 335 .CreateObjectLiteral(factory->NewFixedArray(2), 0, 0, reg); |
| 336 | 336 |
| 337 // Emit load and store operations for module variables. | 337 // Emit load and store operations for module variables. |
| 338 builder.LoadModuleVariable(-1, 42) | 338 builder.LoadModuleVariable(-1, 42) |
| 339 .LoadModuleVariable(0, 42) | 339 .LoadModuleVariable(0, 42) |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 iterator.Advance(); | 743 iterator.Advance(); |
| 744 } | 744 } |
| 745 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 745 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
| 746 iterator.Advance(); | 746 iterator.Advance(); |
| 747 CHECK(iterator.done()); | 747 CHECK(iterator.done()); |
| 748 } | 748 } |
| 749 | 749 |
| 750 } // namespace interpreter | 750 } // namespace interpreter |
| 751 } // namespace internal | 751 } // namespace internal |
| 752 } // namespace v8 | 752 } // namespace v8 |
| OLD | NEW |