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

Side by Side Diff: src/mips64/assembler-mips64.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/mips/assembler-mips.cc ('k') | src/x64/assembler-x64.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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 bool RelocInfo::IsInConstantPool() { 166 bool RelocInfo::IsInConstantPool() {
167 return false; 167 return false;
168 } 168 }
169 169
170 Address RelocInfo::wasm_memory_reference() { 170 Address RelocInfo::wasm_memory_reference() {
171 DCHECK(IsWasmMemoryReference(rmode_)); 171 DCHECK(IsWasmMemoryReference(rmode_));
172 return Assembler::target_address_at(pc_, host_); 172 return Assembler::target_address_at(pc_, host_);
173 } 173 }
174 174
175 Address RelocInfo::wasm_global_reference() {
176 DCHECK(IsWasmGlobalReference(rmode_));
177 return Assembler::target_address_at(pc_, host_);
178 }
179
175 uint32_t RelocInfo::wasm_memory_size_reference() { 180 uint32_t RelocInfo::wasm_memory_size_reference() {
176 DCHECK(IsWasmMemorySizeReference(rmode_)); 181 DCHECK(IsWasmMemorySizeReference(rmode_));
177 return static_cast<uint32_t>( 182 return static_cast<uint32_t>(
178 reinterpret_cast<intptr_t>((Assembler::target_address_at(pc_, host_)))); 183 reinterpret_cast<intptr_t>((Assembler::target_address_at(pc_, host_))));
179 } 184 }
180 185
181 void RelocInfo::update_wasm_memory_reference( 186 void RelocInfo::update_wasm_memory_reference(
182 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, 187 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size,
183 ICacheFlushMode icache_flush_mode) { 188 ICacheFlushMode icache_flush_mode) {
184 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); 189 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_));
(...skipping 13 matching lines...) Expand all
198 new_size + (wasm_memory_size_reference() - old_size); 203 new_size + (wasm_memory_size_reference() - old_size);
199 DCHECK(updated_size_reference <= new_size); 204 DCHECK(updated_size_reference <= new_size);
200 Assembler::set_target_address_at( 205 Assembler::set_target_address_at(
201 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), 206 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference),
202 icache_flush_mode); 207 icache_flush_mode);
203 } else { 208 } else {
204 UNREACHABLE(); 209 UNREACHABLE();
205 } 210 }
206 } 211 }
207 212
213 void RelocInfo::update_wasm_global_reference(
214 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) {
215 DCHECK(IsWasmGlobalReference(rmode_));
216 Address updated_global_reference;
217 DCHECK(old_base <= wasm_global_reference());
218 updated_global_reference = new_base + (wasm_global_reference() - old_base);
219 DCHECK(new_base <= updated_global_reference);
220 Assembler::set_target_address_at(isolate_, pc_, host_,
221 updated_global_reference, icache_flush_mode);
222 }
223
208 // ----------------------------------------------------------------------------- 224 // -----------------------------------------------------------------------------
209 // Implementation of Operand and MemOperand. 225 // Implementation of Operand and MemOperand.
210 // See assembler-mips-inl.h for inlined constructors. 226 // See assembler-mips-inl.h for inlined constructors.
211 227
212 Operand::Operand(Handle<Object> handle) { 228 Operand::Operand(Handle<Object> handle) {
213 AllowDeferredHandleDereference using_raw_address; 229 AllowDeferredHandleDereference using_raw_address;
214 rm_ = no_reg; 230 rm_ = no_reg;
215 // Verify all Objects referred by code are NOT in new space. 231 // Verify all Objects referred by code are NOT in new space.
216 Object* obj = *handle; 232 Object* obj = *handle;
217 if (obj->IsHeapObject()) { 233 if (obj->IsHeapObject()) {
(...skipping 3232 matching lines...) Expand 10 before | Expand all | Expand 10 after
3450 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 3466 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
3451 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); 3467 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize);
3452 } 3468 }
3453 } 3469 }
3454 3470
3455 3471
3456 } // namespace internal 3472 } // namespace internal
3457 } // namespace v8 3473 } // namespace v8
3458 3474
3459 #endif // V8_TARGET_ARCH_MIPS64 3475 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698