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

Unified Diff: src/codegen-ia32.cc

Issue 18661: Experimental: defer the per-function and per-loop calls to the runtime... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 11 years, 11 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-ia32.cc
===================================================================
--- src/codegen-ia32.cc (revision 1127)
+++ src/codegen-ia32.cc (working copy)
@@ -1327,19 +1327,36 @@
}
+class DeferredStackCheck: public DeferredCode {
+ public:
+ DeferredStackCheck(CodeGenerator* generator)
+ : DeferredCode(generator) {
+ set_comment("[ DeferredStackCheck");
+ }
+
+ virtual void Generate();
+};
+
+
+void DeferredStackCheck::Generate() {
+ StackCheckStub stub;
Kasper Lund 2009/01/22 14:04:46 Maybe move this to just before it's used (CallStub
Kevin Millikin (Chromium) 2009/01/22 14:07:50 NP.
+ enter()->Bind();
+ // The stack check can trigger the debugger. Before calling it, all
+ // values including constants must be spilled to the frame.
+ generator()->frame()->SpillAll();
+ Result ignored = generator()->frame()->CallStub(&stub, 0);
+ exit()->Jump();
+}
+
+
void CodeGenerator::CheckStack() {
if (FLAG_check_stack) {
- JumpTarget stack_is_ok(this);
- StackCheckStub stub;
+ DeferredStackCheck* deferred = new DeferredStackCheck(this);
ExternalReference stack_guard_limit =
ExternalReference::address_of_stack_guard_limit();
__ cmp(esp, Operand::StaticVariable(stack_guard_limit));
- stack_is_ok.Branch(above_equal, taken);
- // The stack check can trigger the debugger. Before calling it, all
- // values including constants must be spilled to the frame.
- frame_->SpillAll();
- frame_->CallStub(&stub, 0);
- stack_is_ok.Bind();
+ deferred->enter()->Branch(below, not_taken);
+ deferred->exit()->Bind();
}
}
@@ -2765,7 +2782,7 @@
public:
DeferredRegExpLiteral(CodeGenerator* generator, RegExpLiteral* node)
: DeferredCode(generator), node_(node) {
- set_comment("[ RegExpDeferred");
+ set_comment("[ DeferredRegExpLiteral");
}
virtual void Generate();
private:
@@ -2834,7 +2851,7 @@
DeferredObjectLiteral(CodeGenerator* generator,
ObjectLiteral* node)
: DeferredCode(generator), node_(node) {
- set_comment("[ ObjectLiteralDeferred");
+ set_comment("[ DeferredObjectLiteral");
}
virtual void Generate();
private:
@@ -3771,7 +3788,7 @@
is_postfix_(is_postfix),
is_increment_(is_increment),
result_offset_(result_offset) {
- set_comment("[ CountOperationDeferred");
+ set_comment("[ DeferredCountOperation");
}
virtual void Generate();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698