| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #define ARM64_DEFINE_FP_STATICS | 9 #define ARM64_DEFINE_FP_STATICS |
| 10 | 10 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } else { | 226 } else { |
| 227 SetImmLLiteral(target); | 227 SetImmLLiteral(target); |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 | 231 |
| 232 void Instruction::SetPCRelImmTarget(Instruction* target) { | 232 void Instruction::SetPCRelImmTarget(Instruction* target) { |
| 233 // ADRP is not supported, so 'this' must point to an ADR instruction. | 233 // ADRP is not supported, so 'this' must point to an ADR instruction. |
| 234 ASSERT(IsAdr()); | 234 ASSERT(IsAdr()); |
| 235 | 235 |
| 236 int target_offset = DistanceTo(target); | 236 ptrdiff_t target_offset = DistanceTo(target); |
| 237 Instr imm; | 237 Instr imm; |
| 238 if (Instruction::IsValidPCRelOffset(target_offset)) { | 238 if (Instruction::IsValidPCRelOffset(target_offset)) { |
| 239 imm = Assembler::ImmPCRelAddress(target_offset); | 239 imm = Assembler::ImmPCRelAddress(target_offset); |
| 240 SetInstructionBits(Mask(~ImmPCRel_mask) | imm); | 240 SetInstructionBits(Mask(~ImmPCRel_mask) | imm); |
| 241 } else { | 241 } else { |
| 242 PatchingAssembler patcher(this, | 242 PatchingAssembler patcher(this, |
| 243 PatchingAssembler::kAdrFarPatchableNInstrs); | 243 PatchingAssembler::kAdrFarPatchableNInstrs); |
| 244 patcher.PatchAdrFar(target); | 244 patcher.PatchAdrFar(target_offset); |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 | 247 |
| 248 | 248 |
| 249 void Instruction::SetBranchImmTarget(Instruction* target) { | 249 void Instruction::SetBranchImmTarget(Instruction* target) { |
| 250 ASSERT(IsAligned(DistanceTo(target), kInstructionSize)); | 250 ASSERT(IsAligned(DistanceTo(target), kInstructionSize)); |
| 251 Instr branch_imm = 0; | 251 Instr branch_imm = 0; |
| 252 uint32_t imm_mask = 0; | 252 uint32_t imm_mask = 0; |
| 253 ptrdiff_t offset = DistanceTo(target) >> kInstructionSizeLog2; | 253 ptrdiff_t offset = DistanceTo(target) >> kInstructionSizeLog2; |
| 254 switch (BranchType()) { | 254 switch (BranchType()) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 uint64_t payload = ImmMoveWide(); | 308 uint64_t payload = ImmMoveWide(); |
| 309 // TODO(all): If we extend ::InlineData() to support bigger data, we need | 309 // TODO(all): If we extend ::InlineData() to support bigger data, we need |
| 310 // to update this method too. | 310 // to update this method too. |
| 311 return payload; | 311 return payload; |
| 312 } | 312 } |
| 313 | 313 |
| 314 | 314 |
| 315 } } // namespace v8::internal | 315 } } // namespace v8::internal |
| 316 | 316 |
| 317 #endif // V8_TARGET_ARCH_ARM64 | 317 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |