Index: src/x64/deoptimizer-x64.cc |
diff --git a/src/x64/deoptimizer-x64.cc b/src/x64/deoptimizer-x64.cc |
index 20f507bdfbf65e75bbfec19b5e8fb3939967d0e7..0da9e86f0f5ca3eb9063eea6d80f905ab65d8b24 100644 |
--- a/src/x64/deoptimizer-x64.cc |
+++ b/src/x64/deoptimizer-x64.cc |
@@ -116,8 +116,6 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) { |
static const byte kJnsInstruction = 0x79; |
static const byte kJnsOffset = 0x1f; |
-static const byte kJaeInstruction = 0x73; |
-static const byte kJaeOffset = 0x07; |
static const byte kCallInstruction = 0xe8; |
static const byte kNopByteOne = 0x66; |
static const byte kNopByteTwo = 0x90; |
@@ -129,31 +127,26 @@ void Deoptimizer::PatchStackCheckCodeAt(Code* unoptimized_code, |
Address call_target_address = pc_after - kIntSize; |
ASSERT_EQ(check_code->entry(), |
Assembler::target_address_at(call_target_address)); |
- // The stack check code matches the pattern: |
+ // The back edge bookkeeping code matches the pattern: |
// |
- // cmp rsp, <limit> |
- // jae ok |
+ // add <profiling_counter>, <-delta> |
+ // jns ok |
// call <stack guard> |
// test rax, <loop nesting depth> |
// ok: ... |
// |
// We will patch away the branch so the code is: |
// |
- // cmp rsp, <limit> ;; Not changed |
+ // add <profiling_counter>, <-delta> ;; Not changed |
// nop |
// nop |
// call <on-stack replacment> |
// test rax, <loop nesting depth> |
// ok: |
// |
- if (FLAG_count_based_interrupts) { |
- ASSERT_EQ(kJnsInstruction, *(call_target_address - 3)); |
- ASSERT_EQ(kJnsOffset, *(call_target_address - 2)); |
- } else { |
- ASSERT_EQ(kJaeInstruction, *(call_target_address - 3)); |
- ASSERT_EQ(kJaeOffset, *(call_target_address - 2)); |
- } |
- ASSERT_EQ(kCallInstruction, *(call_target_address - 1)); |
+ ASSERT_EQ(kJnsInstruction, *(call_target_address - 3)); |
+ ASSERT_EQ(kJnsOffset, *(call_target_address - 2)); |
+ ASSERT_EQ(kCallInstruction, *(call_target_address - 1)); |
*(call_target_address - 3) = kNopByteOne; |
*(call_target_address - 2) = kNopByteTwo; |
Assembler::set_target_address_at(call_target_address, |
@@ -176,13 +169,8 @@ void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code, |
ASSERT_EQ(kNopByteOne, *(call_target_address - 3)); |
ASSERT_EQ(kNopByteTwo, *(call_target_address - 2)); |
ASSERT_EQ(kCallInstruction, *(call_target_address - 1)); |
- if (FLAG_count_based_interrupts) { |
- *(call_target_address - 3) = kJnsInstruction; |
- *(call_target_address - 2) = kJnsOffset; |
- } else { |
- *(call_target_address - 3) = kJaeInstruction; |
- *(call_target_address - 2) = kJaeOffset; |
- } |
+ *(call_target_address - 3) = kJnsInstruction; |
+ *(call_target_address - 2) = kJnsOffset; |
Assembler::set_target_address_at(call_target_address, |
check_code->entry()); |