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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 // to jump to other Code objects in the Code space in the heap. | 570 // to jump to other Code objects in the Code space in the heap. |
571 // Jumps to C functions are done indirectly through a 64-bit register holding | 571 // Jumps to C functions are done indirectly through a 64-bit register holding |
572 // the absolute address of the target. | 572 // the absolute address of the target. |
573 // These functions convert between absolute Addresses of Code objects and | 573 // These functions convert between absolute Addresses of Code objects and |
574 // the relative displacements stored in the code. | 574 // the relative displacements stored in the code. |
575 static inline Address target_address_at(Address pc); | 575 static inline Address target_address_at(Address pc); |
576 static inline void set_target_address_at(Address pc, Address target); | 576 static inline void set_target_address_at(Address pc, Address target); |
577 | 577 |
578 // 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). |
579 // This is for calls and branches within generated code. | 579 // This is for calls and branches within generated code. |
580 inline static void set_target_at(Address instruction_payload, | 580 inline static void deserialization_set_special_target_at( |
581 Address target) { | 581 Address instruction_payload, Address target) { |
582 set_target_address_at(instruction_payload, target); | 582 set_target_address_at(instruction_payload, target); |
583 } | 583 } |
584 | 584 |
585 // This sets the branch destination (which is a load instruction on x64). | 585 // This sets the branch destination (which is a load instruction on x64). |
586 // This is for calls and branches to runtime code. | 586 // This is for calls and branches to runtime code. |
587 inline static void set_external_target_at(Address instruction_payload, | 587 inline static void set_external_target_at(Address instruction_payload, |
588 Address target) { | 588 Address target) { |
589 *reinterpret_cast<Address*>(instruction_payload) = target; | 589 *reinterpret_cast<Address*>(instruction_payload) = target; |
590 } | 590 } |
591 | 591 |
592 inline Handle<Object> code_target_object_handle_at(Address pc); | 592 inline Handle<Object> code_target_object_handle_at(Address pc); |
593 // Number of bytes taken up by the branch target in the code. | 593 // Number of bytes taken up by the branch target in the code. |
594 static const int kCallTargetSize = 4; // Use 32-bit displacement. | 594 static const int kSpecialTargetSize = 4; // Use 32-bit displacement. |
595 static const int kExternalTargetSize = 8; // Use 64-bit absolute. | |
596 // Distance between the address of the code target in the call instruction | 595 // Distance between the address of the code target in the call instruction |
597 // and the return address pushed on the stack. | 596 // and the return address pushed on the stack. |
598 static const int kCallTargetAddressOffset = 4; // Use 32-bit displacement. | 597 static const int kCallTargetAddressOffset = 4; // Use 32-bit displacement. |
599 // Distance between the start of the JS return sequence and where the | 598 // Distance between the start of the JS return sequence and where the |
600 // 32-bit displacement of a near call would be, relative to the pushed | 599 // 32-bit displacement of a near call would be, relative to the pushed |
601 // return address. TODO: Use return sequence length instead. | 600 // return address. TODO: Use return sequence length instead. |
602 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; | 601 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; |
603 static const int kPatchReturnSequenceAddressOffset = 13 - 4; | 602 static const int kPatchReturnSequenceAddressOffset = 13 - 4; |
604 // Distance between start of patched debug break slot and where the | 603 // Distance between start of patched debug break slot and where the |
605 // 32-bit displacement of a near call would be, relative to the pushed | 604 // 32-bit displacement of a near call would be, relative to the pushed |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1664 private: | 1663 private: |
1665 Assembler* assembler_; | 1664 Assembler* assembler_; |
1666 #ifdef DEBUG | 1665 #ifdef DEBUG |
1667 int space_before_; | 1666 int space_before_; |
1668 #endif | 1667 #endif |
1669 }; | 1668 }; |
1670 | 1669 |
1671 } } // namespace v8::internal | 1670 } } // namespace v8::internal |
1672 | 1671 |
1673 #endif // V8_X64_ASSEMBLER_X64_H_ | 1672 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |