| Index: src/x64/deoptimizer-x64.cc
|
| diff --git a/src/x64/deoptimizer-x64.cc b/src/x64/deoptimizer-x64.cc
|
| index 303b756cacdbd0ef3350e51a8831de4b68f0e45d..a5e4583aa24b1fe2a9d9c5b9083f239a37cfaa86 100644
|
| --- a/src/x64/deoptimizer-x64.cc
|
| +++ b/src/x64/deoptimizer-x64.cc
|
| @@ -82,87 +82,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
|
| }
|
|
|
|
|
| -static const byte kJnsInstruction = 0x79;
|
| -static const byte kJnsOffset = 0x1d;
|
| -static const byte kCallInstruction = 0xe8;
|
| -static const byte kNopByteOne = 0x66;
|
| -static const byte kNopByteTwo = 0x90;
|
| -
|
| -// The back edge bookkeeping code matches the pattern:
|
| -//
|
| -// add <profiling_counter>, <-delta>
|
| -// jns ok
|
| -// call <stack guard>
|
| -// ok:
|
| -//
|
| -// We will patch away the branch so the code is:
|
| -//
|
| -// add <profiling_counter>, <-delta> ;; Not changed
|
| -// nop
|
| -// nop
|
| -// call <on-stack replacment>
|
| -// ok:
|
| -
|
| -void Deoptimizer::PatchInterruptCodeAt(Code* unoptimized_code,
|
| - Address pc_after,
|
| - Code* replacement_code) {
|
| - // Turn the jump into nops.
|
| - Address call_target_address = pc_after - kIntSize;
|
| - *(call_target_address - 3) = kNopByteOne;
|
| - *(call_target_address - 2) = kNopByteTwo;
|
| - // Replace the call address.
|
| - Assembler::set_target_address_at(call_target_address,
|
| - replacement_code->entry());
|
| -
|
| - unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch(
|
| - unoptimized_code, call_target_address, replacement_code);
|
| -}
|
| -
|
| -
|
| -void Deoptimizer::RevertInterruptCodeAt(Code* unoptimized_code,
|
| - Address pc_after,
|
| - Code* interrupt_code) {
|
| - // Restore the original jump.
|
| - Address call_target_address = pc_after - kIntSize;
|
| - *(call_target_address - 3) = kJnsInstruction;
|
| - *(call_target_address - 2) = kJnsOffset;
|
| - // Restore the original call address.
|
| - Assembler::set_target_address_at(call_target_address,
|
| - interrupt_code->entry());
|
| -
|
| - interrupt_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch(
|
| - unoptimized_code, call_target_address, interrupt_code);
|
| -}
|
| -
|
| -
|
| -#ifdef DEBUG
|
| -Deoptimizer::InterruptPatchState Deoptimizer::GetInterruptPatchState(
|
| - Isolate* isolate,
|
| - Code* unoptimized_code,
|
| - Address pc_after) {
|
| - Address call_target_address = pc_after - kIntSize;
|
| - ASSERT_EQ(kCallInstruction, *(call_target_address - 1));
|
| - if (*(call_target_address - 3) == kNopByteOne) {
|
| - ASSERT_EQ(kNopByteTwo, *(call_target_address - 2));
|
| - Code* osr_builtin =
|
| - isolate->builtins()->builtin(Builtins::kOnStackReplacement);
|
| - ASSERT_EQ(osr_builtin->entry(),
|
| - Assembler::target_address_at(call_target_address));
|
| - return PATCHED_FOR_OSR;
|
| - } else {
|
| - // Get the interrupt stub code object to match against from cache.
|
| - Code* interrupt_builtin =
|
| - isolate->builtins()->builtin(Builtins::kInterruptCheck);
|
| - ASSERT_EQ(interrupt_builtin->entry(),
|
| - Assembler::target_address_at(call_target_address));
|
| - ASSERT_EQ(kJnsInstruction, *(call_target_address - 3));
|
| - ASSERT_EQ(kJnsOffset, *(call_target_address - 2));
|
| - return NOT_PATCHED;
|
| - }
|
| -}
|
| -#endif // DEBUG
|
| -
|
| -
|
| void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
|
| // Set the register values. The values are not important as there are no
|
| // callee saved registers in JavaScript frames, so all registers are
|
|
|