Chromium Code Reviews| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 if (RelocInfo::IsInternalReference(rmode_)) { | 59 if (RelocInfo::IsInternalReference(rmode_)) { |
| 60 // absolute code pointer inside code object moves with the code object. | 60 // absolute code pointer inside code object moves with the code object. |
| 61 int32_t* p = reinterpret_cast<int32_t*>(pc_); | 61 int32_t* p = reinterpret_cast<int32_t*>(pc_); |
| 62 *p += delta; // relocate entry | 62 *p += delta; // relocate entry |
| 63 } | 63 } |
| 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() { |
|
titzer
2016/03/03 18:11:59
I think we should add new methods to deal specific
gdeepti1
2016/03/03 22:59:15
Done.
| |
| 70 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); | 70 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || |
| 71 IsWasmCodeEntry(rmode_)); | |
| 71 return Assembler::target_address_at(pc_, host_); | 72 return Assembler::target_address_at(pc_, host_); |
| 72 } | 73 } |
| 73 | 74 |
| 74 | 75 |
| 75 Address RelocInfo::target_address_address() { | 76 Address RelocInfo::target_address_address() { |
| 76 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 77 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
| 77 || rmode_ == EMBEDDED_OBJECT | 78 || rmode_ == EMBEDDED_OBJECT |
| 78 || rmode_ == EXTERNAL_REFERENCE); | 79 || rmode_ == EXTERNAL_REFERENCE); |
| 79 if (FLAG_enable_embedded_constant_pool || | 80 if (FLAG_enable_embedded_constant_pool || |
| 80 Assembler::IsMovW(Memory::int32_at(pc_))) { | 81 Assembler::IsMovW(Memory::int32_at(pc_))) { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 93 DCHECK(IsInConstantPool()); | 94 DCHECK(IsInConstantPool()); |
| 94 return Assembler::constant_pool_entry_address(pc_, host_->constant_pool()); | 95 return Assembler::constant_pool_entry_address(pc_, host_->constant_pool()); |
| 95 } | 96 } |
| 96 | 97 |
| 97 | 98 |
| 98 int RelocInfo::target_address_size() { | 99 int RelocInfo::target_address_size() { |
| 99 return kPointerSize; | 100 return kPointerSize; |
| 100 } | 101 } |
| 101 | 102 |
| 102 | 103 |
| 103 void RelocInfo::set_target_address(Address target, | 104 void RelocInfo::set_target_address(Address target, |
|
titzer
2016/03/03 18:11:59
For the wasm memory reference version of this, I t
gdeepti1
2016/03/03 22:59:15
Added a wasm memory reference version for now. I'l
| |
| 104 WriteBarrierMode write_barrier_mode, | 105 WriteBarrierMode write_barrier_mode, |
| 105 ICacheFlushMode icache_flush_mode) { | 106 ICacheFlushMode icache_flush_mode) { |
| 106 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); | 107 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || |
| 108 IsWasmCodeEntry(rmode_)); | |
| 107 Assembler::set_target_address_at(isolate_, pc_, host_, target, | 109 Assembler::set_target_address_at(isolate_, pc_, host_, target, |
| 108 icache_flush_mode); | 110 icache_flush_mode); |
| 109 if (write_barrier_mode == UPDATE_WRITE_BARRIER && | 111 if (write_barrier_mode == UPDATE_WRITE_BARRIER && |
| 110 host() != NULL && IsCodeTarget(rmode_)) { | 112 host() != NULL && IsCodeTarget(rmode_)) { |
| 111 Object* target_code = Code::GetCodeFromTargetAddress(target); | 113 Object* target_code = Code::GetCodeFromTargetAddress(target); |
| 112 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( | 114 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
| 113 host(), this, HeapObject::cast(target_code)); | 115 host(), this, HeapObject::cast(target_code)); |
| 114 } | 116 } |
| 115 } | 117 } |
| 116 | 118 |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 603 Assembler::FlushICache(isolate, pc, 4 * kInstrSize); | 605 Assembler::FlushICache(isolate, pc, 4 * kInstrSize); |
| 604 } | 606 } |
| 605 } | 607 } |
| 606 } | 608 } |
| 607 | 609 |
| 608 | 610 |
| 609 } // namespace internal | 611 } // namespace internal |
| 610 } // namespace v8 | 612 } // namespace v8 |
| 611 | 613 |
| 612 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 614 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
| OLD | NEW |