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-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "test/unittests/test-utils.h" | 10 #include "test/unittests/test-utils.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 Register wide(128); | 48 Register wide(128); |
49 | 49 |
50 builder.LoadAccumulatorWithRegister(reg) | 50 builder.LoadAccumulatorWithRegister(reg) |
51 .LoadNull() | 51 .LoadNull() |
52 .StoreAccumulatorInRegister(reg); | 52 .StoreAccumulatorInRegister(reg); |
53 | 53 |
54 // Emit register-register transfer. | 54 // Emit register-register transfer. |
55 builder.MoveRegister(reg, other); | 55 builder.MoveRegister(reg, other); |
56 builder.MoveRegister(reg, wide); | 56 builder.MoveRegister(reg, wide); |
57 | 57 |
| 58 // Prototype info for classes. |
| 59 builder.LoadPrototypeOrInitialMap(); |
| 60 |
58 // Emit global load / store operations. | 61 // Emit global load / store operations. |
59 Factory* factory = isolate()->factory(); | 62 Factory* factory = isolate()->factory(); |
60 Handle<String> name = factory->NewStringFromStaticChars("var_name"); | 63 Handle<String> name = factory->NewStringFromStaticChars("var_name"); |
61 builder.LoadGlobal(name, 1, LanguageMode::SLOPPY, | 64 builder.LoadGlobal(name, 1, LanguageMode::SLOPPY, |
62 TypeofMode::NOT_INSIDE_TYPEOF) | 65 TypeofMode::NOT_INSIDE_TYPEOF) |
63 .LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::NOT_INSIDE_TYPEOF) | 66 .LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::NOT_INSIDE_TYPEOF) |
64 .LoadGlobal(name, 1, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF) | 67 .LoadGlobal(name, 1, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF) |
65 .LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF) | 68 .LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF) |
66 .StoreGlobal(name, 1, LanguageMode::SLOPPY) | 69 .StoreGlobal(name, 1, LanguageMode::SLOPPY) |
67 .StoreGlobal(name, 1, LanguageMode::STRICT); | 70 .StoreGlobal(name, 1, LanguageMode::STRICT); |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 iterator.Advance(); | 659 iterator.Advance(); |
657 } | 660 } |
658 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 661 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
659 iterator.Advance(); | 662 iterator.Advance(); |
660 CHECK(iterator.done()); | 663 CHECK(iterator.done()); |
661 } | 664 } |
662 | 665 |
663 } // namespace interpreter | 666 } // namespace interpreter |
664 } // namespace internal | 667 } // namespace internal |
665 } // namespace v8 | 668 } // namespace v8 |
OLD | NEW |