Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: src/ppc/assembler-ppc.cc

Issue 2069163003: PPC: [wasm] Relocatable Globals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ppc/code-generator-ppc.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 DCHECK(IsWasmMemoryReference(rmode_)); 159 DCHECK(IsWasmMemoryReference(rmode_));
160 return Assembler::target_address_at(pc_, host_); 160 return Assembler::target_address_at(pc_, host_);
161 } 161 }
162 162
163 uint32_t RelocInfo::wasm_memory_size_reference() { 163 uint32_t RelocInfo::wasm_memory_size_reference() {
164 DCHECK(IsWasmMemorySizeReference(rmode_)); 164 DCHECK(IsWasmMemorySizeReference(rmode_));
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() {
170 DCHECK(IsWasmGlobalReference(rmode_));
171 return Assembler::target_address_at(pc_, host_);
172 }
173
174
169 void RelocInfo::update_wasm_memory_reference( 175 void RelocInfo::update_wasm_memory_reference(
170 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, 176 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size,
171 ICacheFlushMode icache_flush_mode) { 177 ICacheFlushMode icache_flush_mode) {
172 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); 178 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_));
173 if (IsWasmMemoryReference(rmode_)) { 179 if (IsWasmMemoryReference(rmode_)) {
174 Address updated_memory_reference; 180 Address updated_memory_reference;
175 DCHECK(old_base <= wasm_memory_reference() && 181 DCHECK(old_base <= wasm_memory_reference() &&
176 wasm_memory_reference() < old_base + old_size); 182 wasm_memory_reference() < old_base + old_size);
177 updated_memory_reference = new_base + (wasm_memory_reference() - old_base); 183 updated_memory_reference = new_base + (wasm_memory_reference() - old_base);
178 DCHECK(new_base <= updated_memory_reference && 184 DCHECK(new_base <= updated_memory_reference &&
179 updated_memory_reference < new_base + new_size); 185 updated_memory_reference < new_base + new_size);
180 Assembler::set_target_address_at( 186 Assembler::set_target_address_at(
181 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode); 187 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode);
182 } else if (IsWasmMemorySizeReference(rmode_)) { 188 } else if (IsWasmMemorySizeReference(rmode_)) {
183 uint32_t updated_size_reference; 189 uint32_t updated_size_reference;
184 DCHECK(wasm_memory_size_reference() <= old_size); 190 DCHECK(wasm_memory_size_reference() <= old_size);
185 updated_size_reference = 191 updated_size_reference =
186 new_size + (wasm_memory_size_reference() - old_size); 192 new_size + (wasm_memory_size_reference() - old_size);
187 DCHECK(updated_size_reference <= new_size); 193 DCHECK(updated_size_reference <= new_size);
188 Assembler::set_target_address_at( 194 Assembler::set_target_address_at(
189 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), 195 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference),
190 icache_flush_mode); 196 icache_flush_mode);
191 } else { 197 } else {
192 UNREACHABLE(); 198 UNREACHABLE();
193 } 199 }
194 } 200 }
195 201
202 void RelocInfo::update_wasm_global_reference(
203 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) {
204 DCHECK(IsWasmGlobalReference(rmode_));
205 Address updated_reference;
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 }
212
196 // ----------------------------------------------------------------------------- 213 // -----------------------------------------------------------------------------
197 // Implementation of Operand and MemOperand 214 // Implementation of Operand and MemOperand
198 // See assembler-ppc-inl.h for inlined constructors 215 // See assembler-ppc-inl.h for inlined constructors
199 216
200 Operand::Operand(Handle<Object> handle) { 217 Operand::Operand(Handle<Object> handle) {
201 AllowDeferredHandleDereference using_raw_address; 218 AllowDeferredHandleDereference using_raw_address;
202 rm_ = no_reg; 219 rm_ = no_reg;
203 // Verify all Objects referred by code are NOT in new space. 220 // Verify all Objects referred by code are NOT in new space.
204 Object* obj = *handle; 221 Object* obj = *handle;
205 if (obj->IsHeapObject()) { 222 if (obj->IsHeapObject()) {
(...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 2538
2522 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_); 2539 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_);
2523 } 2540 }
2524 } 2541 }
2525 2542
2526 2543
2527 } // namespace internal 2544 } // namespace internal
2528 } // namespace v8 2545 } // namespace v8
2529 2546
2530 #endif // V8_TARGET_ARCH_PPC 2547 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/compiler/ppc/code-generator-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698