| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 DCHECK(IsWasmMemoryReference(rmode_)); | 221 DCHECK(IsWasmMemoryReference(rmode_)); |
| 222 return Assembler::target_address_at(pc_, host_); | 222 return Assembler::target_address_at(pc_, host_); |
| 223 } | 223 } |
| 224 | 224 |
| 225 uint32_t RelocInfo::wasm_memory_size_reference() { | 225 uint32_t RelocInfo::wasm_memory_size_reference() { |
| 226 DCHECK(IsWasmMemorySizeReference(rmode_)); | 226 DCHECK(IsWasmMemorySizeReference(rmode_)); |
| 227 return static_cast<uint32_t>( | 227 return static_cast<uint32_t>( |
| 228 reinterpret_cast<intptr_t>(Assembler::target_address_at(pc_, host_))); | 228 reinterpret_cast<intptr_t>(Assembler::target_address_at(pc_, host_))); |
| 229 } | 229 } |
| 230 | 230 |
| 231 Address RelocInfo::wasm_global_reference() { |
| 232 DCHECK(IsWasmGlobalReference(rmode_)); |
| 233 return Assembler::target_address_at(pc_, host_); |
| 234 } |
| 235 |
| 231 void RelocInfo::update_wasm_memory_reference( | 236 void RelocInfo::update_wasm_memory_reference( |
| 232 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, | 237 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
| 233 ICacheFlushMode icache_flush_mode) { | 238 ICacheFlushMode icache_flush_mode) { |
| 234 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); | 239 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); |
| 235 if (IsWasmMemoryReference(rmode_)) { | 240 if (IsWasmMemoryReference(rmode_)) { |
| 236 Address updated_memory_reference; | 241 Address updated_memory_reference; |
| 237 DCHECK(old_base <= wasm_memory_reference() && | 242 DCHECK(old_base <= wasm_memory_reference() && |
| 238 wasm_memory_reference() < old_base + old_size); | 243 wasm_memory_reference() < old_base + old_size); |
| 239 updated_memory_reference = new_base + (wasm_memory_reference() - old_base); | 244 updated_memory_reference = new_base + (wasm_memory_reference() - old_base); |
| 240 DCHECK(new_base <= updated_memory_reference && | 245 DCHECK(new_base <= updated_memory_reference && |
| 241 updated_memory_reference < new_base + new_size); | 246 updated_memory_reference < new_base + new_size); |
| 242 Assembler::set_target_address_at( | 247 Assembler::set_target_address_at( |
| 243 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode); | 248 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode); |
| 244 } else if (IsWasmMemorySizeReference(rmode_)) { | 249 } else if (IsWasmMemorySizeReference(rmode_)) { |
| 245 uint32_t updated_size_reference; | 250 uint32_t updated_size_reference; |
| 246 DCHECK(wasm_memory_size_reference() <= old_size); | 251 DCHECK(wasm_memory_size_reference() <= old_size); |
| 247 updated_size_reference = | 252 updated_size_reference = |
| 248 new_size + (wasm_memory_size_reference() - old_size); | 253 new_size + (wasm_memory_size_reference() - old_size); |
| 249 DCHECK(updated_size_reference <= new_size); | 254 DCHECK(updated_size_reference <= new_size); |
| 250 Assembler::set_target_address_at( | 255 Assembler::set_target_address_at( |
| 251 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), | 256 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), |
| 252 icache_flush_mode); | 257 icache_flush_mode); |
| 253 } else { | 258 } else { |
| 254 UNREACHABLE(); | 259 UNREACHABLE(); |
| 255 } | 260 } |
| 256 } | 261 } |
| 257 | 262 |
| 263 void RelocInfo::update_wasm_global_reference( |
| 264 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) { |
| 265 DCHECK(IsWasmGlobalReference(rmode_)); |
| 266 Address updated_reference; |
| 267 DCHECK(old_base <= wasm_global_reference()); |
| 268 updated_reference = new_base + (wasm_global_reference() - old_base); |
| 269 DCHECK(new_base <= updated_reference); |
| 270 Assembler::set_target_address_at(isolate_, pc_, host_, updated_reference, |
| 271 icache_flush_mode); |
| 272 } |
| 273 |
| 258 // ----------------------------------------------------------------------------- | 274 // ----------------------------------------------------------------------------- |
| 259 // Implementation of Operand and MemOperand | 275 // Implementation of Operand and MemOperand |
| 260 // See assembler-s390-inl.h for inlined constructors | 276 // See assembler-s390-inl.h for inlined constructors |
| 261 | 277 |
| 262 Operand::Operand(Handle<Object> handle) { | 278 Operand::Operand(Handle<Object> handle) { |
| 263 AllowDeferredHandleDereference using_raw_address; | 279 AllowDeferredHandleDereference using_raw_address; |
| 264 rm_ = no_reg; | 280 rm_ = no_reg; |
| 265 // Verify all Objects referred by code are NOT in new space. | 281 // Verify all Objects referred by code are NOT in new space. |
| 266 Object* obj = *handle; | 282 Object* obj = *handle; |
| 267 if (obj->IsHeapObject()) { | 283 if (obj->IsHeapObject()) { |
| (...skipping 2822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3090 | 3106 |
| 3091 reloc_info_writer.Write(&rinfo); | 3107 reloc_info_writer.Write(&rinfo); |
| 3092 } | 3108 } |
| 3093 | 3109 |
| 3094 reloc_info_writer.Finish(); | 3110 reloc_info_writer.Finish(); |
| 3095 } | 3111 } |
| 3096 | 3112 |
| 3097 } // namespace internal | 3113 } // namespace internal |
| 3098 } // namespace v8 | 3114 } // namespace v8 |
| 3099 #endif // V8_TARGET_ARCH_S390 | 3115 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |