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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 | 305 |
306 // Constant Pool. | 306 // Constant Pool. |
307 void ConstPool::RecordEntry(intptr_t data, | 307 void ConstPool::RecordEntry(intptr_t data, |
308 RelocInfo::Mode mode) { | 308 RelocInfo::Mode mode) { |
309 DCHECK(mode != RelocInfo::COMMENT && | 309 DCHECK(mode != RelocInfo::COMMENT && |
310 mode != RelocInfo::POSITION && | 310 mode != RelocInfo::POSITION && |
311 mode != RelocInfo::STATEMENT_POSITION && | 311 mode != RelocInfo::STATEMENT_POSITION && |
312 mode != RelocInfo::CONST_POOL && | 312 mode != RelocInfo::CONST_POOL && |
313 mode != RelocInfo::VENEER_POOL && | 313 mode != RelocInfo::VENEER_POOL && |
314 mode != RelocInfo::CODE_AGE_SEQUENCE); | 314 mode != RelocInfo::CODE_AGE_SEQUENCE && |
315 | 315 mode != RelocInfo::DEOPT_REASON); |
316 uint64_t raw_data = static_cast<uint64_t>(data); | 316 uint64_t raw_data = static_cast<uint64_t>(data); |
317 int offset = assm_->pc_offset(); | 317 int offset = assm_->pc_offset(); |
318 if (IsEmpty()) { | 318 if (IsEmpty()) { |
319 first_use_ = offset; | 319 first_use_ = offset; |
320 } | 320 } |
321 | 321 |
322 std::pair<uint64_t, int> entry = std::make_pair(raw_data, offset); | 322 std::pair<uint64_t, int> entry = std::make_pair(raw_data, offset); |
323 if (CanBeShared(mode)) { | 323 if (CanBeShared(mode)) { |
324 shared_entries_.insert(entry); | 324 shared_entries_.insert(entry); |
325 if (shared_entries_.count(entry.first) == 1) { | 325 if (shared_entries_.count(entry.first) == 1) { |
(...skipping 2515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2841 // Pending relocation entries are also relative, no need to relocate. | 2841 // Pending relocation entries are also relative, no need to relocate. |
2842 } | 2842 } |
2843 | 2843 |
2844 | 2844 |
2845 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 2845 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
2846 // We do not try to reuse pool constants. | 2846 // We do not try to reuse pool constants. |
2847 RelocInfo rinfo(reinterpret_cast<byte*>(pc_), rmode, data, NULL); | 2847 RelocInfo rinfo(reinterpret_cast<byte*>(pc_), rmode, data, NULL); |
2848 if (((rmode >= RelocInfo::JS_RETURN) && | 2848 if (((rmode >= RelocInfo::JS_RETURN) && |
2849 (rmode <= RelocInfo::DEBUG_BREAK_SLOT)) || | 2849 (rmode <= RelocInfo::DEBUG_BREAK_SLOT)) || |
2850 (rmode == RelocInfo::CONST_POOL) || | 2850 (rmode == RelocInfo::CONST_POOL) || |
2851 (rmode == RelocInfo::VENEER_POOL)) { | 2851 (rmode == RelocInfo::VENEER_POOL) || |
| 2852 (rmode == RelocInfo::DEOPT_REASON)) { |
2852 // Adjust code for new modes. | 2853 // Adjust code for new modes. |
2853 DCHECK(RelocInfo::IsDebugBreakSlot(rmode) | 2854 DCHECK(RelocInfo::IsDebugBreakSlot(rmode) |
2854 || RelocInfo::IsJSReturn(rmode) | 2855 || RelocInfo::IsJSReturn(rmode) |
2855 || RelocInfo::IsComment(rmode) | 2856 || RelocInfo::IsComment(rmode) |
| 2857 || RelocInfo::IsDeoptReason(rmode) |
2856 || RelocInfo::IsPosition(rmode) | 2858 || RelocInfo::IsPosition(rmode) |
2857 || RelocInfo::IsConstPool(rmode) | 2859 || RelocInfo::IsConstPool(rmode) |
2858 || RelocInfo::IsVeneerPool(rmode)); | 2860 || RelocInfo::IsVeneerPool(rmode)); |
2859 // These modes do not need an entry in the constant pool. | 2861 // These modes do not need an entry in the constant pool. |
2860 } else { | 2862 } else { |
2861 constpool_.RecordEntry(data, rmode); | 2863 constpool_.RecordEntry(data, rmode); |
2862 // Make sure the constant pool is not emitted in place of the next | 2864 // Make sure the constant pool is not emitted in place of the next |
2863 // instruction for which we just recorded relocation info. | 2865 // instruction for which we just recorded relocation info. |
2864 BlockConstPoolFor(1); | 2866 BlockConstPoolFor(1); |
2865 } | 2867 } |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3155 movz(scratch, (target_offset >> 16) & 0xFFFF, 16); | 3157 movz(scratch, (target_offset >> 16) & 0xFFFF, 16); |
3156 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); | 3158 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); |
3157 DCHECK((target_offset >> 48) == 0); | 3159 DCHECK((target_offset >> 48) == 0); |
3158 add(rd, rd, scratch); | 3160 add(rd, rd, scratch); |
3159 } | 3161 } |
3160 | 3162 |
3161 | 3163 |
3162 } } // namespace v8::internal | 3164 } } // namespace v8::internal |
3163 | 3165 |
3164 #endif // V8_TARGET_ARCH_ARM64 | 3166 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |