Chromium Code Reviews| Index: src/x64/assembler-x64.h |
| diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h |
| index 07afc129dc82c76b76a5eadb2c6bd3425eb0289e..0d7d058db09e58e83fc0bc51f5ad48a87101311d 100644 |
| --- a/src/x64/assembler-x64.h |
| +++ b/src/x64/assembler-x64.h |
| @@ -579,29 +579,36 @@ 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. |
| - // Distance between the start of the JS return sequence 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 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; |
| + // The length of call(kScratchRegister). |
|
danno
2013/08/02 14:01:20
I am not sure that it is help to include "Scratch"
haitao.feng
2013/08/02 15:10:56
If the register number is less than 8, then the ca
|
| + static const int kCallScratchRegisterInstructionSize = 3; |
| + // The length of call(Immediate32). |
| static const int kShortCallInstructionLength = 5; |
|
danno
2013/08/02 14:01:20
Unify to either "...Length" or "...Size". I think
haitao.feng
2013/08/02 15:10:56
Done.
|
| - static const int kPatchDebugBreakSlotReturnOffset = 4; |
| - |
| - // The debug break slot must be able to contain a call instruction. |
| - static const int kDebugBreakSlotLength = kCallInstructionLength; |
| + // The length of movq(kScratchRegister, address). |
| + static const int kMoveAddressIntoScratchRegisterInstructionSize = |
| + 2 + kPointerSize; |
| + // The length of movq(kScratchRegister, address) and call(kScratchRegister). |
| + static const int kCallSequenceLength = |
| + kMoveAddressIntoScratchRegisterInstructionSize + |
| + kCallScratchRegisterInstructionSize; |
| + |
| + // 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; |
|
haitao.feng
2013/08/02 04:41:17
It seems that we could use short call and RUNTIME_
|
| + 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 = |
| + kMoveAddressIntoScratchRegisterInstructionSize - kPointerSize; |
| // One byte opcode for test eax,0xXXXXXXXX. |
| static const byte kTestEaxByte = 0xA9; |