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 } | |
74 | 78 |
75 Address RelocInfo::target_address_address() { | 79 Address RelocInfo::target_address_address() { |
76 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 80 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
77 || rmode_ == EMBEDDED_OBJECT | 81 || rmode_ == EMBEDDED_OBJECT |
78 || rmode_ == EXTERNAL_REFERENCE); | 82 || rmode_ == EXTERNAL_REFERENCE); |
79 if (FLAG_enable_embedded_constant_pool || | 83 if (FLAG_enable_embedded_constant_pool || |
80 Assembler::IsMovW(Memory::int32_at(pc_))) { | 84 Assembler::IsMovW(Memory::int32_at(pc_))) { |
81 // We return the PC for embedded constant pool since this function is used | 85 // We return the PC for embedded constant pool since this function is used |
82 // by the serializer and expects the address to reside within the code | 86 // by the serializer and expects the address to reside within the code |
83 // object. | 87 // object. |
(...skipping 23 matching lines...) Expand all Loading... | |
107 Assembler::set_target_address_at(isolate_, pc_, host_, target, | 111 Assembler::set_target_address_at(isolate_, pc_, host_, target, |
108 icache_flush_mode); | 112 icache_flush_mode); |
109 if (write_barrier_mode == UPDATE_WRITE_BARRIER && | 113 if (write_barrier_mode == UPDATE_WRITE_BARRIER && |
110 host() != NULL && IsCodeTarget(rmode_)) { | 114 host() != NULL && IsCodeTarget(rmode_)) { |
111 Object* target_code = Code::GetCodeFromTargetAddress(target); | 115 Object* target_code = Code::GetCodeFromTargetAddress(target); |
112 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( | 116 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
113 host(), this, HeapObject::cast(target_code)); | 117 host(), this, HeapObject::cast(target_code)); |
114 } | 118 } |
115 } | 119 } |
116 | 120 |
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); | |
Yang
2016/03/15 07:44:18
Should this really be a "less-equals" or just a "l
gdeepti1
2016/03/16 06:05:26
Fixed below and on other platform ports.
| |
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 } | |
117 | 133 |
118 Object* RelocInfo::target_object() { | 134 Object* RelocInfo::target_object() { |
119 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 135 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
120 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_, host_)); | 136 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_, host_)); |
121 } | 137 } |
122 | 138 |
123 | 139 |
124 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { | 140 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { |
125 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 141 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
126 return Handle<Object>(reinterpret_cast<Object**>( | 142 return Handle<Object>(reinterpret_cast<Object**>( |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
603 Assembler::FlushICache(isolate, pc, 4 * kInstrSize); | 619 Assembler::FlushICache(isolate, pc, 4 * kInstrSize); |
604 } | 620 } |
605 } | 621 } |
606 } | 622 } |
607 | 623 |
608 | 624 |
609 } // namespace internal | 625 } // namespace internal |
610 } // namespace v8 | 626 } // namespace v8 |
611 | 627 |
612 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 628 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
OLD | NEW |