Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: runtime/vm/code_generator_ia32.cc

Issue 8851008: Add support for interrupting an isolate in the vm. Interrupts are (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/code_generator_ia32.cc
===================================================================
--- runtime/vm/code_generator_ia32.cc (revision 2528)
+++ runtime/vm/code_generator_ia32.cc (working copy)
@@ -210,6 +210,7 @@
}
if (FLAG_trace_functions) {
// Preserve ECX (ic-data array or object) and EDX (arguments descriptor).
+ __ nop(2); // Make sure the code is patchable.
__ pushl(ECX);
__ pushl(EDX);
const Function& function =
@@ -271,10 +272,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 +284,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 nop. Right now
+ // 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);
@@ -726,6 +726,16 @@
}
__ 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,
+ function.token_index(),
+ kStackOverflowRuntimeEntry);
+ __ Bind(&no_stack_overflow);
}

Powered by Google App Engine
This is Rietveld 408576698