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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 rmode_ = RelocInfo::NONE32; | 405 rmode_ = RelocInfo::NONE32; |
406 } | 406 } |
407 | 407 |
408 | 408 |
409 void Assembler::emit(uint32_t x) { | 409 void Assembler::emit(uint32_t x) { |
410 *reinterpret_cast<uint32_t*>(pc_) = x; | 410 *reinterpret_cast<uint32_t*>(pc_) = x; |
411 pc_ += sizeof(uint32_t); | 411 pc_ += sizeof(uint32_t); |
412 } | 412 } |
413 | 413 |
414 | 414 |
415 void Assembler::emit_q(uint64_t x) { | |
416 *reinterpret_cast<uint64_t*>(pc_) = x; | |
417 pc_ += sizeof(uint64_t); | |
418 } | |
419 | |
420 | |
421 void Assembler::emit(Handle<Object> handle) { | 415 void Assembler::emit(Handle<Object> handle) { |
422 AllowDeferredHandleDereference heap_object_check; | 416 AllowDeferredHandleDereference heap_object_check; |
423 // Verify all Objects referred by code are NOT in new space. | 417 // Verify all Objects referred by code are NOT in new space. |
424 Object* obj = *handle; | 418 Object* obj = *handle; |
425 DCHECK(!isolate()->heap()->InNewSpace(obj)); | 419 DCHECK(!isolate()->heap()->InNewSpace(obj)); |
426 if (obj->IsHeapObject()) { | 420 if (obj->IsHeapObject()) { |
427 emit(reinterpret_cast<intptr_t>(handle.location()), | 421 emit(reinterpret_cast<intptr_t>(handle.location()), |
428 RelocInfo::EMBEDDED_OBJECT); | 422 RelocInfo::EMBEDDED_OBJECT); |
429 } else { | 423 } else { |
430 // no relocation needed | 424 // no relocation needed |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 | 469 |
476 | 470 |
477 void Assembler::emit_w(const Immediate& x) { | 471 void Assembler::emit_w(const Immediate& x) { |
478 DCHECK(RelocInfo::IsNone(x.rmode_)); | 472 DCHECK(RelocInfo::IsNone(x.rmode_)); |
479 uint16_t value = static_cast<uint16_t>(x.x_); | 473 uint16_t value = static_cast<uint16_t>(x.x_); |
480 reinterpret_cast<uint16_t*>(pc_)[0] = value; | 474 reinterpret_cast<uint16_t*>(pc_)[0] = value; |
481 pc_ += sizeof(uint16_t); | 475 pc_ += sizeof(uint16_t); |
482 } | 476 } |
483 | 477 |
484 | 478 |
485 Address Assembler::target_address_at(Address pc, Address constant_pool) { | 479 Address Assembler::target_address_at(Address pc, |
| 480 ConstantPoolArray* constant_pool) { |
486 return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc); | 481 return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc); |
487 } | 482 } |
488 | 483 |
489 | 484 |
490 void Assembler::set_target_address_at(Address pc, Address constant_pool, | 485 void Assembler::set_target_address_at(Address pc, |
| 486 ConstantPoolArray* constant_pool, |
491 Address target, | 487 Address target, |
492 ICacheFlushMode icache_flush_mode) { | 488 ICacheFlushMode icache_flush_mode) { |
493 int32_t* p = reinterpret_cast<int32_t*>(pc); | 489 int32_t* p = reinterpret_cast<int32_t*>(pc); |
494 *p = target - (pc + sizeof(int32_t)); | 490 *p = target - (pc + sizeof(int32_t)); |
495 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 491 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
496 CpuFeatures::FlushICache(p, sizeof(int32_t)); | 492 CpuFeatures::FlushICache(p, sizeof(int32_t)); |
497 } | 493 } |
498 } | 494 } |
499 | 495 |
500 | 496 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 584 |
589 | 585 |
590 Operand::Operand(Immediate imm) { | 586 Operand::Operand(Immediate imm) { |
591 // [disp/r] | 587 // [disp/r] |
592 set_modrm(0, ebp); | 588 set_modrm(0, ebp); |
593 set_dispr(imm.x_, imm.rmode_); | 589 set_dispr(imm.x_, imm.rmode_); |
594 } | 590 } |
595 } } // namespace v8::internal | 591 } } // namespace v8::internal |
596 | 592 |
597 #endif // V8_X87_ASSEMBLER_X87_INL_H_ | 593 #endif // V8_X87_ASSEMBLER_X87_INL_H_ |
OLD | NEW |