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 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; |
| 565 return target_address_at(pc, constant_pool); |
| 566 } |
| 567 static inline void set_target_address_at(Address pc, |
| 568 Code* code, |
| 569 Address target) { |
| 570 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; |
| 571 set_target_address_at(pc, constant_pool, target); |
| 572 } |
560 | 573 |
561 // Return the code target address at a call site from the return address | 574 // Return the code target address at a call site from the return address |
562 // of that call in the instruction stream. | 575 // of that call in the instruction stream. |
563 static inline Address target_address_from_return_address(Address pc); | 576 static inline Address target_address_from_return_address(Address pc); |
564 | 577 |
565 // This sets the branch destination (which is in the instruction on x64). | 578 // This sets the branch destination (which is in the instruction on x64). |
566 // This is for calls and branches within generated code. | 579 // This is for calls and branches within generated code. |
567 inline static void deserialization_set_special_target_at( | 580 inline static void deserialization_set_special_target_at( |
568 Address instruction_payload, Address target) { | 581 Address instruction_payload, Code* code, Address target) { |
569 set_target_address_at(instruction_payload, target); | 582 set_target_address_at(instruction_payload, code, target); |
570 } | 583 } |
571 | 584 |
572 static inline RelocInfo::Mode RelocInfoNone() { | 585 static inline RelocInfo::Mode RelocInfoNone() { |
573 if (kPointerSize == kInt64Size) { | 586 if (kPointerSize == kInt64Size) { |
574 return RelocInfo::NONE64; | 587 return RelocInfo::NONE64; |
575 } else { | 588 } else { |
576 ASSERT(kPointerSize == kInt32Size); | 589 ASSERT(kPointerSize == kInt32Size); |
577 return RelocInfo::NONE32; | 590 return RelocInfo::NONE32; |
578 } | 591 } |
579 } | 592 } |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 private: | 1749 private: |
1737 Assembler* assembler_; | 1750 Assembler* assembler_; |
1738 #ifdef DEBUG | 1751 #ifdef DEBUG |
1739 int space_before_; | 1752 int space_before_; |
1740 #endif | 1753 #endif |
1741 }; | 1754 }; |
1742 | 1755 |
1743 } } // namespace v8::internal | 1756 } } // namespace v8::internal |
1744 | 1757 |
1745 #endif // V8_X64_ASSEMBLER_X64_H_ | 1758 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |