| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 5 #ifndef V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
| 6 #define V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 6 #define V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
| 7 | 7 |
| 8 #include "src/arm64/lithium-arm64.h" | 8 #include "src/arm64/lithium-arm64.h" |
| 9 | 9 |
| 10 #include "src/arm64/lithium-gap-resolver-arm64.h" | 10 #include "src/arm64/lithium-gap-resolver-arm64.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // chunk contains constructs we cannot handle. Returns true if the | 76 // chunk contains constructs we cannot handle. Returns true if the |
| 77 // code generation attempt succeeded. | 77 // code generation attempt succeeded. |
| 78 bool GenerateCode(); | 78 bool GenerateCode(); |
| 79 | 79 |
| 80 // Finish the code by setting stack height, safepoint, and bailout | 80 // Finish the code by setting stack height, safepoint, and bailout |
| 81 // information on it. | 81 // information on it. |
| 82 void FinishCode(Handle<Code> code); | 82 void FinishCode(Handle<Code> code); |
| 83 | 83 |
| 84 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; | 84 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; |
| 85 // Support for converting LOperands to assembler types. | 85 // Support for converting LOperands to assembler types. |
| 86 // LOperand must be a register. | |
| 87 Register ToRegister(LOperand* op) const; | 86 Register ToRegister(LOperand* op) const; |
| 88 Register ToRegister32(LOperand* op) const; | 87 Register ToRegister32(LOperand* op) const; |
| 89 Operand ToOperand(LOperand* op); | 88 Operand ToOperand(LOperand* op); |
| 90 Operand ToOperand32I(LOperand* op); | 89 Operand ToOperand32(LOperand* op); |
| 91 Operand ToOperand32U(LOperand* op); | |
| 92 enum StackMode { kMustUseFramePointer, kCanUseStackPointer }; | 90 enum StackMode { kMustUseFramePointer, kCanUseStackPointer }; |
| 93 MemOperand ToMemOperand(LOperand* op, | 91 MemOperand ToMemOperand(LOperand* op, |
| 94 StackMode stack_mode = kCanUseStackPointer) const; | 92 StackMode stack_mode = kCanUseStackPointer) const; |
| 95 Handle<Object> ToHandle(LConstantOperand* op) const; | 93 Handle<Object> ToHandle(LConstantOperand* op) const; |
| 96 | 94 |
| 97 template<class LI> | 95 template <class LI> |
| 98 Operand ToShiftedRightOperand32I(LOperand* right, | 96 Operand ToShiftedRightOperand32(LOperand* right, LI* shift_info); |
| 99 LI* shift_info) { | |
| 100 return ToShiftedRightOperand32(right, shift_info, SIGNED_INT32); | |
| 101 } | |
| 102 template<class LI> | |
| 103 Operand ToShiftedRightOperand32U(LOperand* right, | |
| 104 LI* shift_info) { | |
| 105 return ToShiftedRightOperand32(right, shift_info, UNSIGNED_INT32); | |
| 106 } | |
| 107 template<class LI> | |
| 108 Operand ToShiftedRightOperand32(LOperand* right, | |
| 109 LI* shift_info, | |
| 110 IntegerSignedness signedness); | |
| 111 | 97 |
| 112 int JSShiftAmountFromLConstant(LOperand* constant) { | 98 int JSShiftAmountFromLConstant(LOperand* constant) { |
| 113 return ToInteger32(LConstantOperand::cast(constant)) & 0x1f; | 99 return ToInteger32(LConstantOperand::cast(constant)) & 0x1f; |
| 114 } | 100 } |
| 115 | 101 |
| 116 // TODO(jbramley): Examine these helpers and check that they make sense. | 102 // TODO(jbramley): Examine these helpers and check that they make sense. |
| 117 // IsInteger32Constant returns true for smi constants, for example. | 103 // IsInteger32Constant returns true for smi constants, for example. |
| 118 bool IsInteger32Constant(LConstantOperand* op) const; | 104 bool IsInteger32Constant(LConstantOperand* op) const; |
| 119 bool IsSmi(LConstantOperand* op) const; | 105 bool IsSmi(LConstantOperand* op) const; |
| 120 | 106 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 151 LOperand* temp1, | 137 LOperand* temp1, |
| 152 LOperand* temp2); | 138 LOperand* temp2); |
| 153 void DoDeferredAllocate(LAllocate* instr); | 139 void DoDeferredAllocate(LAllocate* instr); |
| 154 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr); | 140 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr); |
| 155 void DoDeferredInstanceMigration(LCheckMaps* instr, Register object); | 141 void DoDeferredInstanceMigration(LCheckMaps* instr, Register object); |
| 156 void DoDeferredLoadMutableDouble(LLoadFieldByIndex* instr, | 142 void DoDeferredLoadMutableDouble(LLoadFieldByIndex* instr, |
| 157 Register result, | 143 Register result, |
| 158 Register object, | 144 Register object, |
| 159 Register index); | 145 Register index); |
| 160 | 146 |
| 161 Operand ToOperand32(LOperand* op, IntegerSignedness signedness); | |
| 162 | |
| 163 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 147 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
| 164 void EmitGoto(int block); | 148 void EmitGoto(int block); |
| 165 void DoGap(LGap* instr); | 149 void DoGap(LGap* instr); |
| 166 | 150 |
| 167 // Generic version of EmitBranch. It contains some code to avoid emitting a | 151 // Generic version of EmitBranch. It contains some code to avoid emitting a |
| 168 // branch on the next emitted basic block where we could just fall-through. | 152 // branch on the next emitted basic block where we could just fall-through. |
| 169 // You shouldn't use that directly but rather consider one of the helper like | 153 // You shouldn't use that directly but rather consider one of the helper like |
| 170 // LCodeGen::EmitBranch, LCodeGen::EmitCompareAndBranch... | 154 // LCodeGen::EmitBranch, LCodeGen::EmitCompareAndBranch... |
| 171 template<class InstrType> | 155 template<class InstrType> |
| 172 void EmitBranchGeneric(InstrType instr, | 156 void EmitBranchGeneric(InstrType instr, |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 452 |
| 469 protected: | 453 protected: |
| 470 MacroAssembler* masm() const { return codegen_->masm(); } | 454 MacroAssembler* masm() const { return codegen_->masm(); } |
| 471 | 455 |
| 472 LCodeGen* codegen_; | 456 LCodeGen* codegen_; |
| 473 }; | 457 }; |
| 474 | 458 |
| 475 } } // namespace v8::internal | 459 } } // namespace v8::internal |
| 476 | 460 |
| 477 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 461 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
| OLD | NEW |