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

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

Issue 2056633002: [wasm] Separate compilation from instantiation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: feedback 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 Address RelocInfo::wasm_global_reference() { 197 Address RelocInfo::wasm_global_reference() {
198 DCHECK(IsWasmGlobalReference(rmode_)); 198 DCHECK(IsWasmGlobalReference(rmode_));
199 return Assembler::target_address_at(pc_, host_); 199 return Assembler::target_address_at(pc_, host_);
200 } 200 }
201 201
202 uint32_t RelocInfo::wasm_memory_size_reference() { 202 uint32_t RelocInfo::wasm_memory_size_reference() {
203 DCHECK(IsWasmMemorySizeReference(rmode_)); 203 DCHECK(IsWasmMemorySizeReference(rmode_));
204 return reinterpret_cast<uint32_t>(Assembler::target_address_at(pc_, host_)); 204 return reinterpret_cast<uint32_t>(Assembler::target_address_at(pc_, host_));
205 } 205 }
206 206
207 void RelocInfo::update_wasm_memory_reference( 207 void RelocInfo::unchecked_update_wasm_memory_reference(
208 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, 208 Address address, ICacheFlushMode flush_mode) {
209 ICacheFlushMode icache_flush_mode) { 209 Assembler::set_target_address_at(isolate_, pc_, host_, address, flush_mode);
210 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_));
211 if (IsWasmMemoryReference(rmode_)) {
212 Address updated_memory_reference;
213 DCHECK(old_base <= wasm_memory_reference() &&
214 wasm_memory_reference() < old_base + old_size);
215 updated_memory_reference = new_base + (wasm_memory_reference() - old_base);
216 DCHECK(new_base <= updated_memory_reference &&
217 updated_memory_reference < new_base + new_size);
218 Assembler::set_target_address_at(
219 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode);
220 } else if (IsWasmMemorySizeReference(rmode_)) {
221 uint32_t updated_size_reference;
222 DCHECK(wasm_memory_size_reference() <= old_size);
223 updated_size_reference =
224 new_size + (wasm_memory_size_reference() - old_size);
225 DCHECK(updated_size_reference <= new_size);
226 Assembler::set_target_address_at(
227 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference),
228 icache_flush_mode);
229 } else {
230 UNREACHABLE();
231 }
232 } 210 }
233 211
234 void RelocInfo::update_wasm_global_reference( 212 void RelocInfo::unchecked_update_wasm_memory_size(uint32_t size,
235 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) { 213 ICacheFlushMode 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_, 214 Assembler::set_target_address_at(isolate_, pc_, host_,
242 updated_global_reference, icache_flush_mode); 215 reinterpret_cast<Address>(size), flush_mode);
243 } 216 }
244 217
245 // ----------------------------------------------------------------------------- 218 // -----------------------------------------------------------------------------
246 // Implementation of Operand and MemOperand. 219 // Implementation of Operand and MemOperand.
247 // See assembler-mips-inl.h for inlined constructors. 220 // See assembler-mips-inl.h for inlined constructors.
248 221
249 Operand::Operand(Handle<Object> handle) { 222 Operand::Operand(Handle<Object> handle) {
250 AllowDeferredHandleDereference using_raw_address; 223 AllowDeferredHandleDereference using_raw_address;
251 rm_ = no_reg; 224 rm_ = no_reg;
252 // Verify all Objects referred by code are NOT in new space. 225 // Verify all Objects referred by code are NOT in new space.
(...skipping 2968 matching lines...) Expand 10 before | Expand all | Expand 10 after
3221 3194
3222 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 3195 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
3223 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); 3196 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t));
3224 } 3197 }
3225 } 3198 }
3226 3199
3227 } // namespace internal 3200 } // namespace internal
3228 } // namespace v8 3201 } // namespace v8
3229 3202
3230 #endif // V8_TARGET_ARCH_MIPS 3203 #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