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