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 "test/unittests/test-utils.h" | 9 #include "test/unittests/test-utils.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 .LoadFalse(); | 37 .LoadFalse(); |
38 | 38 |
39 // Emit accumulator transfers. | 39 // Emit accumulator transfers. |
40 Register reg(0); | 40 Register reg(0); |
41 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); | 41 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); |
42 | 42 |
43 // Emit global load / store operations. | 43 // Emit global load / store operations. |
44 builder.LoadGlobal(1); | 44 builder.LoadGlobal(1); |
45 builder.StoreGlobal(1, LanguageMode::SLOPPY); | 45 builder.StoreGlobal(1, LanguageMode::SLOPPY); |
46 | 46 |
47 // Emit context load operations. | 47 // Emit context operations. |
| 48 builder.PushContext(reg); |
| 49 builder.PopContext(reg); |
48 builder.LoadContextSlot(reg, 1); | 50 builder.LoadContextSlot(reg, 1); |
49 | 51 |
50 // Emit load / store property operations. | 52 // Emit load / store property operations. |
51 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) | 53 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) |
52 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) | 54 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) |
53 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) | 55 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) |
54 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY) | 56 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY) |
55 .LoadNamedProperty(reg, 0, LanguageMode::STRICT) | 57 .LoadNamedProperty(reg, 0, LanguageMode::STRICT) |
56 .LoadKeyedProperty(reg, 0, LanguageMode::STRICT) | 58 .LoadKeyedProperty(reg, 0, LanguageMode::STRICT) |
57 .StoreNamedProperty(reg, reg, 0, LanguageMode::STRICT) | 59 .StoreNamedProperty(reg, reg, 0, LanguageMode::STRICT) |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 461 |
460 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 462 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
461 iterator.Advance(); | 463 iterator.Advance(); |
462 CHECK(iterator.done()); | 464 CHECK(iterator.done()); |
463 } | 465 } |
464 | 466 |
465 | 467 |
466 } // namespace interpreter | 468 } // namespace interpreter |
467 } // namespace internal | 469 } // namespace internal |
468 } // namespace v8 | 470 } // namespace v8 |
OLD | NEW |