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