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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // branch instructions. These are also the ones that need changing when a | 179 // branch instructions. These are also the ones that need changing when a |
180 // code object moves. | 180 // code object moves. |
181 return (1 << rmode_) & kApplyMask; | 181 return (1 << rmode_) & kApplyMask; |
182 } | 182 } |
183 | 183 |
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() { |
| 190 DCHECK(IsWasmMemoryReference(rmode_)); |
| 191 return Memory::Address_at(pc_); |
| 192 } |
| 193 |
| 194 uint32_t RelocInfo::wasm_memory_size_reference() { |
| 195 DCHECK(IsWasmMemorySizeReference(rmode_)); |
| 196 return Memory::uint32_at(pc_); |
| 197 } |
| 198 |
| 199 void RelocInfo::update_wasm_memory_reference( |
| 200 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
| 201 ICacheFlushMode icache_flush_mode) { |
| 202 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); |
| 203 if (IsWasmMemoryReference(rmode_)) { |
| 204 Address updated_reference; |
| 205 DCHECK(old_base <= wasm_memory_reference() && |
| 206 wasm_memory_reference() < old_base + old_size); |
| 207 updated_reference = new_base + (wasm_memory_reference() - old_base); |
| 208 DCHECK(new_base <= updated_reference && |
| 209 updated_reference < new_base + new_size); |
| 210 Memory::Address_at(pc_) = updated_reference; |
| 211 } else if (IsWasmMemorySizeReference(rmode_)) { |
| 212 uint32_t updated_size_reference; |
| 213 DCHECK(wasm_memory_size_reference() <= old_size); |
| 214 updated_size_reference = |
| 215 new_size + (wasm_memory_size_reference() - old_size); |
| 216 DCHECK(updated_size_reference <= new_size); |
| 217 Memory::uint32_at(pc_) = updated_size_reference; |
| 218 } else { |
| 219 UNREACHABLE(); |
| 220 } |
| 221 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
| 222 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); |
| 223 } |
| 224 } |
189 | 225 |
190 // ----------------------------------------------------------------------------- | 226 // ----------------------------------------------------------------------------- |
191 // Implementation of Operand | 227 // Implementation of Operand |
192 | 228 |
193 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { | 229 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { |
194 // [base + disp/r] | 230 // [base + disp/r] |
195 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { | 231 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { |
196 // [base] | 232 // [base] |
197 set_modrm(0, base); | 233 set_modrm(0, base); |
198 if (base.is(esp)) set_sib(times_1, esp, base); | 234 if (base.is(esp)) set_sib(times_1, esp, base); |
(...skipping 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3025 fflush(coverage_log); | 3061 fflush(coverage_log); |
3026 } | 3062 } |
3027 } | 3063 } |
3028 | 3064 |
3029 #endif | 3065 #endif |
3030 | 3066 |
3031 } // namespace internal | 3067 } // namespace internal |
3032 } // namespace v8 | 3068 } // namespace v8 |
3033 | 3069 |
3034 #endif // V8_TARGET_ARCH_IA32 | 3070 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |