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 "arm64/lithium-arm64.h" | 8 #include "arm64/lithium-arm64.h" |
9 | 9 |
10 #include "arm64/lithium-gap-resolver-arm64.h" | 10 #include "arm64/lithium-gap-resolver-arm64.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // Try to generate code for the entire chunk, but it may fail if the | 69 // Try to generate code for the entire chunk, but it may fail if the |
70 // chunk contains constructs we cannot handle. Returns true if the | 70 // chunk contains constructs we cannot handle. Returns true if the |
71 // code generation attempt succeeded. | 71 // code generation attempt succeeded. |
72 bool GenerateCode(); | 72 bool GenerateCode(); |
73 | 73 |
74 // Finish the code by setting stack height, safepoint, and bailout | 74 // Finish the code by setting stack height, safepoint, and bailout |
75 // information on it. | 75 // information on it. |
76 void FinishCode(Handle<Code> code); | 76 void FinishCode(Handle<Code> code); |
77 | 77 |
| 78 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; |
78 // Support for converting LOperands to assembler types. | 79 // Support for converting LOperands to assembler types. |
79 // LOperand must be a register. | 80 // LOperand must be a register. |
80 Register ToRegister(LOperand* op) const; | 81 Register ToRegister(LOperand* op) const; |
81 Register ToRegister32(LOperand* op) const; | 82 Register ToRegister32(LOperand* op) const; |
82 Operand ToOperand(LOperand* op); | 83 Operand ToOperand(LOperand* op); |
83 Operand ToOperand32I(LOperand* op); | 84 Operand ToOperand32I(LOperand* op); |
84 Operand ToOperand32U(LOperand* op); | 85 Operand ToOperand32U(LOperand* op); |
85 MemOperand ToMemOperand(LOperand* op) const; | 86 MemOperand ToMemOperand(LOperand* op) const; |
86 Handle<Object> ToHandle(LConstantOperand* op) const; | 87 Handle<Object> ToHandle(LConstantOperand* op) const; |
| 88 Operand ToShiftedRightOperand32I(LOperand* right, |
| 89 LShiftedRightOpInterface* shift_info) { |
| 90 return ToShiftedRightOperand32(right, shift_info, SIGNED_INT32); |
| 91 } |
| 92 Operand ToShiftedRightOperand32U(LOperand* right, |
| 93 LShiftedRightOpInterface* shift_info) { |
| 94 return ToShiftedRightOperand32(right, shift_info, UNSIGNED_INT32); |
| 95 } |
| 96 Operand ToShiftedRightOperand32(LOperand* right, |
| 97 LShiftedRightOpInterface* shift_info, |
| 98 IntegerSignedness signedness); |
87 | 99 |
88 // TODO(jbramley): Examine these helpers and check that they make sense. | 100 // TODO(jbramley): Examine these helpers and check that they make sense. |
89 // IsInteger32Constant returns true for smi constants, for example. | 101 // IsInteger32Constant returns true for smi constants, for example. |
90 bool IsInteger32Constant(LConstantOperand* op) const; | 102 bool IsInteger32Constant(LConstantOperand* op) const; |
91 bool IsSmi(LConstantOperand* op) const; | 103 bool IsSmi(LConstantOperand* op) const; |
92 | 104 |
93 int32_t ToInteger32(LConstantOperand* op) const; | 105 int32_t ToInteger32(LConstantOperand* op) const; |
94 Smi* ToSmi(LConstantOperand* op) const; | 106 Smi* ToSmi(LConstantOperand* op) const; |
95 double ToDouble(LConstantOperand* op) const; | 107 double ToDouble(LConstantOperand* op) const; |
96 DoubleRegister ToDoubleRegister(LOperand* op) const; | 108 DoubleRegister ToDoubleRegister(LOperand* op) const; |
(...skipping 10 matching lines...) Expand all Loading... |
107 | 119 |
108 // Deferred code support. | 120 // Deferred code support. |
109 void DoDeferredNumberTagD(LNumberTagD* instr); | 121 void DoDeferredNumberTagD(LNumberTagD* instr); |
110 void DoDeferredStackCheck(LStackCheck* instr); | 122 void DoDeferredStackCheck(LStackCheck* instr); |
111 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); | 123 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); |
112 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); | 124 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); |
113 void DoDeferredMathAbsTagged(LMathAbsTagged* instr, | 125 void DoDeferredMathAbsTagged(LMathAbsTagged* instr, |
114 Label* exit, | 126 Label* exit, |
115 Label* allocation_entry); | 127 Label* allocation_entry); |
116 | 128 |
117 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; | |
118 void DoDeferredNumberTagU(LInstruction* instr, | 129 void DoDeferredNumberTagU(LInstruction* instr, |
119 LOperand* value, | 130 LOperand* value, |
120 LOperand* temp1, | 131 LOperand* temp1, |
121 LOperand* temp2); | 132 LOperand* temp2); |
122 void DoDeferredTaggedToI(LTaggedToI* instr, | 133 void DoDeferredTaggedToI(LTaggedToI* instr, |
123 LOperand* value, | 134 LOperand* value, |
124 LOperand* temp1, | 135 LOperand* temp1, |
125 LOperand* temp2); | 136 LOperand* temp2); |
126 void DoDeferredAllocate(LAllocate* instr); | 137 void DoDeferredAllocate(LAllocate* instr); |
127 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr); | 138 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr); |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 472 |
462 protected: | 473 protected: |
463 MacroAssembler* masm() const { return codegen_->masm(); } | 474 MacroAssembler* masm() const { return codegen_->masm(); } |
464 | 475 |
465 LCodeGen* codegen_; | 476 LCodeGen* codegen_; |
466 }; | 477 }; |
467 | 478 |
468 } } // namespace v8::internal | 479 } } // namespace v8::internal |
469 | 480 |
470 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 481 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
OLD | NEW |