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