diff options
Diffstat (limited to 'chromium/v8/src/x64/assembler-x64.cc')
-rw-r--r-- | chromium/v8/src/x64/assembler-x64.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chromium/v8/src/x64/assembler-x64.cc b/chromium/v8/src/x64/assembler-x64.cc index 8969d89a6a7..f5939c3b7e1 100644 --- a/chromium/v8/src/x64/assembler-x64.cc +++ b/chromium/v8/src/x64/assembler-x64.cc @@ -164,7 +164,10 @@ void CpuFeatures::Probe() { // Patch the code at the current PC with a call to the target address. // Additional guard int3 instructions can be added if required. void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { - int code_size = Assembler::kCallSequenceLength + guard_bytes; + // Load register with immediate 64 and call through a register instructions + // takes up 13 bytes and int3 takes up one byte. + static const int kCallCodeSize = 13; + int code_size = kCallCodeSize + guard_bytes; // Create a code patcher. CodePatcher patcher(pc_, code_size); @@ -180,7 +183,7 @@ void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { patcher.masm()->call(r10); // Check that the size of the code generated is as expected. - ASSERT_EQ(Assembler::kCallSequenceLength, + ASSERT_EQ(kCallCodeSize, patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize)); // Add the requested number of int3 instructions after the call. |