| 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 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 DCHECK(IsWasmGlobalReference(rmode_)); | 176 DCHECK(IsWasmGlobalReference(rmode_)); |
| 177 return Assembler::target_address_at(pc_, host_); | 177 return Assembler::target_address_at(pc_, host_); |
| 178 } | 178 } |
| 179 | 179 |
| 180 uint32_t RelocInfo::wasm_memory_size_reference() { | 180 uint32_t RelocInfo::wasm_memory_size_reference() { |
| 181 DCHECK(IsWasmMemorySizeReference(rmode_)); | 181 DCHECK(IsWasmMemorySizeReference(rmode_)); |
| 182 return static_cast<uint32_t>( | 182 return static_cast<uint32_t>( |
| 183 reinterpret_cast<intptr_t>((Assembler::target_address_at(pc_, host_)))); | 183 reinterpret_cast<intptr_t>((Assembler::target_address_at(pc_, host_)))); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void RelocInfo::update_wasm_memory_reference( | 186 void RelocInfo::unchecked_update_wasm_memory_reference( |
| 187 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, | 187 Address address, ICacheFlushMode flush_mode) { |
| 188 ICacheFlushMode icache_flush_mode) { | 188 Assembler::set_target_address_at(isolate_, pc_, host_, address, flush_mode); |
| 189 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); | |
| 190 if (IsWasmMemoryReference(rmode_)) { | |
| 191 Address updated_memory_reference; | |
| 192 DCHECK(old_base <= wasm_memory_reference() && | |
| 193 wasm_memory_reference() < old_base + old_size); | |
| 194 updated_memory_reference = new_base + (wasm_memory_reference() - old_base); | |
| 195 DCHECK(new_base <= updated_memory_reference && | |
| 196 updated_memory_reference < new_base + new_size); | |
| 197 Assembler::set_target_address_at( | |
| 198 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode); | |
| 199 } else if (IsWasmMemorySizeReference(rmode_)) { | |
| 200 uint32_t updated_size_reference; | |
| 201 DCHECK(wasm_memory_size_reference() <= old_size); | |
| 202 updated_size_reference = | |
| 203 new_size + (wasm_memory_size_reference() - old_size); | |
| 204 DCHECK(updated_size_reference <= new_size); | |
| 205 Assembler::set_target_address_at( | |
| 206 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), | |
| 207 icache_flush_mode); | |
| 208 } else { | |
| 209 UNREACHABLE(); | |
| 210 } | |
| 211 } | 189 } |
| 212 | 190 |
| 213 void RelocInfo::update_wasm_global_reference( | 191 void RelocInfo::unchecked_update_wasm_memory_size(uint32_t size, |
| 214 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) { | 192 ICacheFlushMode 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_, | 193 Assembler::set_target_address_at(isolate_, pc_, host_, |
| 221 updated_global_reference, icache_flush_mode); | 194 reinterpret_cast<Address>(size), flush_mode); |
| 222 } | 195 } |
| 223 | 196 |
| 224 // ----------------------------------------------------------------------------- | 197 // ----------------------------------------------------------------------------- |
| 225 // Implementation of Operand and MemOperand. | 198 // Implementation of Operand and MemOperand. |
| 226 // See assembler-mips-inl.h for inlined constructors. | 199 // See assembler-mips-inl.h for inlined constructors. |
| 227 | 200 |
| 228 Operand::Operand(Handle<Object> handle) { | 201 Operand::Operand(Handle<Object> handle) { |
| 229 AllowDeferredHandleDereference using_raw_address; | 202 AllowDeferredHandleDereference using_raw_address; |
| 230 rm_ = no_reg; | 203 rm_ = no_reg; |
| 231 // Verify all Objects referred by code are NOT in new space. | 204 // Verify all Objects referred by code are NOT in new space. |
| (...skipping 3234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3466 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3439 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
| 3467 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); | 3440 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); |
| 3468 } | 3441 } |
| 3469 } | 3442 } |
| 3470 | 3443 |
| 3471 | 3444 |
| 3472 } // namespace internal | 3445 } // namespace internal |
| 3473 } // namespace v8 | 3446 } // namespace v8 |
| 3474 | 3447 |
| 3475 #endif // V8_TARGET_ARCH_MIPS64 | 3448 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |