Index: runtime/vm/stub_code_ia32.cc |
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc |
index 0473a0d5db7548fb2c22ee3146f0f5f1ff4f5ab4..fab258eea6ec7eeac9598770bacfb2ced10c340b 100644 |
--- a/runtime/vm/stub_code_ia32.cc |
+++ b/runtime/vm/stub_code_ia32.cc |
@@ -461,19 +461,27 @@ static void GenerateDeoptimizationSequence(Assembler* assembler, |
} |
+// TOS: return address + call-instruction-size (5 bytes). |
// EAX: result, must be preserved |
void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { |
- // Return address for "call" to deopt stub. |
- __ pushl(Immediate(0xe1e1e1e1)); |
+ // Correct return address to point just after the call that is being |
+ // deoptimized. |
+ __ popl(EBX); |
+ __ subl(EBX, Immediate(CallPattern::pattern_length_in_bytes())); |
+ __ pushl(EBX); |
GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); |
} |
+// TOS: return address + call-instruction-size (5 bytes). |
// EAX: exception, must be preserved |
// EDX: stacktrace, must be preserved |
void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { |
- // Return address for "call" to deopt stub. |
- __ pushl(Immediate(0xe1e1e1e1)); |
+ // Correct return address to point just after the call that is being |
+ // deoptimized. |
+ __ popl(EBX); |
+ __ subl(EBX, Immediate(CallPattern::pattern_length_in_bytes())); |
+ __ pushl(EBX); |
GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); |
} |