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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 inline Handle<Object> code_target_object_handle_at(Address pc); | 461 inline Handle<Object> code_target_object_handle_at(Address pc); |
| 462 // Number of bytes taken up by the branch target in the code. |
| 463 static const int kCallTargetSize = 4; // Use 32-bit displacement. |
462 // Distance between the address of the code target in the call instruction | 464 // Distance between the address of the code target in the call instruction |
463 // and the return address pushed on the stack. | 465 // and the return address pushed on the stack. |
464 static const int kCallTargetAddressOffset = 4; // Use 32-bit displacement. | 466 static const int kCallTargetAddressOffset = 4; // Use 32-bit displacement. |
465 // Distance between the start of the JS return sequence and where the | 467 // Distance between the start of the JS return sequence and where the |
466 // 32-bit displacement of a near call would be, relative to the pushed | 468 // 32-bit displacement of a near call would be, relative to the pushed |
467 // return address. TODO: Use return sequence length instead. | 469 // return address. TODO: Use return sequence length instead. |
468 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; | 470 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; |
469 static const int kPatchReturnSequenceAddressOffset = 13 - 4; | 471 static const int kPatchReturnSequenceAddressOffset = 13 - 4; |
470 // TODO(X64): Rename this, removing the "Real", after changing the above. | 472 // TODO(X64): Rename this, removing the "Real", after changing the above. |
471 static const int kRealPatchReturnSequenceAddressOffset = 2; | 473 static const int kRealPatchReturnSequenceAddressOffset = 2; |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 private: | 1367 private: |
1366 Assembler* assembler_; | 1368 Assembler* assembler_; |
1367 #ifdef DEBUG | 1369 #ifdef DEBUG |
1368 int space_before_; | 1370 int space_before_; |
1369 #endif | 1371 #endif |
1370 }; | 1372 }; |
1371 | 1373 |
1372 } } // namespace v8::internal | 1374 } } // namespace v8::internal |
1373 | 1375 |
1374 #endif // V8_X64_ASSEMBLER_X64_H_ | 1376 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |