| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 void JumpTarget::Branch(Condition cc, Hint hint) { | 115 void JumpTarget::Branch(Condition cc, Hint hint) { |
| 116 ASSERT(cgen_ != NULL); | 116 ASSERT(cgen_ != NULL); |
| 117 ASSERT(cgen_->has_valid_frame()); | 117 ASSERT(cgen_->has_valid_frame()); |
| 118 | 118 |
| 119 if (is_bound()) { | 119 if (is_bound()) { |
| 120 // Backward branch. We have an expected frame to merge to on the | 120 // Backward branch. We have an expected frame to merge to on the |
| 121 // backward edge. We negate the condition and emit the merge code | 121 // backward edge. We negate the condition and emit the merge code |
| 122 // here. | 122 // here. |
| 123 // | 123 // |
| 124 // TODO(): we should try to avoid negating the condition in the case | 124 // TODO(210): we should try to avoid negating the condition in the |
| 125 // where there is no merge code to emit. Otherwise, we emit a | 125 // case where there is no merge code to emit. Otherwise, we emit |
| 126 // branch around an unconditional jump. | 126 // a branch around an unconditional jump. |
| 127 ASSERT(direction_ == BIDIRECTIONAL); | 127 ASSERT(direction_ == BIDIRECTIONAL); |
| 128 Label original_fall_through; | 128 Label original_fall_through; |
| 129 __ j(NegateCondition(cc), &original_fall_through, NegateHint(hint)); | 129 __ j(NegateCondition(cc), &original_fall_through, NegateHint(hint)); |
| 130 // Swap the current frame for a copy of it, saving non-frame | 130 // Swap the current frame for a copy of it, saving non-frame |
| 131 // register reference counts and invalidating all non-frame register | 131 // register reference counts and invalidating all non-frame register |
| 132 // references except the reserved ones on the backward edge. | 132 // references except the reserved ones on the backward edge. |
| 133 VirtualFrame* original_frame = cgen_->frame(); | 133 VirtualFrame* original_frame = cgen_->frame(); |
| 134 VirtualFrame* working_frame = new VirtualFrame(original_frame); | 134 VirtualFrame* working_frame = new VirtualFrame(original_frame); |
| 135 RegisterFile non_frame_registers = RegisterAllocator::Reserved(); | 135 RegisterFile non_frame_registers = RegisterAllocator::Reserved(); |
| 136 cgen_->SetFrame(working_frame, &non_frame_registers); | 136 cgen_->SetFrame(working_frame, &non_frame_registers); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 #ifdef DEBUG | 375 #ifdef DEBUG |
| 376 is_shadowing_ = false; | 376 is_shadowing_ = false; |
| 377 #endif | 377 #endif |
| 378 } | 378 } |
| 379 | 379 |
| 380 #undef __ | 380 #undef __ |
| 381 | 381 |
| 382 | 382 |
| 383 } } // namespace v8::internal | 383 } } // namespace v8::internal |
| OLD | NEW |