| 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.h" | 10 #include "src/ast.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 size_t GetConstantPoolEntry(Handle<Object> object); | 72 size_t GetConstantPoolEntry(Handle<Object> object); |
| 73 | 73 |
| 74 // Constant loads to accumulator. | 74 // Constant loads to accumulator. |
| 75 BytecodeArrayBuilder& LoadLiteral(v8::internal::Smi* value); | 75 BytecodeArrayBuilder& LoadLiteral(v8::internal::Smi* value); |
| 76 BytecodeArrayBuilder& LoadLiteral(Handle<Object> object); | 76 BytecodeArrayBuilder& LoadLiteral(Handle<Object> object); |
| 77 BytecodeArrayBuilder& LoadUndefined(); | 77 BytecodeArrayBuilder& LoadUndefined(); |
| 78 BytecodeArrayBuilder& LoadNull(); | 78 BytecodeArrayBuilder& LoadNull(); |
| 79 BytecodeArrayBuilder& LoadTheHole(); | 79 BytecodeArrayBuilder& LoadTheHole(); |
| 80 BytecodeArrayBuilder& LoadTrue(); | 80 BytecodeArrayBuilder& LoadTrue(); |
| 81 BytecodeArrayBuilder& LoadFalse(); | 81 BytecodeArrayBuilder& LoadFalse(); |
| 82 BytecodeArrayBuilder& LoadBooleanConstant(bool value); |
| 82 | 83 |
| 83 // Global loads to the accumulator and stores from the accumulator. | 84 // Global loads to the accumulator and stores from the accumulator. |
| 84 BytecodeArrayBuilder& LoadGlobal(size_t name_index, int feedback_slot, | 85 BytecodeArrayBuilder& LoadGlobal(size_t name_index, int feedback_slot, |
| 85 LanguageMode language_mode, | 86 LanguageMode language_mode, |
| 86 TypeofMode typeof_mode); | 87 TypeofMode typeof_mode); |
| 87 BytecodeArrayBuilder& StoreGlobal(size_t name_index, int feedback_slot, | 88 BytecodeArrayBuilder& StoreGlobal(size_t name_index, int feedback_slot, |
| 88 LanguageMode language_mode); | 89 LanguageMode language_mode); |
| 89 | 90 |
| 90 // Load the object at |slot_index| in |context| into the accumulator. | 91 // Load the object at |slot_index| in |context| into the accumulator. |
| 91 BytecodeArrayBuilder& LoadContextSlot(Register context, int slot_index); | 92 BytecodeArrayBuilder& LoadContextSlot(Register context, int slot_index); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 BytecodeLabel* label); | 248 BytecodeLabel* label); |
| 248 void PatchJump(const ZoneVector<uint8_t>::iterator& jump_target, | 249 void PatchJump(const ZoneVector<uint8_t>::iterator& jump_target, |
| 249 ZoneVector<uint8_t>::iterator jump_location); | 250 ZoneVector<uint8_t>::iterator jump_location); |
| 250 | 251 |
| 251 void LeaveBasicBlock(); | 252 void LeaveBasicBlock(); |
| 252 void EnsureReturn(); | 253 void EnsureReturn(); |
| 253 | 254 |
| 254 bool OperandIsValid(Bytecode bytecode, int operand_index, | 255 bool OperandIsValid(Bytecode bytecode, int operand_index, |
| 255 uint32_t operand_value) const; | 256 uint32_t operand_value) const; |
| 256 bool LastBytecodeInSameBlock() const; | 257 bool LastBytecodeInSameBlock() const; |
| 258 // Get the previous bytecode in the same block |
| 259 Bytecode GetPreviousBytecodeInSameBlock() const; |
| 260 uint32_t GetRawOperand(int operand_index) const; |
| 261 Handle<Object> GetConstantForIndexOperand(int operand_index); |
| 257 | 262 |
| 258 bool NeedToBooleanCast(); | 263 bool NeedToBooleanCast(); |
| 259 bool IsRegisterInAccumulator(Register reg); | 264 bool IsRegisterInAccumulator(Register reg); |
| 260 | 265 |
| 261 int BorrowTemporaryRegister(); | 266 int BorrowTemporaryRegister(); |
| 262 void ReturnTemporaryRegister(int reg_index); | 267 void ReturnTemporaryRegister(int reg_index); |
| 263 int PrepareForConsecutiveTemporaryRegisters(size_t count); | 268 int PrepareForConsecutiveTemporaryRegisters(size_t count); |
| 264 void BorrowConsecutiveTemporaryRegister(int reg_index); | 269 void BorrowConsecutiveTemporaryRegister(int reg_index); |
| 265 bool TemporaryRegisterIsLive(Register reg) const; | 270 bool TemporaryRegisterIsLive(Register reg) const; |
| 266 | 271 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 361 |
| 357 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 362 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
| 358 }; | 363 }; |
| 359 | 364 |
| 360 | 365 |
| 361 } // namespace interpreter | 366 } // namespace interpreter |
| 362 } // namespace internal | 367 } // namespace internal |
| 363 } // namespace v8 | 368 } // namespace v8 |
| 364 | 369 |
| 365 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 370 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
| OLD | NEW |