OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
5 // met: | 5 // met: |
6 // | 6 // |
7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
10 // copyright notice, this list of conditions and the following | 10 // copyright notice, this list of conditions and the following |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 bool Operand::NeedsRelocation(const Assembler* assembler) const { | 288 bool Operand::NeedsRelocation(const Assembler* assembler) const { |
289 if (rmode_ == RelocInfo::EXTERNAL_REFERENCE) { | 289 if (rmode_ == RelocInfo::EXTERNAL_REFERENCE) { |
290 return assembler->serializer_enabled(); | 290 return assembler->serializer_enabled(); |
291 } | 291 } |
292 | 292 |
293 return !RelocInfo::IsNone(rmode_); | 293 return !RelocInfo::IsNone(rmode_); |
294 } | 294 } |
295 | 295 |
296 | 296 |
| 297 MemOperand::PairResult MemOperand::AreConsistentForPair( |
| 298 const MemOperand& operandA, |
| 299 const MemOperand& operandB, |
| 300 int access_size_log2) { |
| 301 ASSERT(access_size_log2 >= 0); |
| 302 ASSERT(access_size_log2 <= 3); |
| 303 // Step one: check that they share the same base, that the mode is Offset |
| 304 // and that the offset is a multiple of access size. |
| 305 if (!operandA.base().Is(operandB.base()) || |
| 306 (operandA.addrmode() != Offset) || |
| 307 (operandB.addrmode() != Offset) || |
| 308 ((operandA.offset() & ((1 << access_size_log2) - 1)) != 0)) { |
| 309 return kNotPair; |
| 310 } |
| 311 // Step two: check that the offsets are contiguous and that the range |
| 312 // is OK for ldp/stp. |
| 313 if ((operandB.offset() == operandA.offset() + (1 << access_size_log2)) && |
| 314 is_int7(operandA.offset() >> access_size_log2)) { |
| 315 return kPairAB; |
| 316 } |
| 317 if ((operandA.offset() == operandB.offset() + (1 << access_size_log2)) && |
| 318 is_int7(operandB.offset() >> access_size_log2)) { |
| 319 return kPairBA; |
| 320 } |
| 321 return kNotPair; |
| 322 } |
| 323 |
| 324 |
297 // Assembler | 325 // Assembler |
298 | 326 |
299 Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) | 327 Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) |
300 : AssemblerBase(isolate, buffer, buffer_size), | 328 : AssemblerBase(isolate, buffer, buffer_size), |
301 recorded_ast_id_(TypeFeedbackId::None()), | 329 recorded_ast_id_(TypeFeedbackId::None()), |
302 unresolved_branches_(), | 330 unresolved_branches_(), |
303 positions_recorder_(this) { | 331 positions_recorder_(this) { |
304 const_pool_blocked_nesting_ = 0; | 332 const_pool_blocked_nesting_ = 0; |
305 veneer_pool_blocked_nesting_ = 0; | 333 veneer_pool_blocked_nesting_ = 0; |
306 Reset(); | 334 Reset(); |
(...skipping 2600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2907 adr(rd, 0); | 2935 adr(rd, 0); |
2908 MovInt64(scratch, target_offset); | 2936 MovInt64(scratch, target_offset); |
2909 add(rd, rd, scratch); | 2937 add(rd, rd, scratch); |
2910 } | 2938 } |
2911 } | 2939 } |
2912 | 2940 |
2913 | 2941 |
2914 } } // namespace v8::internal | 2942 } } // namespace v8::internal |
2915 | 2943 |
2916 #endif // V8_TARGET_ARCH_ARM64 | 2944 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |