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

Unified Diff: src/jump-target-ia32.cc

Issue 17044: Experimental: begin using the register allocator for do and while... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 11 years, 12 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jump-target-ia32.cc
===================================================================
--- src/jump-target-ia32.cc (revision 1023)
+++ src/jump-target-ia32.cc (working copy)
@@ -137,11 +137,27 @@
} else {
// No code needs to be emitted to merge to the expected frame at the
// actual function return.
- if (!cgen_->IsActualFunctionReturn(this)) {
- current_frame->MergeTo(expected_frame_);
+ if (cgen_->IsActualFunctionReturn(this)) {
+ ASSERT(cgen_->HasValidEntryRegisters());
+ __ j(cc, &label_, hint);
+ } else {
+ // We negate the condition and emit the code to merge to the expected
+ // frame immediately.
+ //
+ // TODO(): This should be replaced with a solution that emits the
+ // merge code for forward CFG edges at the appropriate entry to the
+ // target block.
+ Label original_fall_through;
+ __ j(NegateCondition(cc), &original_fall_through, NegateHint(hint));
+ VirtualFrame* working_frame = new VirtualFrame(current_frame);
+ cgen_->SetFrame(working_frame);
+ working_frame->MergeTo(expected_frame_);
+ ASSERT(cgen_->HasValidEntryRegisters());
+ __ jmp(&label_);
+ cgen_->SetFrame(current_frame);
+ delete working_frame;
+ __ bind(&original_fall_through);
}
- ASSERT(cgen_->HasValidEntryRegisters());
- __ j(cc, &label_, hint);
}
// Postcondition: there is both a current frame and an expected frame at
// the label and they match.
« no previous file with comments | « src/codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698