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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Emit global load / store operations. | 76 // Emit global load / store operations. |
77 Handle<String> name = factory->NewStringFromStaticChars("var_name"); | 77 Handle<String> name = factory->NewStringFromStaticChars("var_name"); |
78 builder.LoadGlobal(1, TypeofMode::NOT_INSIDE_TYPEOF) | 78 builder.LoadGlobal(1, TypeofMode::NOT_INSIDE_TYPEOF) |
79 .LoadGlobal(1, TypeofMode::INSIDE_TYPEOF) | 79 .LoadGlobal(1, TypeofMode::INSIDE_TYPEOF) |
80 .StoreGlobal(name, 1, LanguageMode::SLOPPY) | 80 .StoreGlobal(name, 1, LanguageMode::SLOPPY) |
81 .StoreGlobal(name, 1, LanguageMode::STRICT); | 81 .StoreGlobal(name, 1, LanguageMode::STRICT); |
82 | 82 |
83 // Emit context operations. | 83 // Emit context operations. |
84 builder.PushContext(reg) | 84 builder.PushContext(reg) |
85 .PopContext(reg) | 85 .PopContext(reg) |
86 .LoadContextSlot(reg, 1) | 86 .LoadContextSlot(reg, 1, 0) |
87 .StoreContextSlot(reg, 1); | 87 .StoreContextSlot(reg, 1, 0); |
88 | 88 |
89 // Emit load / store property operations. | 89 // Emit load / store property operations. |
90 builder.LoadNamedProperty(reg, name, 0) | 90 builder.LoadNamedProperty(reg, name, 0) |
91 .LoadKeyedProperty(reg, 0) | 91 .LoadKeyedProperty(reg, 0) |
92 .StoreNamedProperty(reg, name, 0, LanguageMode::SLOPPY) | 92 .StoreNamedProperty(reg, name, 0, LanguageMode::SLOPPY) |
93 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY) | 93 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY) |
94 .StoreNamedProperty(reg, name, 0, LanguageMode::STRICT) | 94 .StoreNamedProperty(reg, name, 0, LanguageMode::STRICT) |
95 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); | 95 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); |
96 | 96 |
97 // Emit load / store lookup slots. | 97 // Emit load / store lookup slots. |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 // Emit wide load / store property operations. | 303 // Emit wide load / store property operations. |
304 builder.LoadNamedProperty(reg, wide_name, 0) | 304 builder.LoadNamedProperty(reg, wide_name, 0) |
305 .LoadKeyedProperty(reg, 2056) | 305 .LoadKeyedProperty(reg, 2056) |
306 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY) | 306 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY) |
307 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::SLOPPY) | 307 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::SLOPPY) |
308 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::STRICT) | 308 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::STRICT) |
309 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::STRICT); | 309 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::STRICT); |
310 | 310 |
311 // Emit wide context operations. | 311 // Emit wide context operations. |
312 builder.LoadContextSlot(reg, 1024).StoreContextSlot(reg, 1024); | 312 builder.LoadContextSlot(reg, 1024, 0).StoreContextSlot(reg, 1024, 0); |
313 | 313 |
314 // Emit wide load / store lookup slots. | 314 // Emit wide load / store lookup slots. |
315 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) | 315 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) |
316 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) | 316 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) |
317 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) | 317 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) |
318 .StoreLookupSlot(wide_name, LanguageMode::STRICT); | 318 .StoreLookupSlot(wide_name, LanguageMode::STRICT); |
319 | 319 |
320 // Emit loads which will be transformed to Ldr equivalents by the peephole | 320 // Emit loads which will be transformed to Ldr equivalents by the peephole |
321 // optimizer. | 321 // optimizer. |
322 builder.LoadNamedProperty(reg, name, 0) | 322 builder.LoadNamedProperty(reg, name, 0) |
323 .StoreAccumulatorInRegister(reg) | 323 .StoreAccumulatorInRegister(reg) |
324 .LoadKeyedProperty(reg, 0) | 324 .LoadKeyedProperty(reg, 0) |
325 .StoreAccumulatorInRegister(reg) | 325 .StoreAccumulatorInRegister(reg) |
326 .LoadContextSlot(reg, 1) | 326 .LoadContextSlot(reg, 1, 0) |
327 .StoreAccumulatorInRegister(reg) | 327 .StoreAccumulatorInRegister(reg) |
328 .LoadGlobal(0, TypeofMode::NOT_INSIDE_TYPEOF) | 328 .LoadGlobal(0, TypeofMode::NOT_INSIDE_TYPEOF) |
329 .StoreAccumulatorInRegister(reg) | 329 .StoreAccumulatorInRegister(reg) |
330 .LoadUndefined() | 330 .LoadUndefined() |
331 .StoreAccumulatorInRegister(reg); | 331 .StoreAccumulatorInRegister(reg); |
332 | 332 |
333 // CreateClosureWide | 333 // CreateClosureWide |
334 builder.CreateClosure(1000, NOT_TENURED); | 334 builder.CreateClosure(1000, NOT_TENURED); |
335 | 335 |
336 // Emit wide variant of literal creation operations. | 336 // Emit wide variant of literal creation operations. |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 iterator.Advance(); | 855 iterator.Advance(); |
856 } | 856 } |
857 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 857 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
858 iterator.Advance(); | 858 iterator.Advance(); |
859 CHECK(iterator.done()); | 859 CHECK(iterator.done()); |
860 } | 860 } |
861 | 861 |
862 } // namespace interpreter | 862 } // namespace interpreter |
863 } // namespace internal | 863 } // namespace internal |
864 } // namespace v8 | 864 } // namespace v8 |
OLD | NEW |