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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 return assembler->serializer_enabled(); | 322 return assembler->serializer_enabled(); |
323 } | 323 } |
324 | 324 |
325 return !RelocInfo::IsNone(rmode); | 325 return !RelocInfo::IsNone(rmode); |
326 } | 326 } |
327 | 327 |
328 | 328 |
329 // Constant Pool. | 329 // Constant Pool. |
330 void ConstPool::RecordEntry(intptr_t data, | 330 void ConstPool::RecordEntry(intptr_t data, |
331 RelocInfo::Mode mode) { | 331 RelocInfo::Mode mode) { |
332 DCHECK(mode != RelocInfo::COMMENT && | 332 DCHECK(mode != RelocInfo::COMMENT && mode != RelocInfo::POSITION && |
333 mode != RelocInfo::POSITION && | |
334 mode != RelocInfo::STATEMENT_POSITION && | 333 mode != RelocInfo::STATEMENT_POSITION && |
335 mode != RelocInfo::CONST_POOL && | 334 mode != RelocInfo::CONST_POOL && mode != RelocInfo::VENEER_POOL && |
336 mode != RelocInfo::VENEER_POOL && | |
337 mode != RelocInfo::CODE_AGE_SEQUENCE && | 335 mode != RelocInfo::CODE_AGE_SEQUENCE && |
338 mode != RelocInfo::DEOPT_REASON); | 336 mode != RelocInfo::DEOPT_REASON && mode != RelocInfo::DEOPT_ID); |
339 uint64_t raw_data = static_cast<uint64_t>(data); | 337 uint64_t raw_data = static_cast<uint64_t>(data); |
340 int offset = assm_->pc_offset(); | 338 int offset = assm_->pc_offset(); |
341 if (IsEmpty()) { | 339 if (IsEmpty()) { |
342 first_use_ = offset; | 340 first_use_ = offset; |
343 } | 341 } |
344 | 342 |
345 std::pair<uint64_t, int> entry = std::make_pair(raw_data, offset); | 343 std::pair<uint64_t, int> entry = std::make_pair(raw_data, offset); |
346 if (CanBeShared(mode)) { | 344 if (CanBeShared(mode)) { |
347 shared_entries_.insert(entry); | 345 shared_entries_.insert(entry); |
348 if (shared_entries_.count(entry.first) == 1) { | 346 if (shared_entries_.count(entry.first) == 1) { |
(...skipping 2557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2906 } | 2904 } |
2907 | 2905 |
2908 | 2906 |
2909 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 2907 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
2910 // We do not try to reuse pool constants. | 2908 // We do not try to reuse pool constants. |
2911 RelocInfo rinfo(isolate(), reinterpret_cast<byte*>(pc_), rmode, data, NULL); | 2909 RelocInfo rinfo(isolate(), reinterpret_cast<byte*>(pc_), rmode, data, NULL); |
2912 if (((rmode >= RelocInfo::COMMENT) && | 2910 if (((rmode >= RelocInfo::COMMENT) && |
2913 (rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_TAIL_CALL)) || | 2911 (rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_TAIL_CALL)) || |
2914 (rmode == RelocInfo::INTERNAL_REFERENCE) || | 2912 (rmode == RelocInfo::INTERNAL_REFERENCE) || |
2915 (rmode == RelocInfo::CONST_POOL) || (rmode == RelocInfo::VENEER_POOL) || | 2913 (rmode == RelocInfo::CONST_POOL) || (rmode == RelocInfo::VENEER_POOL) || |
2916 (rmode == RelocInfo::DEOPT_REASON) || | 2914 (rmode == RelocInfo::DEOPT_REASON) || (rmode == RelocInfo::DEOPT_ID) || |
2917 (rmode == RelocInfo::GENERATOR_CONTINUATION)) { | 2915 (rmode == RelocInfo::GENERATOR_CONTINUATION)) { |
2918 // Adjust code for new modes. | 2916 // Adjust code for new modes. |
2919 DCHECK(RelocInfo::IsDebugBreakSlot(rmode) || RelocInfo::IsComment(rmode) || | 2917 DCHECK(RelocInfo::IsDebugBreakSlot(rmode) || RelocInfo::IsComment(rmode) || |
2920 RelocInfo::IsDeoptReason(rmode) || RelocInfo::IsPosition(rmode) || | 2918 RelocInfo::IsDeoptReason(rmode) || RelocInfo::IsDeoptId(rmode) || |
| 2919 RelocInfo::IsPosition(rmode) || |
2921 RelocInfo::IsInternalReference(rmode) || | 2920 RelocInfo::IsInternalReference(rmode) || |
2922 RelocInfo::IsConstPool(rmode) || RelocInfo::IsVeneerPool(rmode) || | 2921 RelocInfo::IsConstPool(rmode) || RelocInfo::IsVeneerPool(rmode) || |
2923 RelocInfo::IsGeneratorContinuation(rmode)); | 2922 RelocInfo::IsGeneratorContinuation(rmode)); |
2924 // These modes do not need an entry in the constant pool. | 2923 // These modes do not need an entry in the constant pool. |
2925 } else { | 2924 } else { |
2926 constpool_.RecordEntry(data, rmode); | 2925 constpool_.RecordEntry(data, rmode); |
2927 // Make sure the constant pool is not emitted in place of the next | 2926 // Make sure the constant pool is not emitted in place of the next |
2928 // instruction for which we just recorded relocation info. | 2927 // instruction for which we just recorded relocation info. |
2929 BlockConstPoolFor(1); | 2928 BlockConstPoolFor(1); |
2930 } | 2929 } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3176 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); | 3175 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); |
3177 DCHECK((target_offset >> 48) == 0); | 3176 DCHECK((target_offset >> 48) == 0); |
3178 add(rd, rd, scratch); | 3177 add(rd, rd, scratch); |
3179 } | 3178 } |
3180 | 3179 |
3181 | 3180 |
3182 } // namespace internal | 3181 } // namespace internal |
3183 } // namespace v8 | 3182 } // namespace v8 |
3184 | 3183 |
3185 #endif // V8_TARGET_ARCH_ARM64 | 3184 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |