Index: runtime/vm/code_generator_ia32.cc |
=================================================================== |
--- runtime/vm/code_generator_ia32.cc (revision 2291) |
+++ runtime/vm/code_generator_ia32.cc (working copy) |
@@ -271,10 +271,6 @@ |
// TODO(srdjan): Add check that no object is inlined in the first |
// 5 bytes (length of a jump instruction). |
void CodeGenerator::GeneratePreEntryCode() { |
- // Stack overflow check. |
- __ cmpl(ESP, |
- Address::Absolute(Isolate::Current()->stack_limit_address())); |
- __ j(BELOW_EQUAL, &StubCode::StackOverflowLabel()); |
// Do not optimize if: |
// - we count invocations. |
// - optimization disabled via negative 'optimization_invocation_threshold; |
@@ -287,6 +283,9 @@ |
parsed_function_.function().is_optimizable(); |
// Count invocation and check. |
if (FLAG_report_invocation_count || may_optimize) { |
+ // TODO(turnidge): It would be nice to remove this nops Right now |
Ivan Posva
2011/12/14 23:59:50
"these nops. Right now"
turnidge
2011/12/15 21:30:07
Changed to "this nop", now that it is a single ins
|
+ // we need it to make sure the function is still patchable. |
+ __ nop(5); |
const Function& function = |
Function::ZoneHandle(parsed_function_.function().raw()); |
__ LoadObject(EAX, function); |
@@ -714,6 +713,14 @@ |
} |
__ movl(Address(EBP, index * kWordSize), EAX); |
} |
+ |
+ // Generate stack overflow check. |
+ __ cmpl(ESP, |
+ Address::Absolute(Isolate::Current()->stack_limit_address())); |
+ Label no_stack_overflow; |
+ __ j(ABOVE, &no_stack_overflow); |
+ GenerateCallRuntime(AstNode::kNoId, 0, kStackOverflowRuntimeEntry); |
+ __ Bind(&no_stack_overflow); |
} |