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 | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 bool RelocInfo::IsInConstantPool() { | 185 bool RelocInfo::IsInConstantPool() { |
186 return false; | 186 return false; |
187 } | 187 } |
188 | 188 |
189 Address RelocInfo::wasm_memory_reference() { | 189 Address RelocInfo::wasm_memory_reference() { |
190 DCHECK(IsWasmMemoryReference(rmode_)); | 190 DCHECK(IsWasmMemoryReference(rmode_)); |
191 return Memory::Address_at(pc_); | 191 return Memory::Address_at(pc_); |
192 } | 192 } |
193 | 193 |
| 194 Address RelocInfo::wasm_global_reference() { |
| 195 DCHECK(IsWasmGlobalReference(rmode_)); |
| 196 return Memory::Address_at(pc_); |
| 197 } |
| 198 |
194 uint32_t RelocInfo::wasm_memory_size_reference() { | 199 uint32_t RelocInfo::wasm_memory_size_reference() { |
195 DCHECK(IsWasmMemorySizeReference(rmode_)); | 200 DCHECK(IsWasmMemorySizeReference(rmode_)); |
196 return Memory::uint32_at(pc_); | 201 return Memory::uint32_at(pc_); |
197 } | 202 } |
198 | 203 |
199 void RelocInfo::update_wasm_memory_reference( | 204 void RelocInfo::update_wasm_memory_reference( |
200 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, | 205 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
201 ICacheFlushMode icache_flush_mode) { | 206 ICacheFlushMode icache_flush_mode) { |
202 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); | 207 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); |
203 if (IsWasmMemoryReference(rmode_)) { | 208 if (IsWasmMemoryReference(rmode_)) { |
(...skipping 12 matching lines...) Expand all Loading... |
216 DCHECK(updated_size_reference <= new_size); | 221 DCHECK(updated_size_reference <= new_size); |
217 Memory::uint32_at(pc_) = updated_size_reference; | 222 Memory::uint32_at(pc_) = updated_size_reference; |
218 } else { | 223 } else { |
219 UNREACHABLE(); | 224 UNREACHABLE(); |
220 } | 225 } |
221 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 226 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
222 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); | 227 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); |
223 } | 228 } |
224 } | 229 } |
225 | 230 |
| 231 void RelocInfo::update_wasm_global_reference( |
| 232 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) { |
| 233 DCHECK(IsWasmGlobalReference(rmode_)); |
| 234 Address updated_reference; |
| 235 DCHECK(old_base <= wasm_global_reference()); |
| 236 updated_reference = new_base + (wasm_global_reference() - old_base); |
| 237 DCHECK(new_base <= updated_reference); |
| 238 Memory::Address_at(pc_) = updated_reference; |
| 239 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
| 240 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); |
| 241 } |
| 242 } |
| 243 |
226 // ----------------------------------------------------------------------------- | 244 // ----------------------------------------------------------------------------- |
227 // Implementation of Operand | 245 // Implementation of Operand |
228 | 246 |
229 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { | 247 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { |
230 // [base + disp/r] | 248 // [base + disp/r] |
231 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { | 249 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { |
232 // [base] | 250 // [base] |
233 set_modrm(0, base); | 251 set_modrm(0, base); |
234 if (base.is(esp)) set_sib(times_1, esp, base); | 252 if (base.is(esp)) set_sib(times_1, esp, base); |
235 } else if (is_int8(disp) && RelocInfo::IsNone(rmode)) { | 253 } else if (is_int8(disp) && RelocInfo::IsNone(rmode)) { |
(...skipping 2852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3088 fflush(coverage_log); | 3106 fflush(coverage_log); |
3089 } | 3107 } |
3090 } | 3108 } |
3091 | 3109 |
3092 #endif | 3110 #endif |
3093 | 3111 |
3094 } // namespace internal | 3112 } // namespace internal |
3095 } // namespace v8 | 3113 } // namespace v8 |
3096 | 3114 |
3097 #endif // V8_TARGET_ARCH_IA32 | 3115 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |