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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 return static_cast<uint32_t>( | 165 return static_cast<uint32_t>( |
166 reinterpret_cast<intptr_t>(Assembler::target_address_at(pc_, host_))); | 166 reinterpret_cast<intptr_t>(Assembler::target_address_at(pc_, host_))); |
167 } | 167 } |
168 | 168 |
169 Address RelocInfo::wasm_global_reference() { | 169 Address RelocInfo::wasm_global_reference() { |
170 DCHECK(IsWasmGlobalReference(rmode_)); | 170 DCHECK(IsWasmGlobalReference(rmode_)); |
171 return Assembler::target_address_at(pc_, host_); | 171 return Assembler::target_address_at(pc_, host_); |
172 } | 172 } |
173 | 173 |
174 | 174 |
175 void RelocInfo::update_wasm_memory_reference( | 175 void RelocInfo::unchecked_update_wasm_memory_reference( |
176 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, | 176 Address address, ICacheFlushMode flush_mode) { |
177 ICacheFlushMode icache_flush_mode) { | 177 Assembler::set_target_address_at(isolate_, pc_, host_, address, flush_mode); |
178 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); | |
179 if (IsWasmMemoryReference(rmode_)) { | |
180 Address updated_memory_reference; | |
181 DCHECK(old_base <= wasm_memory_reference() && | |
182 wasm_memory_reference() < old_base + old_size); | |
183 updated_memory_reference = new_base + (wasm_memory_reference() - old_base); | |
184 DCHECK(new_base <= updated_memory_reference && | |
185 updated_memory_reference < new_base + new_size); | |
186 Assembler::set_target_address_at( | |
187 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode); | |
188 } else if (IsWasmMemorySizeReference(rmode_)) { | |
189 uint32_t updated_size_reference; | |
190 DCHECK(wasm_memory_size_reference() <= old_size); | |
191 updated_size_reference = | |
192 new_size + (wasm_memory_size_reference() - old_size); | |
193 DCHECK(updated_size_reference <= new_size); | |
194 Assembler::set_target_address_at( | |
195 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), | |
196 icache_flush_mode); | |
197 } else { | |
198 UNREACHABLE(); | |
199 } | |
200 } | 178 } |
201 | 179 |
202 void RelocInfo::update_wasm_global_reference( | 180 void RelocInfo::unchecked_update_wasm_memory_size(uint32_t size, |
203 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) { | 181 ICacheFlushMode flush_mode) { |
204 DCHECK(IsWasmGlobalReference(rmode_)); | 182 Assembler::set_target_address_at(isolate_, pc_, host_, |
205 Address updated_reference; | 183 reinterpret_cast<Address>(size), flush_mode); |
206 DCHECK(old_base <= wasm_global_reference()); | |
207 updated_reference = new_base + (wasm_global_reference() - old_base); | |
208 DCHECK(new_base <= updated_reference); | |
209 Assembler::set_target_address_at(isolate_, pc_, host_, updated_reference, | |
210 icache_flush_mode); | |
211 } | 184 } |
212 | 185 |
213 // ----------------------------------------------------------------------------- | 186 // ----------------------------------------------------------------------------- |
214 // Implementation of Operand and MemOperand | 187 // Implementation of Operand and MemOperand |
215 // See assembler-ppc-inl.h for inlined constructors | 188 // See assembler-ppc-inl.h for inlined constructors |
216 | 189 |
217 Operand::Operand(Handle<Object> handle) { | 190 Operand::Operand(Handle<Object> handle) { |
218 AllowDeferredHandleDereference using_raw_address; | 191 AllowDeferredHandleDereference using_raw_address; |
219 rm_ = no_reg; | 192 rm_ = no_reg; |
220 // Verify all Objects referred by code are NOT in new space. | 193 // Verify all Objects referred by code are NOT in new space. |
(...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2530 | 2503 |
2531 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_); | 2504 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_); |
2532 } | 2505 } |
2533 } | 2506 } |
2534 | 2507 |
2535 | 2508 |
2536 } // namespace internal | 2509 } // namespace internal |
2537 } // namespace v8 | 2510 } // namespace v8 |
2538 | 2511 |
2539 #endif // V8_TARGET_ARCH_PPC | 2512 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |