| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 451 |
| 452 // Read/Modify the code target in the relative branch/call instruction at pc. | 452 // Read/Modify the code target in the relative branch/call instruction at pc. |
| 453 // On the x64 architecture, we use relative jumps with a 32-bit displacement | 453 // On the x64 architecture, we use relative jumps with a 32-bit displacement |
| 454 // to jump to other Code objects in the Code space in the heap. | 454 // to jump to other Code objects in the Code space in the heap. |
| 455 // Jumps to C functions are done indirectly through a 64-bit register holding | 455 // Jumps to C functions are done indirectly through a 64-bit register holding |
| 456 // the absolute address of the target. | 456 // the absolute address of the target. |
| 457 // These functions convert between absolute Addresses of Code objects and | 457 // These functions convert between absolute Addresses of Code objects and |
| 458 // the relative displacements stored in the code. | 458 // the relative displacements stored in the code. |
| 459 static inline Address target_address_at(Address pc); | 459 static inline Address target_address_at(Address pc); |
| 460 static inline void set_target_address_at(Address pc, Address target); | 460 static inline void set_target_address_at(Address pc, Address target); |
| 461 // This sets the branch destination (which is in the instruction on x64). |
| 462 inline static void set_target_at(Address instruction_payload, |
| 463 Address target) { |
| 464 set_target_address_at(instruction_payload, target); |
| 465 } |
| 461 inline Handle<Object> code_target_object_handle_at(Address pc); | 466 inline Handle<Object> code_target_object_handle_at(Address pc); |
| 462 // Number of bytes taken up by the branch target in the code. | 467 // Number of bytes taken up by the branch target in the code. |
| 463 static const int kCallTargetSize = 4; // Use 32-bit displacement. | 468 static const int kCallTargetSize = 4; // Use 32-bit displacement. |
| 464 // Distance between the address of the code target in the call instruction | 469 // Distance between the address of the code target in the call instruction |
| 465 // and the return address pushed on the stack. | 470 // and the return address pushed on the stack. |
| 466 static const int kCallTargetAddressOffset = 4; // Use 32-bit displacement. | 471 static const int kCallTargetAddressOffset = 4; // Use 32-bit displacement. |
| 467 // Distance between the start of the JS return sequence and where the | 472 // Distance between the start of the JS return sequence and where the |
| 468 // 32-bit displacement of a near call would be, relative to the pushed | 473 // 32-bit displacement of a near call would be, relative to the pushed |
| 469 // return address. TODO: Use return sequence length instead. | 474 // return address. TODO: Use return sequence length instead. |
| 470 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; | 475 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 private: | 1376 private: |
| 1372 Assembler* assembler_; | 1377 Assembler* assembler_; |
| 1373 #ifdef DEBUG | 1378 #ifdef DEBUG |
| 1374 int space_before_; | 1379 int space_before_; |
| 1375 #endif | 1380 #endif |
| 1376 }; | 1381 }; |
| 1377 | 1382 |
| 1378 } } // namespace v8::internal | 1383 } } // namespace v8::internal |
| 1379 | 1384 |
| 1380 #endif // V8_X64_ASSEMBLER_X64_H_ | 1385 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |