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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 x_ = reinterpret_cast<int32_t>(internal_offset); | 334 x_ = reinterpret_cast<int32_t>(internal_offset); |
335 rmode_ = RelocInfo::INTERNAL_REFERENCE; | 335 rmode_ = RelocInfo::INTERNAL_REFERENCE; |
336 } | 336 } |
337 | 337 |
338 | 338 |
339 Immediate::Immediate(Handle<Object> handle) { | 339 Immediate::Immediate(Handle<Object> handle) { |
340 AllowDeferredHandleDereference using_raw_address; | 340 AllowDeferredHandleDereference using_raw_address; |
341 // Verify all Objects referred by code are NOT in new space. | 341 // Verify all Objects referred by code are NOT in new space. |
342 Object* obj = *handle; | 342 Object* obj = *handle; |
343 if (obj->IsHeapObject()) { | 343 if (obj->IsHeapObject()) { |
344 DCHECK(!HeapObject::cast(obj)->GetHeap()->InNewSpace(obj)); | |
345 x_ = reinterpret_cast<intptr_t>(handle.location()); | 344 x_ = reinterpret_cast<intptr_t>(handle.location()); |
346 rmode_ = RelocInfo::EMBEDDED_OBJECT; | 345 rmode_ = RelocInfo::EMBEDDED_OBJECT; |
347 } else { | 346 } else { |
348 // no relocation needed | 347 // no relocation needed |
349 x_ = reinterpret_cast<intptr_t>(obj); | 348 x_ = reinterpret_cast<intptr_t>(obj); |
350 rmode_ = RelocInfo::NONE32; | 349 rmode_ = RelocInfo::NONE32; |
351 } | 350 } |
352 } | 351 } |
353 | 352 |
354 | 353 |
(...skipping 18 matching lines...) Expand all Loading... |
373 void Assembler::emit_q(uint64_t x) { | 372 void Assembler::emit_q(uint64_t x) { |
374 *reinterpret_cast<uint64_t*>(pc_) = x; | 373 *reinterpret_cast<uint64_t*>(pc_) = x; |
375 pc_ += sizeof(uint64_t); | 374 pc_ += sizeof(uint64_t); |
376 } | 375 } |
377 | 376 |
378 | 377 |
379 void Assembler::emit(Handle<Object> handle) { | 378 void Assembler::emit(Handle<Object> handle) { |
380 AllowDeferredHandleDereference heap_object_check; | 379 AllowDeferredHandleDereference heap_object_check; |
381 // Verify all Objects referred by code are NOT in new space. | 380 // Verify all Objects referred by code are NOT in new space. |
382 Object* obj = *handle; | 381 Object* obj = *handle; |
383 DCHECK(!isolate()->heap()->InNewSpace(obj)); | |
384 if (obj->IsHeapObject()) { | 382 if (obj->IsHeapObject()) { |
385 emit(reinterpret_cast<intptr_t>(handle.location()), | 383 emit(reinterpret_cast<intptr_t>(handle.location()), |
386 RelocInfo::EMBEDDED_OBJECT); | 384 RelocInfo::EMBEDDED_OBJECT); |
387 } else { | 385 } else { |
388 // no relocation needed | 386 // no relocation needed |
389 emit(reinterpret_cast<intptr_t>(obj)); | 387 emit(reinterpret_cast<intptr_t>(obj)); |
390 } | 388 } |
391 } | 389 } |
392 | 390 |
393 | 391 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 | 551 |
554 Operand::Operand(Immediate imm) { | 552 Operand::Operand(Immediate imm) { |
555 // [disp/r] | 553 // [disp/r] |
556 set_modrm(0, ebp); | 554 set_modrm(0, ebp); |
557 set_dispr(imm.x_, imm.rmode_); | 555 set_dispr(imm.x_, imm.rmode_); |
558 } | 556 } |
559 } // namespace internal | 557 } // namespace internal |
560 } // namespace v8 | 558 } // namespace v8 |
561 | 559 |
562 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 560 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
OLD | NEW |