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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 void Assembler::emit_code_relative_offset(Label* label) { | 444 void Assembler::emit_code_relative_offset(Label* label) { |
445 if (label->is_bound()) { | 445 if (label->is_bound()) { |
446 int32_t pos; | 446 int32_t pos; |
447 pos = label->pos() + Code::kHeaderSize - kHeapObjectTag; | 447 pos = label->pos() + Code::kHeaderSize - kHeapObjectTag; |
448 emit(pos); | 448 emit(pos); |
449 } else { | 449 } else { |
450 emit_disp(label, Displacement::CODE_RELATIVE); | 450 emit_disp(label, Displacement::CODE_RELATIVE); |
451 } | 451 } |
452 } | 452 } |
453 | 453 |
| 454 void Assembler::emit_b(Immediate x) { |
| 455 DCHECK(x.is_int8() || x.is_uint8()); |
| 456 uint8_t value = static_cast<uint8_t>(x.x_); |
| 457 *pc_++ = value; |
| 458 } |
454 | 459 |
455 void Assembler::emit_w(const Immediate& x) { | 460 void Assembler::emit_w(const Immediate& x) { |
456 DCHECK(RelocInfo::IsNone(x.rmode_)); | 461 DCHECK(RelocInfo::IsNone(x.rmode_)); |
457 uint16_t value = static_cast<uint16_t>(x.x_); | 462 uint16_t value = static_cast<uint16_t>(x.x_); |
458 reinterpret_cast<uint16_t*>(pc_)[0] = value; | 463 reinterpret_cast<uint16_t*>(pc_)[0] = value; |
459 pc_ += sizeof(uint16_t); | 464 pc_ += sizeof(uint16_t); |
460 } | 465 } |
461 | 466 |
462 | 467 |
463 Address Assembler::target_address_at(Address pc, Address constant_pool) { | 468 Address Assembler::target_address_at(Address pc, Address constant_pool) { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 573 |
569 Operand::Operand(Immediate imm) { | 574 Operand::Operand(Immediate imm) { |
570 // [disp/r] | 575 // [disp/r] |
571 set_modrm(0, ebp); | 576 set_modrm(0, ebp); |
572 set_dispr(imm.x_, imm.rmode_); | 577 set_dispr(imm.x_, imm.rmode_); |
573 } | 578 } |
574 } // namespace internal | 579 } // namespace internal |
575 } // namespace v8 | 580 } // namespace v8 |
576 | 581 |
577 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 582 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
OLD | NEW |