diff options
Diffstat (limited to 'chromium/v8/src/x64/assembler-x64.h')
-rw-r--r-- | chromium/v8/src/x64/assembler-x64.h | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/chromium/v8/src/x64/assembler-x64.h b/chromium/v8/src/x64/assembler-x64.h index 4e36b6e4bc4..07afc129dc8 100644 --- a/chromium/v8/src/x64/assembler-x64.h +++ b/chromium/v8/src/x64/assembler-x64.h @@ -579,36 +579,29 @@ class Assembler : public AssemblerBase { // Distance between the address of the code target in the call instruction // and the return address pushed on the stack. static const int kCallTargetAddressOffset = 4; // Use 32-bit displacement. - // The length of call(kScratchRegister). - static const int kCallScratchRegisterInstructionLength = 3; - // The length of call(Immediate32). - static const int kShortCallInstructionLength = 5; - // The length of movq(kScratchRegister, address). - static const int kMoveAddressIntoScratchRegisterInstructionLength = - 2 + kPointerSize; - // The length of movq(kScratchRegister, address) and call(kScratchRegister). - static const int kCallSequenceLength = - kMoveAddressIntoScratchRegisterInstructionLength + - kCallScratchRegisterInstructionLength; - - // The js return and debug break slot must be able to contain an indirect - // call sequence, some x64 JS code is padded with int3 to make it large - // enough to hold an instruction when the debugger patches it. - static const int kJSReturnSequenceLength = kCallSequenceLength; - static const int kDebugBreakSlotLength = kCallSequenceLength; - static const int kPatchDebugBreakSlotReturnOffset = kCallTargetAddressOffset; - // Distance between the start of the JS return sequence and where the - // 32-bit displacement of a short call would be. The short call is from - // SetDebugBreakAtIC from debug-x64.cc. - static const int kPatchReturnSequenceAddressOffset = - kJSReturnSequenceLength - kPatchDebugBreakSlotReturnOffset; // Distance between the start of the JS return sequence and where the - // 32-bit displacement of a short call would be. The short call is from - // SetDebugBreakAtIC from debug-x64.cc. - static const int kPatchDebugBreakSlotAddressOffset = - kDebugBreakSlotLength - kPatchDebugBreakSlotReturnOffset; - static const int kRealPatchReturnSequenceAddressOffset = - kMoveAddressIntoScratchRegisterInstructionLength - kPointerSize; + // 32-bit displacement of a near call would be, relative to the pushed + // return address. TODO: Use return sequence length instead. + // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; + static const int kPatchReturnSequenceAddressOffset = 13 - 4; + // Distance between start of patched debug break slot and where the + // 32-bit displacement of a near call would be, relative to the pushed + // return address. TODO: Use return sequence length instead. + // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; + static const int kPatchDebugBreakSlotAddressOffset = 13 - 4; + // TODO(X64): Rename this, removing the "Real", after changing the above. + static const int kRealPatchReturnSequenceAddressOffset = 2; + + // Some x64 JS code is padded with int3 to make it large + // enough to hold an instruction when the debugger patches it. + static const int kJumpInstructionLength = 13; + static const int kCallInstructionLength = 13; + static const int kJSReturnSequenceLength = 13; + static const int kShortCallInstructionLength = 5; + static const int kPatchDebugBreakSlotReturnOffset = 4; + + // The debug break slot must be able to contain a call instruction. + static const int kDebugBreakSlotLength = kCallInstructionLength; // One byte opcode for test eax,0xXXXXXXXX. static const byte kTestEaxByte = 0xA9; |