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 25 matching lines...) Expand all Loading... |
36 .LoadUndefined() | 36 .LoadUndefined() |
37 .LoadNull() | 37 .LoadNull() |
38 .LoadTheHole() | 38 .LoadTheHole() |
39 .LoadTrue() | 39 .LoadTrue() |
40 .LoadFalse(); | 40 .LoadFalse(); |
41 | 41 |
42 // Emit accumulator transfers. | 42 // Emit accumulator transfers. |
43 Register reg(0); | 43 Register reg(0); |
44 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); | 44 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); |
45 | 45 |
46 // Emit global load / store operations. | |
47 builder.LoadGlobal(1) | |
48 .StoreGlobal(1, LanguageMode::SLOPPY) | |
49 .StoreGlobal(1, LanguageMode::STRICT); | |
50 | |
51 // Emit context operations. | 46 // Emit context operations. |
52 builder.PushContext(reg); | 47 builder.PushContext(reg); |
53 builder.PopContext(reg); | 48 builder.PopContext(reg); |
54 builder.LoadContextSlot(reg, 1); | 49 builder.LoadContextSlot(reg, 1); |
55 builder.StoreContextSlot(reg, 1); | 50 builder.StoreContextSlot(reg, 1); |
56 | 51 |
57 // Emit load / store property operations. | 52 // Emit load / store property operations. |
58 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) | 53 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) |
59 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) | 54 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) |
60 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) | 55 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 522 |
528 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 523 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
529 iterator.Advance(); | 524 iterator.Advance(); |
530 CHECK(iterator.done()); | 525 CHECK(iterator.done()); |
531 } | 526 } |
532 | 527 |
533 | 528 |
534 } // namespace interpreter | 529 } // namespace interpreter |
535 } // namespace internal | 530 } // namespace internal |
536 } // namespace v8 | 531 } // namespace v8 |
OLD | NEW |