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

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

Issue 2062003002: [wasm] Relocatable Globals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: {float|double}_t -> {float|double} 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/ia32/assembler-ia32.cc ('k') | src/mips64/assembler-mips64.cc » ('j') | 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 are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 bool RelocInfo::IsInConstantPool() { 188 bool RelocInfo::IsInConstantPool() {
189 return false; 189 return false;
190 } 190 }
191 191
192 Address RelocInfo::wasm_memory_reference() { 192 Address RelocInfo::wasm_memory_reference() {
193 DCHECK(IsWasmMemoryReference(rmode_)); 193 DCHECK(IsWasmMemoryReference(rmode_));
194 return Assembler::target_address_at(pc_, host_); 194 return Assembler::target_address_at(pc_, host_);
195 } 195 }
196 196
197 Address RelocInfo::wasm_global_reference() {
198 DCHECK(IsWasmGlobalReference(rmode_));
199 return Assembler::target_address_at(pc_, host_);
200 }
201
197 uint32_t RelocInfo::wasm_memory_size_reference() { 202 uint32_t RelocInfo::wasm_memory_size_reference() {
198 DCHECK(IsWasmMemorySizeReference(rmode_)); 203 DCHECK(IsWasmMemorySizeReference(rmode_));
199 return reinterpret_cast<uint32_t>(Assembler::target_address_at(pc_, host_)); 204 return reinterpret_cast<uint32_t>(Assembler::target_address_at(pc_, host_));
200 } 205 }
201 206
202 void RelocInfo::update_wasm_memory_reference( 207 void RelocInfo::update_wasm_memory_reference(
203 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, 208 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size,
204 ICacheFlushMode icache_flush_mode) { 209 ICacheFlushMode icache_flush_mode) {
205 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); 210 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_));
206 if (IsWasmMemoryReference(rmode_)) { 211 if (IsWasmMemoryReference(rmode_)) {
(...skipping 12 matching lines...) Expand all
219 new_size + (wasm_memory_size_reference() - old_size); 224 new_size + (wasm_memory_size_reference() - old_size);
220 DCHECK(updated_size_reference <= new_size); 225 DCHECK(updated_size_reference <= new_size);
221 Assembler::set_target_address_at( 226 Assembler::set_target_address_at(
222 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), 227 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference),
223 icache_flush_mode); 228 icache_flush_mode);
224 } else { 229 } else {
225 UNREACHABLE(); 230 UNREACHABLE();
226 } 231 }
227 } 232 }
228 233
234 void RelocInfo::update_wasm_global_reference(
235 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) {
236 DCHECK(IsWasmGlobalReference(rmode_));
237 Address updated_global_reference;
238 DCHECK(old_base <= wasm_global_reference());
239 updated_global_reference = new_base + (wasm_global_reference() - old_base);
240 DCHECK(new_base <= updated_global_reference);
241 Assembler::set_target_address_at(isolate_, pc_, host_,
242 updated_global_reference, icache_flush_mode);
243 }
244
229 // ----------------------------------------------------------------------------- 245 // -----------------------------------------------------------------------------
230 // Implementation of Operand and MemOperand. 246 // Implementation of Operand and MemOperand.
231 // See assembler-mips-inl.h for inlined constructors. 247 // See assembler-mips-inl.h for inlined constructors.
232 248
233 Operand::Operand(Handle<Object> handle) { 249 Operand::Operand(Handle<Object> handle) {
234 AllowDeferredHandleDereference using_raw_address; 250 AllowDeferredHandleDereference using_raw_address;
235 rm_ = no_reg; 251 rm_ = no_reg;
236 // Verify all Objects referred by code are NOT in new space. 252 // Verify all Objects referred by code are NOT in new space.
237 Object* obj = *handle; 253 Object* obj = *handle;
238 if (obj->IsHeapObject()) { 254 if (obj->IsHeapObject()) {
(...skipping 2966 matching lines...) Expand 10 before | Expand all | Expand 10 after
3205 3221
3206 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 3222 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
3207 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); 3223 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t));
3208 } 3224 }
3209 } 3225 }
3210 3226
3211 } // namespace internal 3227 } // namespace internal
3212 } // namespace v8 3228 } // namespace v8
3213 3229
3214 #endif // V8_TARGET_ARCH_MIPS 3230 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/mips64/assembler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698