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::IsWasmMemorySizeReference(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 (constant.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || |
219 constant.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { | 219 constant.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { |
220 return Operand(constant.ToInt64(), constant.rmode()); | 220 return Operand(constant.ToInt64(), constant.rmode()); |
221 } else { | 221 } else { |
222 DCHECK(constant.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); | 222 DCHECK(!RelocInfo::IsWasmMemorySizeReference(constant.rmode())); |
223 return Operand(constant.ToInt64()); | 223 return Operand(constant.ToInt64()); |
224 } | 224 } |
225 case Constant::kFloat32: | 225 case Constant::kFloat32: |
226 return Operand( | 226 return Operand( |
227 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); | 227 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); |
228 case Constant::kFloat64: | 228 case Constant::kFloat64: |
229 return Operand( | 229 return Operand( |
230 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); | 230 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); |
231 case Constant::kExternalReference: | 231 case Constant::kExternalReference: |
232 return Operand(constant.ToExternalReference()); | 232 return Operand(constant.ToExternalReference()); |
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 padding_size -= kInstructionSize; | 2088 padding_size -= kInstructionSize; |
2089 } | 2089 } |
2090 } | 2090 } |
2091 } | 2091 } |
2092 | 2092 |
2093 #undef __ | 2093 #undef __ |
2094 | 2094 |
2095 } // namespace compiler | 2095 } // namespace compiler |
2096 } // namespace internal | 2096 } // namespace internal |
2097 } // namespace v8 | 2097 } // namespace v8 |
OLD | NEW |