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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/codegen-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 __ jmp(&label_); 130 __ jmp(&label_);
131 __ bind(&original_fall_through); 131 __ bind(&original_fall_through);
132 } else { 132 } else {
133 expected_frame_->MakeMergable(); 133 expected_frame_->MakeMergable();
134 ASSERT(cgen_->HasValidEntryRegisters()); 134 ASSERT(cgen_->HasValidEntryRegisters());
135 __ j(cc, &label_, hint); 135 __ j(cc, &label_, hint);
136 } 136 }
137 } else { 137 } else {
138 // No code needs to be emitted to merge to the expected frame at the 138 // No code needs to be emitted to merge to the expected frame at the
139 // actual function return. 139 // actual function return.
140 if (!cgen_->IsActualFunctionReturn(this)) { 140 if (cgen_->IsActualFunctionReturn(this)) {
141 current_frame->MergeTo(expected_frame_); 141 ASSERT(cgen_->HasValidEntryRegisters());
142 __ j(cc, &label_, hint);
143 } else {
144 // We negate the condition and emit the code to merge to the expected
145 // frame immediately.
146 //
147 // TODO(): This should be replaced with a solution that emits the
148 // merge code for forward CFG edges at the appropriate entry to the
149 // target block.
150 Label original_fall_through;
151 __ j(NegateCondition(cc), &original_fall_through, NegateHint(hint));
152 VirtualFrame* working_frame = new VirtualFrame(current_frame);
153 cgen_->SetFrame(working_frame);
154 working_frame->MergeTo(expected_frame_);
155 ASSERT(cgen_->HasValidEntryRegisters());
156 __ jmp(&label_);
157 cgen_->SetFrame(current_frame);
158 delete working_frame;
159 __ bind(&original_fall_through);
142 } 160 }
143 ASSERT(cgen_->HasValidEntryRegisters());
144 __ j(cc, &label_, hint);
145 } 161 }
146 // Postcondition: there is both a current frame and an expected frame at 162 // Postcondition: there is both a current frame and an expected frame at
147 // the label and they match. 163 // the label and they match.
148 } 164 }
149 165
150 166
151 void JumpTarget::Branch(Condition cc, Result* arg, Hint hint) { 167 void JumpTarget::Branch(Condition cc, Result* arg, Hint hint) {
152 ASSERT(cgen_ != NULL); 168 ASSERT(cgen_ != NULL);
153 ASSERT(cgen_->has_valid_frame()); 169 ASSERT(cgen_->has_valid_frame());
154 170
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 374
359 #ifdef DEBUG 375 #ifdef DEBUG
360 is_shadowing_ = false; 376 is_shadowing_ = false;
361 #endif 377 #endif
362 } 378 }
363 379
364 #undef __ 380 #undef __
365 381
366 382
367 } } // namespace v8::internal 383 } } // namespace v8::internal
OLDNEW
« 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