Index: src/arm/deoptimizer-arm.cc |
diff --git a/src/arm/deoptimizer-arm.cc b/src/arm/deoptimizer-arm.cc |
index 84acba287340bcb1b79b8f555939251099fbb518..dcebd558c5245a4f1ac7583ace8400686b7eb88b 100644 |
--- a/src/arm/deoptimizer-arm.cc |
+++ b/src/arm/deoptimizer-arm.cc |
@@ -114,7 +114,6 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) { |
} |
-static const int32_t kBranchBeforeStackCheck = 0x2a000001; |
static const int32_t kBranchBeforeInterrupt = 0x5a000004; |
@@ -123,24 +122,21 @@ void Deoptimizer::PatchStackCheckCodeAt(Code* unoptimized_code, |
Code* check_code, |
Code* replacement_code) { |
const int kInstrSize = Assembler::kInstrSize; |
- // The call of the stack guard check has the following form: |
- // e1 5d 00 0c cmp sp, <limit> |
- // 2a 00 00 01 bcs ok |
+ // The back edge bookkeeping code matches the pattern: |
+ // |
+ // <decrement profiling counter> |
+ // 2a 00 00 01 bpl ok |
// e5 9f c? ?? ldr ip, [pc, <stack guard address>] |
// e1 2f ff 3c blx ip |
ASSERT(Memory::int32_at(pc_after - kInstrSize) == kBlxIp); |
ASSERT(Assembler::IsLdrPcImmediateOffset( |
Assembler::instr_at(pc_after - 2 * kInstrSize))); |
- if (FLAG_count_based_interrupts) { |
- ASSERT_EQ(kBranchBeforeInterrupt, |
- Memory::int32_at(pc_after - 3 * kInstrSize)); |
- } else { |
- ASSERT_EQ(kBranchBeforeStackCheck, |
- Memory::int32_at(pc_after - 3 * kInstrSize)); |
- } |
+ ASSERT_EQ(kBranchBeforeInterrupt, |
+ Memory::int32_at(pc_after - 3 * kInstrSize)); |
// We patch the code to the following form: |
- // e1 5d 00 0c cmp sp, <limit> |
+ // |
+ // <decrement profiling counter> |
// e1 a0 00 00 mov r0, r0 (NOP) |
// e5 9f c? ?? ldr ip, [pc, <on-stack replacement address>] |
// e1 2f ff 3c blx ip |
@@ -177,15 +173,9 @@ void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code, |
// Replace NOP with conditional jump. |
CodePatcher patcher(pc_after - 3 * kInstrSize, 1); |
- if (FLAG_count_based_interrupts) { |
- patcher.masm()->b(+16, pl); |
- ASSERT_EQ(kBranchBeforeInterrupt, |
- Memory::int32_at(pc_after - 3 * kInstrSize)); |
- } else { |
- patcher.masm()->b(+4, cs); |
- ASSERT_EQ(kBranchBeforeStackCheck, |
- Memory::int32_at(pc_after - 3 * kInstrSize)); |
- } |
+ patcher.masm()->b(+16, pl); |
+ ASSERT_EQ(kBranchBeforeInterrupt, |
+ Memory::int32_at(pc_after - 3 * kInstrSize)); |
// Replace the stack check address in the constant pool |
// with the entry address of the replacement code. |