Index: src/ia32/builtins-ia32.cc |
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc |
index 5169627906fd4511c9ee01a9a755b659cccddaca..d50d5fd835a8459d703d79e25c90718eea352222 100644 |
--- a/src/ia32/builtins-ia32.cc |
+++ b/src/ia32/builtins-ia32.cc |
@@ -1326,6 +1326,24 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
} |
+void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { |
+ // We check the stack limit as indicator that recompilation might be done. |
+ Label ok; |
+ ExternalReference stack_limit = |
+ ExternalReference::address_of_stack_limit(masm->isolate()); |
+ __ cmp(esp, Operand::StaticVariable(stack_limit)); |
+ __ j(above_equal, &ok, Label::kNear); |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ __ CallRuntime(Runtime::kStackGuard, 0); |
+ } |
+ __ jmp(masm->isolate()->builtins()->OnStackReplacement(), |
+ RelocInfo::CODE_TARGET); |
+ |
+ __ bind(&ok); |
+ __ ret(0); |
+} |
+ |
#undef __ |
} |
} // namespace v8::internal |