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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 *p += delta; // Relocate entry. | 74 *p += delta; // Relocate entry. |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 Address RelocInfo::target_address() { | 79 Address RelocInfo::target_address() { |
80 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); | 80 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); |
81 return Assembler::target_address_at(pc_, host_); | 81 return Assembler::target_address_at(pc_, host_); |
82 } | 82 } |
83 | 83 |
| 84 Address RelocInfo::wasm_memory_reference() { |
| 85 DCHECK(IsWasmMemoryReference(rmode_)); |
| 86 return Memory::Address_at(pc_); |
| 87 } |
84 | 88 |
85 Address RelocInfo::target_address_address() { | 89 Address RelocInfo::target_address_address() { |
86 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 90 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
87 || rmode_ == EMBEDDED_OBJECT | 91 || rmode_ == EMBEDDED_OBJECT |
88 || rmode_ == EXTERNAL_REFERENCE); | 92 || rmode_ == EXTERNAL_REFERENCE); |
89 return reinterpret_cast<Address>(pc_); | 93 return reinterpret_cast<Address>(pc_); |
90 } | 94 } |
91 | 95 |
92 | 96 |
93 Address RelocInfo::constant_pool_entry_address() { | 97 Address RelocInfo::constant_pool_entry_address() { |
(...skipping 15 matching lines...) Expand all Loading... |
109 Assembler::set_target_address_at(isolate_, pc_, host_, target); | 113 Assembler::set_target_address_at(isolate_, pc_, host_, target); |
110 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); | 114 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); |
111 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && | 115 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && |
112 IsCodeTarget(rmode_)) { | 116 IsCodeTarget(rmode_)) { |
113 Object* target_code = Code::GetCodeFromTargetAddress(target); | 117 Object* target_code = Code::GetCodeFromTargetAddress(target); |
114 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( | 118 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
115 host(), this, HeapObject::cast(target_code)); | 119 host(), this, HeapObject::cast(target_code)); |
116 } | 120 } |
117 } | 121 } |
118 | 122 |
| 123 void RelocInfo::update_wasm_memory_reference( |
| 124 Address old_base, Address new_base, size_t old_size, size_t new_size, |
| 125 ICacheFlushMode icache_flush_mode) { |
| 126 DCHECK(IsWasmMemoryReference(rmode_)); |
| 127 DCHECK(old_base <= wasm_memory_reference() && |
| 128 wasm_memory_reference() < old_base + old_size); |
| 129 Address updated_reference = new_base + (wasm_memory_reference() - old_base); |
| 130 DCHECK(new_base <= updated_reference && |
| 131 updated_reference < new_base + new_size); |
| 132 Memory::Address_at(pc_) = updated_reference; |
| 133 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
| 134 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); |
| 135 } |
| 136 } |
119 | 137 |
120 Object* RelocInfo::target_object() { | 138 Object* RelocInfo::target_object() { |
121 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 139 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
122 return Memory::Object_at(pc_); | 140 return Memory::Object_at(pc_); |
123 } | 141 } |
124 | 142 |
125 | 143 |
126 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { | 144 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { |
127 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 145 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
128 return Memory::Object_Handle_at(pc_); | 146 return Memory::Object_Handle_at(pc_); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 } | 333 } |
316 } | 334 } |
317 | 335 |
318 | 336 |
319 | 337 |
320 Immediate::Immediate(int x) { | 338 Immediate::Immediate(int x) { |
321 x_ = x; | 339 x_ = x; |
322 rmode_ = RelocInfo::NONE32; | 340 rmode_ = RelocInfo::NONE32; |
323 } | 341 } |
324 | 342 |
| 343 Immediate::Immediate(Address x, RelocInfo::Mode rmode) { |
| 344 x_ = reinterpret_cast<int32_t>(x); |
| 345 rmode_ = rmode; |
| 346 } |
325 | 347 |
326 Immediate::Immediate(const ExternalReference& ext) { | 348 Immediate::Immediate(const ExternalReference& ext) { |
327 x_ = reinterpret_cast<int32_t>(ext.address()); | 349 x_ = reinterpret_cast<int32_t>(ext.address()); |
328 rmode_ = RelocInfo::EXTERNAL_REFERENCE; | 350 rmode_ = RelocInfo::EXTERNAL_REFERENCE; |
329 } | 351 } |
330 | 352 |
331 | 353 |
332 Immediate::Immediate(Label* internal_offset) { | 354 Immediate::Immediate(Label* internal_offset) { |
333 x_ = reinterpret_cast<int32_t>(internal_offset); | 355 x_ = reinterpret_cast<int32_t>(internal_offset); |
334 rmode_ = RelocInfo::INTERNAL_REFERENCE; | 356 rmode_ = RelocInfo::INTERNAL_REFERENCE; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 | 563 |
542 Operand::Operand(Immediate imm) { | 564 Operand::Operand(Immediate imm) { |
543 // [disp/r] | 565 // [disp/r] |
544 set_modrm(0, ebp); | 566 set_modrm(0, ebp); |
545 set_dispr(imm.x_, imm.rmode_); | 567 set_dispr(imm.x_, imm.rmode_); |
546 } | 568 } |
547 } // namespace internal | 569 } // namespace internal |
548 } // namespace v8 | 570 } // namespace v8 |
549 | 571 |
550 #endif // V8_X87_ASSEMBLER_X87_INL_H_ | 572 #endif // V8_X87_ASSEMBLER_X87_INL_H_ |
OLD | NEW |