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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 // Assembler functions are invoked in between GetCode() calls. | 548 // Assembler functions are invoked in between GetCode() calls. |
549 void GetCode(CodeDesc* desc); | 549 void GetCode(CodeDesc* desc); |
550 | 550 |
551 // Read/Modify the code target in the relative branch/call instruction at pc. | 551 // Read/Modify the code target in the relative branch/call instruction at pc. |
552 // On the x64 architecture, we use relative jumps with a 32-bit displacement | 552 // On the x64 architecture, we use relative jumps with a 32-bit displacement |
553 // to jump to other Code objects in the Code space in the heap. | 553 // to jump to other Code objects in the Code space in the heap. |
554 // Jumps to C functions are done indirectly through a 64-bit register holding | 554 // Jumps to C functions are done indirectly through a 64-bit register holding |
555 // the absolute address of the target. | 555 // the absolute address of the target. |
556 // These functions convert between absolute Addresses of Code objects and | 556 // These functions convert between absolute Addresses of Code objects and |
557 // the relative displacements stored in the code. | 557 // the relative displacements stored in the code. |
558 static inline Address target_address_at(Address pc); | 558 static inline Address target_address_at(Address pc, |
559 static inline void set_target_address_at(Address pc, Address target); | 559 ConstantPoolArray* constant_pool); |
| 560 static inline void set_target_address_at(Address pc, |
| 561 ConstantPoolArray* constant_pool, |
| 562 Address target); |
| 563 static inline Address target_address_at(Address pc, Code* code) { |
| 564 return target_address_at(pc, code->constant_pool()); |
| 565 } |
| 566 static inline void set_target_address_at(Address pc, |
| 567 Code* code, |
| 568 Address target) { |
| 569 set_target_address_at(pc, code->constant_pool(), target); |
| 570 } |
560 | 571 |
561 // Return the code target address at a call site from the return address | 572 // Return the code target address at a call site from the return address |
562 // of that call in the instruction stream. | 573 // of that call in the instruction stream. |
563 static inline Address target_address_from_return_address(Address pc); | 574 static inline Address target_address_from_return_address(Address pc); |
564 | 575 |
565 // This sets the branch destination (which is in the instruction on x64). | 576 // This sets the branch destination (which is in the instruction on x64). |
566 // This is for calls and branches within generated code. | 577 // This is for calls and branches within generated code. |
567 inline static void deserialization_set_special_target_at( | 578 inline static void deserialization_set_special_target_at( |
568 Address instruction_payload, Address target) { | 579 Address instruction_payload, Code* code, Address target) { |
569 set_target_address_at(instruction_payload, target); | 580 set_target_address_at(instruction_payload, code, target); |
570 } | 581 } |
571 | 582 |
572 static inline RelocInfo::Mode RelocInfoNone() { | 583 static inline RelocInfo::Mode RelocInfoNone() { |
573 if (kPointerSize == kInt64Size) { | 584 if (kPointerSize == kInt64Size) { |
574 return RelocInfo::NONE64; | 585 return RelocInfo::NONE64; |
575 } else { | 586 } else { |
576 ASSERT(kPointerSize == kInt32Size); | 587 ASSERT(kPointerSize == kInt32Size); |
577 return RelocInfo::NONE32; | 588 return RelocInfo::NONE32; |
578 } | 589 } |
579 } | 590 } |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 private: | 1744 private: |
1734 Assembler* assembler_; | 1745 Assembler* assembler_; |
1735 #ifdef DEBUG | 1746 #ifdef DEBUG |
1736 int space_before_; | 1747 int space_before_; |
1737 #endif | 1748 #endif |
1738 }; | 1749 }; |
1739 | 1750 |
1740 } } // namespace v8::internal | 1751 } } // namespace v8::internal |
1741 | 1752 |
1742 #endif // V8_X64_ASSEMBLER_X64_H_ | 1753 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |