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

Unified Diff: src/codegen-ia32.cc

Issue 42067: Fix issue 268 by explicitly calling Unuse (to deallocate all contained... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 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 | « src/codegen-ia32.h ('k') | 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 1482)
+++ src/codegen-ia32.cc (working copy)
@@ -307,7 +307,11 @@
DeleteFrame();
// Process any deferred code using the register allocator.
- ProcessDeferred();
+ if (HasStackOverflow()) {
+ ClearDeferred();
+ } else {
+ ProcessDeferred();
+ }
// There is no need to delete the register allocator, it is a
// stack-allocated local.
@@ -1567,6 +1571,7 @@
if (node->break_target()->is_linked()) {
node->break_target()->Bind();
}
+ node->break_target()->Unuse();
}
@@ -2094,37 +2099,39 @@
// There are two ways to reach the body: from the corresponding
// test or as the fall through of the previous body.
- if (!clause->body_target()->is_linked() && !has_valid_frame()) {
- // If we have neither, skip this body.
- continue;
- } else if (clause->body_target()->is_linked() && has_valid_frame()) {
- // If we have both, put a jump on the fall through path to avoid
- // the dropping of the switch value on the test path. The
- // exception is the default which has already had the switch
- // value dropped.
- if (clause->is_default()) {
- clause->body_target()->Bind();
+ if (clause->body_target()->is_linked() || has_valid_frame()) {
+ if (clause->body_target()->is_linked()) {
+ if (has_valid_frame()) {
+ // If we have both a jump to the test and a fall through, put
+ // a jump on the fall through path to avoid the dropping of
+ // the switch value on the test path. The exception is the
+ // default which has already had the switch value dropped.
+ if (clause->is_default()) {
+ clause->body_target()->Bind();
+ } else {
+ JumpTarget body(this);
+ body.Jump();
+ clause->body_target()->Bind();
+ frame_->Drop();
+ body.Bind();
+ }
+ } else {
+ // No fall through to worry about.
+ clause->body_target()->Bind();
+ if (!clause->is_default()) {
+ frame_->Drop();
+ }
+ }
} else {
- JumpTarget body(this);
- body.Jump();
- clause->body_target()->Bind();
- frame_->Drop();
- body.Bind();
+ // Otherwise, we have only fall through.
+ ASSERT(has_valid_frame());
}
- } else if (clause->body_target()->is_linked()) {
- // No fall through to worry about.
- clause->body_target()->Bind();
- if (!clause->is_default()) {
- frame_->Drop();
- }
- } else {
- // Otherwise, we have only fall through.
- ASSERT(has_valid_frame());
+
+ // We are now prepared to compile the body.
+ Comment cmnt(masm_, "[ Case body");
+ VisitStatements(clause->statements());
}
-
- // We are now prepared to compile the body.
- Comment cmnt(masm_, "[ Case body");
- VisitStatements(clause->statements());
+ clause->body_target()->Unuse();
}
// We may not have a valid frame here so bind the break target only
@@ -2132,6 +2139,7 @@
if (node->break_target()->is_linked()) {
node->break_target()->Bind();
}
+ node->break_target()->Unuse();
}
@@ -2452,6 +2460,8 @@
}
DecrementLoopNesting();
+ node->continue_target()->Unuse();
+ node->break_target()->Unuse();
}
@@ -2636,6 +2646,9 @@
// Exit.
exit.Bind();
+
+ node->continue_target()->Unuse();
+ node->break_target()->Unuse();
}
« no previous file with comments | « src/codegen-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698