| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // We do not use pc relative addressing on ARM, so there is | 64 // We do not use pc relative addressing on ARM, so there is |
| 65 // nothing else to do. | 65 // nothing else to do. |
| 66 } | 66 } |
| 67 | 67 |
| 68 | 68 |
| 69 Address RelocInfo::target_address() { | 69 Address RelocInfo::target_address() { |
| 70 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); | 70 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); |
| 71 return Assembler::target_address_at(pc_, host_); | 71 return Assembler::target_address_at(pc_, host_); |
| 72 } | 72 } |
| 73 | 73 |
| 74 Address RelocInfo::wasm_memory_reference() { | |
| 75 DCHECK(IsWasmMemoryReference(rmode_)); | |
| 76 return Assembler::target_address_at(pc_, host_); | |
| 77 } | |
| 78 | |
| 79 Address RelocInfo::target_address_address() { | 74 Address RelocInfo::target_address_address() { |
| 80 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 75 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
| 81 || rmode_ == EMBEDDED_OBJECT | 76 || rmode_ == EMBEDDED_OBJECT |
| 82 || rmode_ == EXTERNAL_REFERENCE); | 77 || rmode_ == EXTERNAL_REFERENCE); |
| 83 if (FLAG_enable_embedded_constant_pool || | 78 if (FLAG_enable_embedded_constant_pool || |
| 84 Assembler::IsMovW(Memory::int32_at(pc_))) { | 79 Assembler::IsMovW(Memory::int32_at(pc_))) { |
| 85 // We return the PC for embedded constant pool since this function is used | 80 // We return the PC for embedded constant pool since this function is used |
| 86 // by the serializer and expects the address to reside within the code | 81 // by the serializer and expects the address to reside within the code |
| 87 // object. | 82 // object. |
| 88 return reinterpret_cast<Address>(pc_); | 83 return reinterpret_cast<Address>(pc_); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 111 Assembler::set_target_address_at(isolate_, pc_, host_, target, | 106 Assembler::set_target_address_at(isolate_, pc_, host_, target, |
| 112 icache_flush_mode); | 107 icache_flush_mode); |
| 113 if (write_barrier_mode == UPDATE_WRITE_BARRIER && | 108 if (write_barrier_mode == UPDATE_WRITE_BARRIER && |
| 114 host() != NULL && IsCodeTarget(rmode_)) { | 109 host() != NULL && IsCodeTarget(rmode_)) { |
| 115 Object* target_code = Code::GetCodeFromTargetAddress(target); | 110 Object* target_code = Code::GetCodeFromTargetAddress(target); |
| 116 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( | 111 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
| 117 host(), this, HeapObject::cast(target_code)); | 112 host(), this, HeapObject::cast(target_code)); |
| 118 } | 113 } |
| 119 } | 114 } |
| 120 | 115 |
| 121 void RelocInfo::update_wasm_memory_reference( | |
| 122 Address old_base, Address new_base, size_t old_size, size_t new_size, | |
| 123 ICacheFlushMode icache_flush_mode) { | |
| 124 DCHECK(IsWasmMemoryReference(rmode_)); | |
| 125 DCHECK(old_base <= wasm_memory_reference() && | |
| 126 wasm_memory_reference() < old_base + old_size); | |
| 127 Address updated_reference = new_base + (wasm_memory_reference() - old_base); | |
| 128 DCHECK(new_base <= updated_reference && | |
| 129 updated_reference < new_base + new_size); | |
| 130 Assembler::set_target_address_at(isolate_, pc_, host_, updated_reference, | |
| 131 icache_flush_mode); | |
| 132 } | |
| 133 | |
| 134 Object* RelocInfo::target_object() { | 116 Object* RelocInfo::target_object() { |
| 135 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 117 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 136 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_, host_)); | 118 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_, host_)); |
| 137 } | 119 } |
| 138 | 120 |
| 139 | 121 |
| 140 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { | 122 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { |
| 141 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 123 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 142 return Handle<Object>(reinterpret_cast<Object**>( | 124 return Handle<Object>(reinterpret_cast<Object**>( |
| 143 Assembler::target_address_at(pc_, host_))); | 125 Assembler::target_address_at(pc_, host_))); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 Assembler::FlushICache(isolate, pc, 4 * kInstrSize); | 601 Assembler::FlushICache(isolate, pc, 4 * kInstrSize); |
| 620 } | 602 } |
| 621 } | 603 } |
| 622 } | 604 } |
| 623 | 605 |
| 624 | 606 |
| 625 } // namespace internal | 607 } // namespace internal |
| 626 } // namespace v8 | 608 } // namespace v8 |
| 627 | 609 |
| 628 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 610 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
| OLD | NEW |