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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 if (op->IsRegister()) { | 202 if (op->IsRegister()) { |
203 return Operand(ToRegister(op).W()); | 203 return Operand(ToRegister(op).W()); |
204 } | 204 } |
205 return ToImmediate(op); | 205 return ToImmediate(op); |
206 } | 206 } |
207 | 207 |
208 Operand ToImmediate(InstructionOperand* operand) { | 208 Operand ToImmediate(InstructionOperand* operand) { |
209 Constant constant = ToConstant(operand); | 209 Constant constant = ToConstant(operand); |
210 switch (constant.type()) { | 210 switch (constant.type()) { |
211 case Constant::kInt32: | 211 case Constant::kInt32: |
212 if (constant.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { | 212 if (RelocInfo::IsWasmSizeReference(constant.rmode())) { |
213 return Operand(constant.ToInt32(), constant.rmode()); | 213 return Operand(constant.ToInt32(), constant.rmode()); |
214 } else { | 214 } else { |
215 return Operand(constant.ToInt32()); | 215 return Operand(constant.ToInt32()); |
216 } | 216 } |
217 case Constant::kInt64: | 217 case Constant::kInt64: |
218 if (constant.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || | 218 if (RelocInfo::IsWasmPtrReference(constant.rmode())) { |
219 constant.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { | |
220 return Operand(constant.ToInt64(), constant.rmode()); | 219 return Operand(constant.ToInt64(), constant.rmode()); |
221 } else { | 220 } else { |
222 DCHECK(constant.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); | 221 DCHECK(!RelocInfo::IsWasmSizeReference(constant.rmode())); |
223 return Operand(constant.ToInt64()); | 222 return Operand(constant.ToInt64()); |
224 } | 223 } |
225 case Constant::kFloat32: | 224 case Constant::kFloat32: |
226 return Operand( | 225 return Operand( |
227 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); | 226 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); |
228 case Constant::kFloat64: | 227 case Constant::kFloat64: |
229 return Operand( | 228 return Operand( |
230 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); | 229 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); |
231 case Constant::kExternalReference: | 230 case Constant::kExternalReference: |
232 return Operand(constant.ToExternalReference()); | 231 return Operand(constant.ToExternalReference()); |
(...skipping 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 padding_size -= kInstructionSize; | 2119 padding_size -= kInstructionSize; |
2121 } | 2120 } |
2122 } | 2121 } |
2123 } | 2122 } |
2124 | 2123 |
2125 #undef __ | 2124 #undef __ |
2126 | 2125 |
2127 } // namespace compiler | 2126 } // namespace compiler |
2128 } // namespace internal | 2127 } // namespace internal |
2129 } // namespace v8 | 2128 } // namespace v8 |
OLD | NEW |