| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 ASSERT(masm_ != NULL); | 102 ASSERT(masm_ != NULL); |
| 103 | 103 |
| 104 VirtualFrame* current_frame = cgen_->frame(); | 104 VirtualFrame* current_frame = cgen_->frame(); |
| 105 ASSERT(current_frame != NULL); | 105 ASSERT(current_frame != NULL); |
| 106 | 106 |
| 107 if (expected_frame_ == NULL) { | 107 if (expected_frame_ == NULL) { |
| 108 expected_frame_ = new VirtualFrame(current_frame); | 108 expected_frame_ = new VirtualFrame(current_frame); |
| 109 // For a branch, the frame at the fall-through basic block (not labeled) | 109 // For a branch, the frame at the fall-through basic block (not labeled) |
| 110 // does not need to be mergable, but only the other (labeled) one. That | 110 // does not need to be mergable, but only the other (labeled) one. That |
| 111 // is achieved by reversing the condition and emitting the make mergable | 111 // is achieved by reversing the condition and emitting the make mergable |
| 112 // code as the actual fall-through block. This is necessary only when | 112 // code as the actual fall-through block. |
| 113 // MakeMergable will generate code. | 113 // |
| 114 if (expected_frame_->RequiresMergeCode()) { | 114 // TODO(): This is necessary only when MakeMergable will generate code. |
| 115 Label original_fall_through; | 115 Label original_fall_through; |
| 116 __ j(NegateCondition(cc), &original_fall_through, NegateHint(hint)); | 116 __ j(NegateCondition(cc), &original_fall_through, NegateHint(hint)); |
| 117 expected_frame_->MakeMergable(); | 117 expected_frame_->MakeMergable(); |
| 118 __ jmp(&label_); | 118 __ jmp(&label_); |
| 119 __ bind(&original_fall_through); | 119 __ bind(&original_fall_through); |
| 120 } else { | |
| 121 expected_frame_->MakeMergable(); | |
| 122 ASSERT(cgen_->HasValidEntryRegisters()); | |
| 123 __ j(cc, &label_, hint); | |
| 124 } | |
| 125 } else { | 120 } else { |
| 126 // We negate the condition and emit the code to merge to the expected | 121 // We negate the condition and emit the code to merge to the expected |
| 127 // frame immediately. | 122 // frame immediately. |
| 128 // | 123 // |
| 129 // TODO(): This should be replaced with a solution that emits the | 124 // TODO(): This should be replaced with a solution that emits the |
| 130 // merge code for forward CFG edges at the appropriate entry to the | 125 // merge code for forward CFG edges at the appropriate entry to the |
| 131 // target block. | 126 // target block. |
| 132 Label original_fall_through; | 127 Label original_fall_through; |
| 133 __ j(NegateCondition(cc), &original_fall_through, NegateHint(hint)); | 128 __ j(NegateCondition(cc), &original_fall_through, NegateHint(hint)); |
| 134 VirtualFrame* working_frame = new VirtualFrame(current_frame); | 129 VirtualFrame* working_frame = new VirtualFrame(current_frame); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 359 |
| 365 #ifdef DEBUG | 360 #ifdef DEBUG |
| 366 is_shadowing_ = false; | 361 is_shadowing_ = false; |
| 367 #endif | 362 #endif |
| 368 } | 363 } |
| 369 | 364 |
| 370 #undef __ | 365 #undef __ |
| 371 | 366 |
| 372 | 367 |
| 373 } } // namespace v8::internal | 368 } } // namespace v8::internal |
| OLD | NEW |