| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 Address RelocInfo::wasm_global_reference() { | 194 Address RelocInfo::wasm_global_reference() { |
| 195 DCHECK(IsWasmGlobalReference(rmode_)); | 195 DCHECK(IsWasmGlobalReference(rmode_)); |
| 196 return Memory::Address_at(pc_); | 196 return Memory::Address_at(pc_); |
| 197 } | 197 } |
| 198 | 198 |
| 199 uint32_t RelocInfo::wasm_memory_size_reference() { | 199 uint32_t RelocInfo::wasm_memory_size_reference() { |
| 200 DCHECK(IsWasmMemorySizeReference(rmode_)); | 200 DCHECK(IsWasmMemorySizeReference(rmode_)); |
| 201 return Memory::uint32_at(pc_); | 201 return Memory::uint32_at(pc_); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void RelocInfo::update_wasm_memory_reference( | 204 void RelocInfo::unchecked_update_wasm_memory_reference( |
| 205 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, | 205 Address address, ICacheFlushMode flush_mode) { |
| 206 ICacheFlushMode icache_flush_mode) { | 206 Memory::Address_at(pc_) = address; |
| 207 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); | |
| 208 if (IsWasmMemoryReference(rmode_)) { | |
| 209 Address updated_reference; | |
| 210 DCHECK(old_base <= wasm_memory_reference() && | |
| 211 wasm_memory_reference() < old_base + old_size); | |
| 212 updated_reference = new_base + (wasm_memory_reference() - old_base); | |
| 213 DCHECK(new_base <= updated_reference && | |
| 214 updated_reference < new_base + new_size); | |
| 215 Memory::Address_at(pc_) = updated_reference; | |
| 216 } else if (IsWasmMemorySizeReference(rmode_)) { | |
| 217 uint32_t updated_size_reference; | |
| 218 DCHECK(wasm_memory_size_reference() <= old_size); | |
| 219 updated_size_reference = | |
| 220 new_size + (wasm_memory_size_reference() - old_size); | |
| 221 DCHECK(updated_size_reference <= new_size); | |
| 222 Memory::uint32_at(pc_) = updated_size_reference; | |
| 223 } else { | |
| 224 UNREACHABLE(); | |
| 225 } | |
| 226 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | |
| 227 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); | |
| 228 } | |
| 229 } | 207 } |
| 230 | 208 |
| 231 void RelocInfo::update_wasm_global_reference( | 209 void RelocInfo::unchecked_update_wasm_memory_size(uint32_t size, |
| 232 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) { | 210 ICacheFlushMode flush_mode) { |
| 233 DCHECK(IsWasmGlobalReference(rmode_)); | 211 Memory::uint32_at(pc_) = size; |
| 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 } | 212 } |
| 243 | 213 |
| 244 // ----------------------------------------------------------------------------- | 214 // ----------------------------------------------------------------------------- |
| 245 // Implementation of Operand | 215 // Implementation of Operand |
| 246 | 216 |
| 247 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { | 217 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { |
| 248 // [base + disp/r] | 218 // [base + disp/r] |
| 249 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { | 219 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { |
| 250 // [base] | 220 // [base] |
| 251 set_modrm(0, base); | 221 set_modrm(0, base); |
| (...skipping 2854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3106 fflush(coverage_log); | 3076 fflush(coverage_log); |
| 3107 } | 3077 } |
| 3108 } | 3078 } |
| 3109 | 3079 |
| 3110 #endif | 3080 #endif |
| 3111 | 3081 |
| 3112 } // namespace internal | 3082 } // namespace internal |
| 3113 } // namespace v8 | 3083 } // namespace v8 |
| 3114 | 3084 |
| 3115 #endif // V8_TARGET_ARCH_IA32 | 3085 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |