| 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 "test/unittests/test-utils.h" | 8 #include "test/unittests/test-utils.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 .LoadUndefined() | 32 .LoadUndefined() |
| 33 .LoadNull() | 33 .LoadNull() |
| 34 .LoadTheHole() | 34 .LoadTheHole() |
| 35 .LoadTrue() | 35 .LoadTrue() |
| 36 .LoadFalse(); | 36 .LoadFalse(); |
| 37 | 37 |
| 38 // Emit accumulator transfers. | 38 // Emit accumulator transfers. |
| 39 Register reg(0); | 39 Register reg(0); |
| 40 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); | 40 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); |
| 41 | 41 |
| 42 // Emit global load operations. |
| 43 builder.LoadGlobal(1); |
| 44 |
| 42 // Emit load / store property operations. | 45 // Emit load / store property operations. |
| 43 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) | 46 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) |
| 44 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) | 47 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) |
| 45 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) | 48 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) |
| 46 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY); | 49 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY); |
| 47 | 50 |
| 48 // Call operations. | 51 // Call operations. |
| 49 builder.Call(reg, reg, 0); | 52 builder.Call(reg, reg, 0); |
| 50 | 53 |
| 51 // Emit binary operators invocations. | 54 // Emit binary operators invocations. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 .LoadLiteral(heap_num_2_copy); | 179 .LoadLiteral(heap_num_2_copy); |
| 177 | 180 |
| 178 Handle<BytecodeArray> array = builder.ToBytecodeArray(); | 181 Handle<BytecodeArray> array = builder.ToBytecodeArray(); |
| 179 // Should only have one entry for each identical constant. | 182 // Should only have one entry for each identical constant. |
| 180 CHECK_EQ(array->constant_pool()->length(), 3); | 183 CHECK_EQ(array->constant_pool()->length(), 3); |
| 181 } | 184 } |
| 182 | 185 |
| 183 } // namespace interpreter | 186 } // namespace interpreter |
| 184 } // namespace internal | 187 } // namespace internal |
| 185 } // namespace v8 | 188 } // namespace v8 |
| OLD | NEW |