OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // Stores the object in the accumulator into |slot_index| of |context|. | 94 // Stores the object in the accumulator into |slot_index| of |context|. |
95 BytecodeArrayBuilder& StoreContextSlot(Register context, int slot_index); | 95 BytecodeArrayBuilder& StoreContextSlot(Register context, int slot_index); |
96 | 96 |
97 // Register-accumulator transfers. | 97 // Register-accumulator transfers. |
98 BytecodeArrayBuilder& LoadAccumulatorWithRegister(Register reg); | 98 BytecodeArrayBuilder& LoadAccumulatorWithRegister(Register reg); |
99 BytecodeArrayBuilder& StoreAccumulatorInRegister(Register reg); | 99 BytecodeArrayBuilder& StoreAccumulatorInRegister(Register reg); |
100 | 100 |
101 // Register-register transfer. | 101 // Register-register transfer. |
102 BytecodeArrayBuilder& MoveRegister(Register from, Register to); | 102 BytecodeArrayBuilder& MoveRegister(Register from, Register to); |
| 103 BytecodeArrayBuilder& ExchangeRegisters(Register reg0, Register reg1); |
103 | 104 |
104 // Named load property. | 105 // Named load property. |
105 BytecodeArrayBuilder& LoadNamedProperty(Register object, | 106 BytecodeArrayBuilder& LoadNamedProperty(Register object, |
106 const Handle<String> name, | 107 const Handle<String> name, |
107 int feedback_slot, | 108 int feedback_slot, |
108 LanguageMode language_mode); | 109 LanguageMode language_mode); |
109 // Keyed load property. The key should be in the accumulator. | 110 // Keyed load property. The key should be in the accumulator. |
110 BytecodeArrayBuilder& LoadKeyedProperty(Register object, int feedback_slot, | 111 BytecodeArrayBuilder& LoadKeyedProperty(Register object, int feedback_slot, |
111 LanguageMode language_mode); | 112 LanguageMode language_mode); |
112 | 113 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 static Bytecode BytecodeForStoreGlobal(LanguageMode language_mode); | 243 static Bytecode BytecodeForStoreGlobal(LanguageMode language_mode); |
243 static Bytecode BytecodeForStoreLookupSlot(LanguageMode language_mode); | 244 static Bytecode BytecodeForStoreLookupSlot(LanguageMode language_mode); |
244 static Bytecode BytecodeForCreateArguments(CreateArgumentsType type); | 245 static Bytecode BytecodeForCreateArguments(CreateArgumentsType type); |
245 static Bytecode BytecodeForDelete(LanguageMode language_mode); | 246 static Bytecode BytecodeForDelete(LanguageMode language_mode); |
246 | 247 |
247 static bool FitsInIdx8Operand(int value); | 248 static bool FitsInIdx8Operand(int value); |
248 static bool FitsInIdx8Operand(size_t value); | 249 static bool FitsInIdx8Operand(size_t value); |
249 static bool FitsInImm8Operand(int value); | 250 static bool FitsInImm8Operand(int value); |
250 static bool FitsInIdx16Operand(int value); | 251 static bool FitsInIdx16Operand(int value); |
251 static bool FitsInIdx16Operand(size_t value); | 252 static bool FitsInIdx16Operand(size_t value); |
| 253 static bool FitsInReg8Operand(Register value); |
| 254 static bool FitsInReg16Operand(Register value); |
252 | 255 |
253 static Bytecode GetJumpWithConstantOperand(Bytecode jump_with_smi8_operand); | 256 static Bytecode GetJumpWithConstantOperand(Bytecode jump_with_smi8_operand); |
254 static Bytecode GetJumpWithToBoolean(Bytecode jump); | 257 static Bytecode GetJumpWithToBoolean(Bytecode jump); |
255 | 258 |
| 259 Register MapRegister(Register reg); |
| 260 Register MapRegisters(Register reg, Register args_base, int args_length = 1); |
| 261 |
256 template <size_t N> | 262 template <size_t N> |
257 INLINE(void Output(Bytecode bytecode, uint32_t(&oprands)[N])); | 263 INLINE(void Output(Bytecode bytecode, uint32_t(&operands)[N])); |
258 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1, | 264 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1, |
259 uint32_t operand2, uint32_t operand3); | 265 uint32_t operand2, uint32_t operand3); |
260 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1, | 266 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1, |
261 uint32_t operand2); | 267 uint32_t operand2); |
262 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1); | 268 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1); |
263 void Output(Bytecode bytecode, uint32_t operand0); | 269 void Output(Bytecode bytecode, uint32_t operand0); |
264 void Output(Bytecode bytecode); | 270 void Output(Bytecode bytecode); |
265 | 271 |
266 BytecodeArrayBuilder& OutputJump(Bytecode jump_bytecode, | 272 BytecodeArrayBuilder& OutputJump(Bytecode jump_bytecode, |
267 BytecodeLabel* label); | 273 BytecodeLabel* label); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 394 |
389 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 395 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
390 }; | 396 }; |
391 | 397 |
392 | 398 |
393 } // namespace interpreter | 399 } // namespace interpreter |
394 } // namespace internal | 400 } // namespace internal |
395 } // namespace v8 | 401 } // namespace v8 |
396 | 402 |
397 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 403 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |