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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // specially coded on MIPS means that it is a lui/ori instruction, and that is | 182 // specially coded on MIPS means that it is a lui/ori instruction, and that is |
183 // always the case inside code objects. | 183 // always the case inside code objects. |
184 return true; | 184 return true; |
185 } | 185 } |
186 | 186 |
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() { |
| 193 DCHECK(IsWasmMemoryReference(rmode_)); |
| 194 return Assembler::target_address_at(pc_, host_); |
| 195 } |
| 196 |
| 197 uint32_t RelocInfo::wasm_memory_size_reference() { |
| 198 DCHECK(IsWasmMemorySizeReference(rmode_)); |
| 199 return reinterpret_cast<uint32_t>(Assembler::target_address_at(pc_, host_)); |
| 200 } |
| 201 |
| 202 void RelocInfo::update_wasm_memory_reference( |
| 203 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
| 204 ICacheFlushMode icache_flush_mode) { |
| 205 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); |
| 206 if (IsWasmMemoryReference(rmode_)) { |
| 207 Address updated_memory_reference; |
| 208 DCHECK(old_base <= wasm_memory_reference() && |
| 209 wasm_memory_reference() < old_base + old_size); |
| 210 updated_memory_reference = new_base + (wasm_memory_reference() - old_base); |
| 211 DCHECK(new_base <= updated_memory_reference && |
| 212 updated_memory_reference < new_base + new_size); |
| 213 Assembler::set_target_address_at( |
| 214 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode); |
| 215 } else if (IsWasmMemorySizeReference(rmode_)) { |
| 216 uint32_t updated_size_reference; |
| 217 DCHECK(wasm_memory_size_reference() <= old_size); |
| 218 updated_size_reference = |
| 219 new_size + (wasm_memory_size_reference() - old_size); |
| 220 DCHECK(updated_size_reference <= new_size); |
| 221 Assembler::set_target_address_at( |
| 222 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), |
| 223 icache_flush_mode); |
| 224 } else { |
| 225 UNREACHABLE(); |
| 226 } |
| 227 } |
192 | 228 |
193 // ----------------------------------------------------------------------------- | 229 // ----------------------------------------------------------------------------- |
194 // Implementation of Operand and MemOperand. | 230 // Implementation of Operand and MemOperand. |
195 // See assembler-mips-inl.h for inlined constructors. | 231 // See assembler-mips-inl.h for inlined constructors. |
196 | 232 |
197 Operand::Operand(Handle<Object> handle) { | 233 Operand::Operand(Handle<Object> handle) { |
198 AllowDeferredHandleDereference using_raw_address; | 234 AllowDeferredHandleDereference using_raw_address; |
199 rm_ = no_reg; | 235 rm_ = no_reg; |
200 // Verify all Objects referred by code are NOT in new space. | 236 // Verify all Objects referred by code are NOT in new space. |
201 Object* obj = *handle; | 237 Object* obj = *handle; |
(...skipping 2967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3169 | 3205 |
3170 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3206 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
3171 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); | 3207 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); |
3172 } | 3208 } |
3173 } | 3209 } |
3174 | 3210 |
3175 } // namespace internal | 3211 } // namespace internal |
3176 } // namespace v8 | 3212 } // namespace v8 |
3177 | 3213 |
3178 #endif // V8_TARGET_ARCH_MIPS | 3214 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |