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

Side by Side Diff: src/jump-target-ia32.cc

Issue 13234: Experimental: three small codegen changes.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/codegen-ia32.cc ('k') | src/virtual-frame-ia32.cc » ('j') | 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 VirtualFrame* current_frame = code_generator_->frame(); 101 VirtualFrame* current_frame = code_generator_->frame();
102 ASSERT(current_frame != NULL); 102 ASSERT(current_frame != NULL);
103 103
104 if (expected_frame_ == NULL) { 104 if (expected_frame_ == NULL) {
105 expected_frame_ = new VirtualFrame(current_frame); 105 expected_frame_ = new VirtualFrame(current_frame);
106 // The frame at the actual function return will always have height zero. 106 // The frame at the actual function return will always have height zero.
107 if (code_generator_->IsActualFunctionReturn(this)) { 107 if (code_generator_->IsActualFunctionReturn(this)) {
108 expected_frame_->Forget(expected_frame_->height()); 108 expected_frame_->Forget(expected_frame_->height());
109 } 109 }
110 if (!expected_frame_->IsMergable()) { 110 if (!expected_frame_->IsMergable()) {
111 // For a branch, the frame at the fall-through basic block (not
112 // labeled) does not need to be mergable, but only the other (labeled)
113 // one. That is achieved by reversing the condition and emitting the
114 // make mergable code as the actual fall-through block.
115 Label original_fall_through;
116 __ j(NegateCondition(cc), &original_fall_through, NegateHint(hint));
111 expected_frame_->MakeMergable(); 117 expected_frame_->MakeMergable();
118 __ jmp(&label_);
119 __ bind(&original_fall_through);
iposva 2008/12/08 06:32:32 How often do you expect this double jump to happen
Kevin Millikin (Chromium) 2008/12/08 08:26:28 Only when the frame contains constants that are sy
120 } else {
121 __ j(cc, &label_, hint);
112 } 122 }
113 } else { 123 } else {
114 // No code needs to be emitted to merge to the expected frame at the 124 // No code needs to be emitted to merge to the expected frame at the
115 // actual function return. 125 // actual function return.
116 if (!code_generator_->IsActualFunctionReturn(this)) { 126 if (!code_generator_->IsActualFunctionReturn(this)) {
117 current_frame->MergeTo(expected_frame_); 127 current_frame->MergeTo(expected_frame_);
118 } 128 }
129 __ j(cc, &label_, hint);
119 } 130 }
120
121 __ j(cc, &label_, hint);
122 // Postcondition: there is both a current frame and an expected frame at 131 // Postcondition: there is both a current frame and an expected frame at
123 // the label and they match. 132 // the label and they match.
124 } 133 }
125 134
126 135
127 void JumpTarget::Call() { 136 void JumpTarget::Call() {
128 // Precondition: there is a current frame, and there is no expected frame 137 // Precondition: there is a current frame, and there is no expected frame
129 // at the label. 138 // at the label.
130 ASSERT(code_generator_ != NULL); 139 ASSERT(code_generator_ != NULL);
131 ASSERT(masm_ != NULL); 140 ASSERT(masm_ != NULL);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 226
218 #ifdef DEBUG 227 #ifdef DEBUG
219 is_shadowing_ = false; 228 is_shadowing_ = false;
220 #endif 229 #endif
221 } 230 }
222 231
223 #undef __ 232 #undef __
224 233
225 234
226 } } // namespace v8::internal 235 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen-ia32.cc ('k') | src/virtual-frame-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698