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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return Memory::Object_Handle_at(pc_); | 126 return Memory::Object_Handle_at(pc_); |
127 } | 127 } |
128 | 128 |
129 | 129 |
130 void RelocInfo::set_target_object(Object* target, | 130 void RelocInfo::set_target_object(Object* target, |
131 WriteBarrierMode write_barrier_mode, | 131 WriteBarrierMode write_barrier_mode, |
132 ICacheFlushMode icache_flush_mode) { | 132 ICacheFlushMode icache_flush_mode) { |
133 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 133 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
134 Memory::Object_at(pc_) = target; | 134 Memory::Object_at(pc_) = target; |
135 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 135 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
136 CpuFeatures::FlushICache(pc_, sizeof(Address)); | 136 Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address)); |
137 } | 137 } |
138 if (write_barrier_mode == UPDATE_WRITE_BARRIER && | 138 if (write_barrier_mode == UPDATE_WRITE_BARRIER && |
139 host() != NULL && | 139 host() != NULL && |
140 target->IsHeapObject()) { | 140 target->IsHeapObject()) { |
141 host()->GetHeap()->incremental_marking()->RecordWrite( | 141 host()->GetHeap()->incremental_marking()->RecordWrite( |
142 host(), &Memory::Object_at(pc_), HeapObject::cast(target)); | 142 host(), &Memory::Object_at(pc_), HeapObject::cast(target)); |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 | 146 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 192 |
193 | 193 |
194 void RelocInfo::set_target_cell(Cell* cell, | 194 void RelocInfo::set_target_cell(Cell* cell, |
195 WriteBarrierMode write_barrier_mode, | 195 WriteBarrierMode write_barrier_mode, |
196 ICacheFlushMode icache_flush_mode) { | 196 ICacheFlushMode icache_flush_mode) { |
197 DCHECK(cell->IsCell()); | 197 DCHECK(cell->IsCell()); |
198 DCHECK(rmode_ == RelocInfo::CELL); | 198 DCHECK(rmode_ == RelocInfo::CELL); |
199 Address address = cell->address() + Cell::kValueOffset; | 199 Address address = cell->address() + Cell::kValueOffset; |
200 Memory::Address_at(pc_) = address; | 200 Memory::Address_at(pc_) = address; |
201 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 201 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
202 CpuFeatures::FlushICache(pc_, sizeof(Address)); | 202 Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address)); |
203 } | 203 } |
204 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) { | 204 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) { |
205 // TODO(1550) We are passing NULL as a slot because cell can never be on | 205 // TODO(1550) We are passing NULL as a slot because cell can never be on |
206 // evacuation candidate. | 206 // evacuation candidate. |
207 host()->GetHeap()->incremental_marking()->RecordWrite( | 207 host()->GetHeap()->incremental_marking()->RecordWrite( |
208 host(), NULL, cell); | 208 host(), NULL, cell); |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 | 212 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { | 274 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { |
275 return !Assembler::IsNop(pc()); | 275 return !Assembler::IsNop(pc()); |
276 } | 276 } |
277 | 277 |
278 | 278 |
279 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { | 279 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { |
280 RelocInfo::Mode mode = rmode(); | 280 RelocInfo::Mode mode = rmode(); |
281 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 281 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
282 visitor->VisitEmbeddedPointer(this); | 282 visitor->VisitEmbeddedPointer(this); |
283 CpuFeatures::FlushICache(pc_, sizeof(Address)); | 283 Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address)); |
284 } else if (RelocInfo::IsCodeTarget(mode)) { | 284 } else if (RelocInfo::IsCodeTarget(mode)) { |
285 visitor->VisitCodeTarget(this); | 285 visitor->VisitCodeTarget(this); |
286 } else if (mode == RelocInfo::CELL) { | 286 } else if (mode == RelocInfo::CELL) { |
287 visitor->VisitCell(this); | 287 visitor->VisitCell(this); |
288 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 288 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
289 visitor->VisitExternalReference(this); | 289 visitor->VisitExternalReference(this); |
290 } else if (mode == RelocInfo::INTERNAL_REFERENCE) { | 290 } else if (mode == RelocInfo::INTERNAL_REFERENCE) { |
291 visitor->VisitInternalReference(this); | 291 visitor->VisitInternalReference(this); |
292 } else if (RelocInfo::IsCodeAgeSequence(mode)) { | 292 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
293 visitor->VisitCodeAgeSequence(this); | 293 visitor->VisitCodeAgeSequence(this); |
294 } else if (RelocInfo::IsDebugBreakSlot(mode) && | 294 } else if (RelocInfo::IsDebugBreakSlot(mode) && |
295 IsPatchedDebugBreakSlotSequence()) { | 295 IsPatchedDebugBreakSlotSequence()) { |
296 visitor->VisitDebugTarget(this); | 296 visitor->VisitDebugTarget(this); |
297 } else if (IsRuntimeEntry(mode)) { | 297 } else if (IsRuntimeEntry(mode)) { |
298 visitor->VisitRuntimeEntry(this); | 298 visitor->VisitRuntimeEntry(this); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 | 302 |
303 template<typename StaticVisitor> | 303 template<typename StaticVisitor> |
304 void RelocInfo::Visit(Heap* heap) { | 304 void RelocInfo::Visit(Heap* heap) { |
305 RelocInfo::Mode mode = rmode(); | 305 RelocInfo::Mode mode = rmode(); |
306 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 306 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
307 StaticVisitor::VisitEmbeddedPointer(heap, this); | 307 StaticVisitor::VisitEmbeddedPointer(heap, this); |
308 CpuFeatures::FlushICache(pc_, sizeof(Address)); | 308 Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address)); |
309 } else if (RelocInfo::IsCodeTarget(mode)) { | 309 } else if (RelocInfo::IsCodeTarget(mode)) { |
310 StaticVisitor::VisitCodeTarget(heap, this); | 310 StaticVisitor::VisitCodeTarget(heap, this); |
311 } else if (mode == RelocInfo::CELL) { | 311 } else if (mode == RelocInfo::CELL) { |
312 StaticVisitor::VisitCell(heap, this); | 312 StaticVisitor::VisitCell(heap, this); |
313 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 313 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
314 StaticVisitor::VisitExternalReference(this); | 314 StaticVisitor::VisitExternalReference(this); |
315 } else if (mode == RelocInfo::INTERNAL_REFERENCE) { | 315 } else if (mode == RelocInfo::INTERNAL_REFERENCE) { |
316 StaticVisitor::VisitInternalReference(this); | 316 StaticVisitor::VisitInternalReference(this); |
317 } else if (RelocInfo::IsCodeAgeSequence(mode)) { | 317 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
318 StaticVisitor::VisitCodeAgeSequence(heap, this); | 318 StaticVisitor::VisitCodeAgeSequence(heap, this); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc); | 452 return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc); |
453 } | 453 } |
454 | 454 |
455 | 455 |
456 void Assembler::set_target_address_at(Address pc, Address constant_pool, | 456 void Assembler::set_target_address_at(Address pc, Address constant_pool, |
457 Address target, | 457 Address target, |
458 ICacheFlushMode icache_flush_mode) { | 458 ICacheFlushMode icache_flush_mode) { |
459 int32_t* p = reinterpret_cast<int32_t*>(pc); | 459 int32_t* p = reinterpret_cast<int32_t*>(pc); |
460 *p = target - (pc + sizeof(int32_t)); | 460 *p = target - (pc + sizeof(int32_t)); |
461 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 461 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
462 CpuFeatures::FlushICache(p, sizeof(int32_t)); | 462 Assembler::FlushICacheWithoutIsolate(p, sizeof(int32_t)); |
463 } | 463 } |
464 } | 464 } |
465 | 465 |
466 | 466 |
467 Address Assembler::target_address_from_return_address(Address pc) { | 467 Address Assembler::target_address_from_return_address(Address pc) { |
468 return pc - kCallTargetAddressOffset; | 468 return pc - kCallTargetAddressOffset; |
469 } | 469 } |
470 | 470 |
471 | 471 |
472 Displacement Assembler::disp_at(Label* L) { | 472 Displacement Assembler::disp_at(Label* L) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 | 555 |
556 | 556 |
557 Operand::Operand(Immediate imm) { | 557 Operand::Operand(Immediate imm) { |
558 // [disp/r] | 558 // [disp/r] |
559 set_modrm(0, ebp); | 559 set_modrm(0, ebp); |
560 set_dispr(imm.x_, imm.rmode_); | 560 set_dispr(imm.x_, imm.rmode_); |
561 } | 561 } |
562 } } // namespace v8::internal | 562 } } // namespace v8::internal |
563 | 563 |
564 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 564 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
OLD | NEW |