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 } | |
88 | |
89 Address RelocInfo::target_address_address() { | 84 Address RelocInfo::target_address_address() { |
90 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 85 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
91 || rmode_ == EMBEDDED_OBJECT | 86 || rmode_ == EMBEDDED_OBJECT |
92 || rmode_ == EXTERNAL_REFERENCE); | 87 || rmode_ == EXTERNAL_REFERENCE); |
93 return reinterpret_cast<Address>(pc_); | 88 return reinterpret_cast<Address>(pc_); |
94 } | 89 } |
95 | 90 |
96 | 91 |
97 Address RelocInfo::constant_pool_entry_address() { | 92 Address RelocInfo::constant_pool_entry_address() { |
98 UNREACHABLE(); | 93 UNREACHABLE(); |
(...skipping 13 matching lines...) Expand all Loading... |
112 icache_flush_mode); | 107 icache_flush_mode); |
113 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); | 108 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); |
114 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && | 109 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && |
115 IsCodeTarget(rmode_)) { | 110 IsCodeTarget(rmode_)) { |
116 Object* target_code = Code::GetCodeFromTargetAddress(target); | 111 Object* target_code = Code::GetCodeFromTargetAddress(target); |
117 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( | 112 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
118 host(), this, HeapObject::cast(target_code)); | 113 host(), this, HeapObject::cast(target_code)); |
119 } | 114 } |
120 } | 115 } |
121 | 116 |
122 void RelocInfo::update_wasm_memory_reference( | |
123 Address old_base, Address new_base, size_t old_size, size_t new_size, | |
124 ICacheFlushMode icache_flush_mode) { | |
125 DCHECK(IsWasmMemoryReference(rmode_)); | |
126 DCHECK(old_base <= wasm_memory_reference() && | |
127 wasm_memory_reference() < old_base + old_size); | |
128 Address updated_reference = new_base + (wasm_memory_reference() - old_base); | |
129 DCHECK(new_base <= updated_reference && | |
130 updated_reference < new_base + new_size); | |
131 Memory::Address_at(pc_) = updated_reference; | |
132 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | |
133 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); | |
134 } | |
135 } | |
136 | |
137 Object* RelocInfo::target_object() { | 117 Object* RelocInfo::target_object() { |
138 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 118 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
139 return Memory::Object_at(pc_); | 119 return Memory::Object_at(pc_); |
140 } | 120 } |
141 | 121 |
142 | 122 |
143 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { | 123 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { |
144 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 124 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
145 return Memory::Object_Handle_at(pc_); | 125 return Memory::Object_Handle_at(pc_); |
146 } | 126 } |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 | 553 |
574 Operand::Operand(Immediate imm) { | 554 Operand::Operand(Immediate imm) { |
575 // [disp/r] | 555 // [disp/r] |
576 set_modrm(0, ebp); | 556 set_modrm(0, ebp); |
577 set_dispr(imm.x_, imm.rmode_); | 557 set_dispr(imm.x_, imm.rmode_); |
578 } | 558 } |
579 } // namespace internal | 559 } // namespace internal |
580 } // namespace v8 | 560 } // namespace v8 |
581 | 561 |
582 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 562 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
OLD | NEW |