| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Emit global load / store operations. | 79 // Emit global load / store operations. |
| 80 Handle<String> name = factory->NewStringFromStaticChars("var_name"); | 80 Handle<String> name = factory->NewStringFromStaticChars("var_name"); |
| 81 builder.LoadGlobal(name, 1, TypeofMode::NOT_INSIDE_TYPEOF) | 81 builder.LoadGlobal(name, 1, TypeofMode::NOT_INSIDE_TYPEOF) |
| 82 .LoadGlobal(name, 1, TypeofMode::INSIDE_TYPEOF) | 82 .LoadGlobal(name, 1, TypeofMode::INSIDE_TYPEOF) |
| 83 .StoreGlobal(name, 1, LanguageMode::SLOPPY) | 83 .StoreGlobal(name, 1, LanguageMode::SLOPPY) |
| 84 .StoreGlobal(name, 1, LanguageMode::STRICT); | 84 .StoreGlobal(name, 1, LanguageMode::STRICT); |
| 85 | 85 |
| 86 // Emit context operations. | 86 // Emit context operations. |
| 87 builder.PushContext(reg) | 87 builder.PushContext(reg) |
| 88 .PopContext(reg) | 88 .PopContext(reg) |
| 89 .LoadContextSlot(reg, 1, 0) | 89 .LoadContextSlot(reg, 1, 0, BytecodeArrayBuilder::kMutableSlot) |
| 90 .StoreContextSlot(reg, 1, 0); | 90 .StoreContextSlot(reg, 1, 0) |
| 91 .LoadContextSlot(reg, 2, 0, BytecodeArrayBuilder::kImmutableSlot) |
| 92 .StoreContextSlot(reg, 3, 0); |
| 91 | 93 |
| 92 // Emit context operations which operate on the local context. | 94 // Emit context operations which operate on the local context. |
| 93 builder.LoadContextSlot(Register::current_context(), 1, 0) | 95 builder |
| 94 .StoreContextSlot(Register::current_context(), 1, 0); | 96 .LoadContextSlot(Register::current_context(), 1, 0, |
| 97 BytecodeArrayBuilder::kMutableSlot) |
| 98 .StoreContextSlot(Register::current_context(), 1, 0) |
| 99 .LoadContextSlot(Register::current_context(), 2, 0, |
| 100 BytecodeArrayBuilder::kImmutableSlot) |
| 101 .StoreContextSlot(Register::current_context(), 3, 0); |
| 95 | 102 |
| 96 // Emit load / store property operations. | 103 // Emit load / store property operations. |
| 97 builder.LoadNamedProperty(reg, name, 0) | 104 builder.LoadNamedProperty(reg, name, 0) |
| 98 .LoadKeyedProperty(reg, 0) | 105 .LoadKeyedProperty(reg, 0) |
| 99 .StoreNamedProperty(reg, name, 0, LanguageMode::SLOPPY) | 106 .StoreNamedProperty(reg, name, 0, LanguageMode::SLOPPY) |
| 100 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY) | 107 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY) |
| 101 .StoreNamedProperty(reg, name, 0, LanguageMode::STRICT) | 108 .StoreNamedProperty(reg, name, 0, LanguageMode::STRICT) |
| 102 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); | 109 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); |
| 103 | 110 |
| 104 // Emit load / store lookup slots. | 111 // Emit load / store lookup slots. |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 .LoadKeyedProperty(reg, 2056) | 327 .LoadKeyedProperty(reg, 2056) |
| 321 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY) | 328 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY) |
| 322 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::SLOPPY) | 329 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::SLOPPY) |
| 323 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::STRICT) | 330 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::STRICT) |
| 324 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::STRICT); | 331 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::STRICT); |
| 325 | 332 |
| 326 builder.StoreDataPropertyInLiteral(reg, reg, | 333 builder.StoreDataPropertyInLiteral(reg, reg, |
| 327 DataPropertyInLiteralFlag::kNoFlags, 0); | 334 DataPropertyInLiteralFlag::kNoFlags, 0); |
| 328 | 335 |
| 329 // Emit wide context operations. | 336 // Emit wide context operations. |
| 330 builder.LoadContextSlot(reg, 1024, 0).StoreContextSlot(reg, 1024, 0); | 337 builder.LoadContextSlot(reg, 1024, 0, BytecodeArrayBuilder::kMutableSlot) |
| 338 .StoreContextSlot(reg, 1024, 0); |
| 331 | 339 |
| 332 // Emit wide load / store lookup slots. | 340 // Emit wide load / store lookup slots. |
| 333 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) | 341 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) |
| 334 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) | 342 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) |
| 335 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) | 343 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) |
| 336 .StoreLookupSlot(wide_name, LanguageMode::STRICT); | 344 .StoreLookupSlot(wide_name, LanguageMode::STRICT); |
| 337 | 345 |
| 338 // CreateClosureWide | 346 // CreateClosureWide |
| 339 builder.CreateClosure(1000, 321, NOT_TENURED); | 347 builder.CreateClosure(1000, 321, NOT_TENURED); |
| 340 | 348 |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 iterator.Advance(); | 764 iterator.Advance(); |
| 757 } | 765 } |
| 758 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 766 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
| 759 iterator.Advance(); | 767 iterator.Advance(); |
| 760 CHECK(iterator.done()); | 768 CHECK(iterator.done()); |
| 761 } | 769 } |
| 762 | 770 |
| 763 } // namespace interpreter | 771 } // namespace interpreter |
| 764 } // namespace internal | 772 } // namespace internal |
| 765 } // namespace v8 | 773 } // namespace v8 |
| OLD | NEW |