| 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 } | 385 } |
| 386 | 386 |
| 387 | 387 |
| 388 void Assembler::emit_disp(Label* L, Displacement::Type type) { | 388 void Assembler::emit_disp(Label* L, Displacement::Type type) { |
| 389 Displacement disp(L, type); | 389 Displacement disp(L, type); |
| 390 L->link_to(pc_offset()); | 390 L->link_to(pc_offset()); |
| 391 emit(static_cast<int>(disp.data())); | 391 emit(static_cast<int>(disp.data())); |
| 392 } | 392 } |
| 393 | 393 |
| 394 | 394 |
| 395 void Assembler::emit_near_disp(Label* L) { |
| 396 byte disp = 0x00; |
| 397 if (L->is_near_linked()) { |
| 398 int offset = L->near_link_pos() - pc_offset(); |
| 399 ASSERT(is_int8(offset)); |
| 400 disp = static_cast<byte>(offset & 0xFF); |
| 401 } |
| 402 L->link_to(pc_offset(), Label::kNear); |
| 403 *pc_++ = disp; |
| 404 } |
| 405 |
| 406 |
| 395 void Operand::set_modrm(int mod, Register rm) { | 407 void Operand::set_modrm(int mod, Register rm) { |
| 396 ASSERT((mod & -4) == 0); | 408 ASSERT((mod & -4) == 0); |
| 397 buf_[0] = mod << 6 | rm.code(); | 409 buf_[0] = mod << 6 | rm.code(); |
| 398 len_ = 1; | 410 len_ = 1; |
| 399 } | 411 } |
| 400 | 412 |
| 401 | 413 |
| 402 void Operand::set_sib(ScaleFactor scale, Register index, Register base) { | 414 void Operand::set_sib(ScaleFactor scale, Register index, Register base) { |
| 403 ASSERT(len_ == 1); | 415 ASSERT(len_ == 1); |
| 404 ASSERT((scale & -4) == 0); | 416 ASSERT((scale & -4) == 0); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 449 |
| 438 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { | 450 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { |
| 439 // [disp/r] | 451 // [disp/r] |
| 440 set_modrm(0, ebp); | 452 set_modrm(0, ebp); |
| 441 set_dispr(disp, rmode); | 453 set_dispr(disp, rmode); |
| 442 } | 454 } |
| 443 | 455 |
| 444 } } // namespace v8::internal | 456 } } // namespace v8::internal |
| 445 | 457 |
| 446 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 458 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
| OLD | NEW |