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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 WriteBarrierMode write_barrier_mode, | 130 WriteBarrierMode write_barrier_mode, |
131 ICacheFlushMode icache_flush_mode) { | 131 ICacheFlushMode icache_flush_mode) { |
132 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 132 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
133 Memory::Object_at(pc_) = target; | 133 Memory::Object_at(pc_) = target; |
134 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 134 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
135 Assembler::FlushICache(isolate_, pc_, sizeof(Address)); | 135 Assembler::FlushICache(isolate_, pc_, sizeof(Address)); |
136 } | 136 } |
137 if (write_barrier_mode == UPDATE_WRITE_BARRIER && | 137 if (write_barrier_mode == UPDATE_WRITE_BARRIER && |
138 host() != NULL && | 138 host() != NULL && |
139 target->IsHeapObject()) { | 139 target->IsHeapObject()) { |
140 host()->GetHeap()->RecordWriteIntoCode(host(), this, target); | 140 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
| 141 host(), this, HeapObject::cast(target)); |
141 } | 142 } |
142 } | 143 } |
143 | 144 |
144 | 145 |
145 Address RelocInfo::target_external_reference() { | 146 Address RelocInfo::target_external_reference() { |
146 DCHECK(rmode_ == RelocInfo::EXTERNAL_REFERENCE); | 147 DCHECK(rmode_ == RelocInfo::EXTERNAL_REFERENCE); |
147 return Memory::Address_at(pc_); | 148 return Memory::Address_at(pc_); |
148 } | 149 } |
149 | 150 |
150 | 151 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 x_ = reinterpret_cast<int32_t>(internal_offset); | 334 x_ = reinterpret_cast<int32_t>(internal_offset); |
334 rmode_ = RelocInfo::INTERNAL_REFERENCE; | 335 rmode_ = RelocInfo::INTERNAL_REFERENCE; |
335 } | 336 } |
336 | 337 |
337 | 338 |
338 Immediate::Immediate(Handle<Object> handle) { | 339 Immediate::Immediate(Handle<Object> handle) { |
339 AllowDeferredHandleDereference using_raw_address; | 340 AllowDeferredHandleDereference using_raw_address; |
340 // Verify all Objects referred by code are NOT in new space. | 341 // Verify all Objects referred by code are NOT in new space. |
341 Object* obj = *handle; | 342 Object* obj = *handle; |
342 if (obj->IsHeapObject()) { | 343 if (obj->IsHeapObject()) { |
| 344 DCHECK(!HeapObject::cast(obj)->GetHeap()->InNewSpace(obj)); |
343 x_ = reinterpret_cast<intptr_t>(handle.location()); | 345 x_ = reinterpret_cast<intptr_t>(handle.location()); |
344 rmode_ = RelocInfo::EMBEDDED_OBJECT; | 346 rmode_ = RelocInfo::EMBEDDED_OBJECT; |
345 } else { | 347 } else { |
346 // no relocation needed | 348 // no relocation needed |
347 x_ = reinterpret_cast<intptr_t>(obj); | 349 x_ = reinterpret_cast<intptr_t>(obj); |
348 rmode_ = RelocInfo::NONE32; | 350 rmode_ = RelocInfo::NONE32; |
349 } | 351 } |
350 } | 352 } |
351 | 353 |
352 | 354 |
(...skipping 18 matching lines...) Expand all Loading... |
371 void Assembler::emit_q(uint64_t x) { | 373 void Assembler::emit_q(uint64_t x) { |
372 *reinterpret_cast<uint64_t*>(pc_) = x; | 374 *reinterpret_cast<uint64_t*>(pc_) = x; |
373 pc_ += sizeof(uint64_t); | 375 pc_ += sizeof(uint64_t); |
374 } | 376 } |
375 | 377 |
376 | 378 |
377 void Assembler::emit(Handle<Object> handle) { | 379 void Assembler::emit(Handle<Object> handle) { |
378 AllowDeferredHandleDereference heap_object_check; | 380 AllowDeferredHandleDereference heap_object_check; |
379 // Verify all Objects referred by code are NOT in new space. | 381 // Verify all Objects referred by code are NOT in new space. |
380 Object* obj = *handle; | 382 Object* obj = *handle; |
| 383 DCHECK(!isolate()->heap()->InNewSpace(obj)); |
381 if (obj->IsHeapObject()) { | 384 if (obj->IsHeapObject()) { |
382 emit(reinterpret_cast<intptr_t>(handle.location()), | 385 emit(reinterpret_cast<intptr_t>(handle.location()), |
383 RelocInfo::EMBEDDED_OBJECT); | 386 RelocInfo::EMBEDDED_OBJECT); |
384 } else { | 387 } else { |
385 // no relocation needed | 388 // no relocation needed |
386 emit(reinterpret_cast<intptr_t>(obj)); | 389 emit(reinterpret_cast<intptr_t>(obj)); |
387 } | 390 } |
388 } | 391 } |
389 | 392 |
390 | 393 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 553 |
551 Operand::Operand(Immediate imm) { | 554 Operand::Operand(Immediate imm) { |
552 // [disp/r] | 555 // [disp/r] |
553 set_modrm(0, ebp); | 556 set_modrm(0, ebp); |
554 set_dispr(imm.x_, imm.rmode_); | 557 set_dispr(imm.x_, imm.rmode_); |
555 } | 558 } |
556 } // namespace internal | 559 } // namespace internal |
557 } // namespace v8 | 560 } // namespace v8 |
558 | 561 |
559 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 562 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
OLD | NEW |