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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 bool RelocInfo::IsInConstantPool() { | 100 bool RelocInfo::IsInConstantPool() { |
101 return false; | 101 return false; |
102 } | 102 } |
103 | 103 |
104 Address RelocInfo::wasm_memory_reference() { | 104 Address RelocInfo::wasm_memory_reference() { |
105 DCHECK(IsWasmMemoryReference(rmode_)); | 105 DCHECK(IsWasmMemoryReference(rmode_)); |
106 return Memory::Address_at(pc_); | 106 return Memory::Address_at(pc_); |
107 } | 107 } |
108 | 108 |
| 109 Address RelocInfo::wasm_global_reference() { |
| 110 DCHECK(IsWasmGlobalReference(rmode_)); |
| 111 return Memory::Address_at(pc_); |
| 112 } |
| 113 |
109 uint32_t RelocInfo::wasm_memory_size_reference() { | 114 uint32_t RelocInfo::wasm_memory_size_reference() { |
110 DCHECK(IsWasmMemorySizeReference(rmode_)); | 115 DCHECK(IsWasmMemorySizeReference(rmode_)); |
111 return Memory::uint32_at(pc_); | 116 return Memory::uint32_at(pc_); |
112 } | 117 } |
113 | 118 |
114 void RelocInfo::update_wasm_memory_reference( | 119 void RelocInfo::update_wasm_memory_reference( |
115 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, | 120 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
116 ICacheFlushMode icache_flush_mode) { | 121 ICacheFlushMode icache_flush_mode) { |
117 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); | 122 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); |
118 if (IsWasmMemoryReference(rmode_)) { | 123 if (IsWasmMemoryReference(rmode_)) { |
(...skipping 12 matching lines...) Expand all Loading... |
131 DCHECK(updated_size_reference <= new_size); | 136 DCHECK(updated_size_reference <= new_size); |
132 Memory::uint32_at(pc_) = updated_size_reference; | 137 Memory::uint32_at(pc_) = updated_size_reference; |
133 } else { | 138 } else { |
134 UNREACHABLE(); | 139 UNREACHABLE(); |
135 } | 140 } |
136 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 141 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
137 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); | 142 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); |
138 } | 143 } |
139 } | 144 } |
140 | 145 |
| 146 void RelocInfo::update_wasm_global_reference( |
| 147 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) { |
| 148 DCHECK(IsWasmGlobalReference(rmode_)); |
| 149 Address updated_reference; |
| 150 DCHECK(old_base <= wasm_global_reference()); |
| 151 updated_reference = new_base + (wasm_global_reference() - old_base); |
| 152 DCHECK(new_base <= updated_reference); |
| 153 Memory::Address_at(pc_) = updated_reference; |
| 154 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
| 155 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); |
| 156 } |
| 157 } |
| 158 |
141 // ----------------------------------------------------------------------------- | 159 // ----------------------------------------------------------------------------- |
142 // Implementation of Operand | 160 // Implementation of Operand |
143 | 161 |
144 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { | 162 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { |
145 // [base + disp/r] | 163 // [base + disp/r] |
146 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { | 164 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { |
147 // [base] | 165 // [base] |
148 set_modrm(0, base); | 166 set_modrm(0, base); |
149 if (base.is(esp)) set_sib(times_1, esp, base); | 167 if (base.is(esp)) set_sib(times_1, esp, base); |
150 } else if (is_int8(disp) && RelocInfo::IsNone(rmode)) { | 168 } else if (is_int8(disp) && RelocInfo::IsNone(rmode)) { |
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2243 fflush(coverage_log); | 2261 fflush(coverage_log); |
2244 } | 2262 } |
2245 } | 2263 } |
2246 | 2264 |
2247 #endif | 2265 #endif |
2248 | 2266 |
2249 } // namespace internal | 2267 } // namespace internal |
2250 } // namespace v8 | 2268 } // namespace v8 |
2251 | 2269 |
2252 #endif // V8_TARGET_ARCH_X87 | 2270 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |