| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Assembler::FlushICache(isolate_, pc_, sizeof(Address)); | 136 Assembler::FlushICache(isolate_, 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()->RecordWriteIntoCode( | |
| 142 host(), this, HeapObject::cast(target)); | |
| 143 host()->GetHeap()->RecordWriteIntoCode(host(), this, target); | 141 host()->GetHeap()->RecordWriteIntoCode(host(), this, target); |
| 144 } | 142 } |
| 145 } | 143 } |
| 146 | 144 |
| 147 | 145 |
| 148 Address RelocInfo::target_external_reference() { | 146 Address RelocInfo::target_external_reference() { |
| 149 DCHECK(rmode_ == RelocInfo::EXTERNAL_REFERENCE); | 147 DCHECK(rmode_ == RelocInfo::EXTERNAL_REFERENCE); |
| 150 return Memory::Address_at(pc_); | 148 return Memory::Address_at(pc_); |
| 151 } | 149 } |
| 152 | 150 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 x_ = reinterpret_cast<int32_t>(internal_offset); | 334 x_ = reinterpret_cast<int32_t>(internal_offset); |
| 337 rmode_ = RelocInfo::INTERNAL_REFERENCE; | 335 rmode_ = RelocInfo::INTERNAL_REFERENCE; |
| 338 } | 336 } |
| 339 | 337 |
| 340 | 338 |
| 341 Immediate::Immediate(Handle<Object> handle) { | 339 Immediate::Immediate(Handle<Object> handle) { |
| 342 AllowDeferredHandleDereference using_raw_address; | 340 AllowDeferredHandleDereference using_raw_address; |
| 343 // Verify all Objects referred by code are NOT in new space. | 341 // Verify all Objects referred by code are NOT in new space. |
| 344 Object* obj = *handle; | 342 Object* obj = *handle; |
| 345 if (obj->IsHeapObject()) { | 343 if (obj->IsHeapObject()) { |
| 346 DCHECK(!HeapObject::cast(obj)->GetHeap()->InNewSpace(obj)); | |
| 347 x_ = reinterpret_cast<intptr_t>(handle.location()); | 344 x_ = reinterpret_cast<intptr_t>(handle.location()); |
| 348 rmode_ = RelocInfo::EMBEDDED_OBJECT; | 345 rmode_ = RelocInfo::EMBEDDED_OBJECT; |
| 349 } else { | 346 } else { |
| 350 // no relocation needed | 347 // no relocation needed |
| 351 x_ = reinterpret_cast<intptr_t>(obj); | 348 x_ = reinterpret_cast<intptr_t>(obj); |
| 352 rmode_ = RelocInfo::NONE32; | 349 rmode_ = RelocInfo::NONE32; |
| 353 } | 350 } |
| 354 } | 351 } |
| 355 | 352 |
| 356 | 353 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 375 void Assembler::emit_q(uint64_t x) { | 372 void Assembler::emit_q(uint64_t x) { |
| 376 *reinterpret_cast<uint64_t*>(pc_) = x; | 373 *reinterpret_cast<uint64_t*>(pc_) = x; |
| 377 pc_ += sizeof(uint64_t); | 374 pc_ += sizeof(uint64_t); |
| 378 } | 375 } |
| 379 | 376 |
| 380 | 377 |
| 381 void Assembler::emit(Handle<Object> handle) { | 378 void Assembler::emit(Handle<Object> handle) { |
| 382 AllowDeferredHandleDereference heap_object_check; | 379 AllowDeferredHandleDereference heap_object_check; |
| 383 // Verify all Objects referred by code are NOT in new space. | 380 // Verify all Objects referred by code are NOT in new space. |
| 384 Object* obj = *handle; | 381 Object* obj = *handle; |
| 385 DCHECK(!isolate()->heap()->InNewSpace(obj)); | |
| 386 if (obj->IsHeapObject()) { | 382 if (obj->IsHeapObject()) { |
| 387 emit(reinterpret_cast<intptr_t>(handle.location()), | 383 emit(reinterpret_cast<intptr_t>(handle.location()), |
| 388 RelocInfo::EMBEDDED_OBJECT); | 384 RelocInfo::EMBEDDED_OBJECT); |
| 389 } else { | 385 } else { |
| 390 // no relocation needed | 386 // no relocation needed |
| 391 emit(reinterpret_cast<intptr_t>(obj)); | 387 emit(reinterpret_cast<intptr_t>(obj)); |
| 392 } | 388 } |
| 393 } | 389 } |
| 394 | 390 |
| 395 | 391 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 545 |
| 550 Operand::Operand(Immediate imm) { | 546 Operand::Operand(Immediate imm) { |
| 551 // [disp/r] | 547 // [disp/r] |
| 552 set_modrm(0, ebp); | 548 set_modrm(0, ebp); |
| 553 set_dispr(imm.x_, imm.rmode_); | 549 set_dispr(imm.x_, imm.rmode_); |
| 554 } | 550 } |
| 555 } // namespace internal | 551 } // namespace internal |
| 556 } // namespace v8 | 552 } // namespace v8 |
| 557 | 553 |
| 558 #endif // V8_X87_ASSEMBLER_X87_INL_H_ | 554 #endif // V8_X87_ASSEMBLER_X87_INL_H_ |
| OLD | NEW |