OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 223 } |
224 return offset; | 224 return offset; |
225 } | 225 } |
226 | 226 |
227 | 227 |
228 Instruction* Instruction::ImmPCOffsetTarget() { | 228 Instruction* Instruction::ImmPCOffsetTarget() { |
229 return this + ImmPCOffset(); | 229 return this + ImmPCOffset(); |
230 } | 230 } |
231 | 231 |
232 | 232 |
| 233 bool Instruction::IsValidImmPCOffset(ImmBranchType branch_type, |
| 234 int32_t offset) { |
| 235 return is_intn(offset, ImmBranchRangeBitwidth(branch_type)); |
| 236 } |
| 237 |
| 238 |
| 239 bool Instruction::IsTargetInImmPCOffsetRange(Instruction* target) { |
| 240 int offset = target - this; |
| 241 return IsValidImmPCOffset(BranchType(), offset); |
| 242 } |
| 243 |
| 244 |
233 void Instruction::SetImmPCOffsetTarget(Instruction* target) { | 245 void Instruction::SetImmPCOffsetTarget(Instruction* target) { |
234 if (IsPCRelAddressing()) { | 246 if (IsPCRelAddressing()) { |
235 SetPCRelImmTarget(target); | 247 SetPCRelImmTarget(target); |
236 } else if (BranchType() != UnknownBranchType) { | 248 } else if (BranchType() != UnknownBranchType) { |
237 SetBranchImmTarget(target); | 249 SetBranchImmTarget(target); |
238 } else { | 250 } else { |
239 SetImmLLiteral(target); | 251 SetImmLLiteral(target); |
240 } | 252 } |
241 } | 253 } |
242 | 254 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 uint64_t payload = ImmMoveWide(); | 325 uint64_t payload = ImmMoveWide(); |
314 // TODO(all): If we extend ::InlineData() to support bigger data, we need | 326 // TODO(all): If we extend ::InlineData() to support bigger data, we need |
315 // to update this method too. | 327 // to update this method too. |
316 return payload; | 328 return payload; |
317 } | 329 } |
318 | 330 |
319 | 331 |
320 } } // namespace v8::internal | 332 } } // namespace v8::internal |
321 | 333 |
322 #endif // V8_TARGET_ARCH_A64 | 334 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |