| OLD | NEW |
| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // block. | 138 // block. |
| 139 ASSERT(!cgen_->has_valid_frame() || cgen_->HasValidEntryRegisters()); | 139 ASSERT(!cgen_->has_valid_frame() || cgen_->HasValidEntryRegisters()); |
| 140 | 140 |
| 141 // Compute the frame to use for entry to the block. | 141 // Compute the frame to use for entry to the block. |
| 142 ComputeEntryFrame(mergable_elements); | 142 ComputeEntryFrame(mergable_elements); |
| 143 | 143 |
| 144 if (is_linked()) { | 144 if (is_linked()) { |
| 145 // There were forward jumps. Handle merging the reaching frames | 145 // There were forward jumps. Handle merging the reaching frames |
| 146 // and possible fall through to the entry frame. | 146 // and possible fall through to the entry frame. |
| 147 | 147 |
| 148 // Some moves required to merge to an expected frame require |
| 149 // purely frame state changes, and do not require any code |
| 150 // generation. Perform those first to increase the possibility of |
| 151 // finding equal frames below. |
| 152 if (cgen_->has_valid_frame()) { |
| 153 cgen_->frame()->PrepareMergeTo(entry_frame_); |
| 154 } |
| 155 for (int i = 0; i < reaching_frames_.length(); i++) { |
| 156 reaching_frames_[i]->PrepareMergeTo(entry_frame_); |
| 157 } |
| 158 |
| 148 // If there is a fall through to the jump target and it needs | 159 // If there is a fall through to the jump target and it needs |
| 149 // merge code, process it first. | 160 // merge code, process it first. |
| 150 if (cgen_->has_valid_frame() && !cgen_->frame()->Equals(entry_frame_)) { | 161 if (cgen_->has_valid_frame() && !cgen_->frame()->Equals(entry_frame_)) { |
| 151 // Loop over all the reaching frames, looking for any that can | 162 // Loop over all the reaching frames, looking for any that can |
| 152 // share merge code with this one. | 163 // share merge code with this one. |
| 153 for (int i = 0; i < reaching_frames_.length(); i++) { | 164 for (int i = 0; i < reaching_frames_.length(); i++) { |
| 154 if (cgen_->frame()->Equals(reaching_frames_[i])) { | 165 if (cgen_->frame()->Equals(reaching_frames_[i])) { |
| 155 // Set the reaching frames element to null to avoid | 166 // Set the reaching frames element to null to avoid |
| 156 // processing it later, and then bind its entry label. | 167 // processing it later, and then bind its entry label. |
| 157 delete reaching_frames_[i]; | 168 delete reaching_frames_[i]; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 249 } |
| 239 | 250 |
| 240 is_linked_ = false; | 251 is_linked_ = false; |
| 241 is_bound_ = true; | 252 is_bound_ = true; |
| 242 } | 253 } |
| 243 | 254 |
| 244 #undef __ | 255 #undef __ |
| 245 | 256 |
| 246 | 257 |
| 247 } } // namespace v8::internal | 258 } } // namespace v8::internal |
| OLD | NEW |