| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 cgen_->frame()->SpillAll(); | 123 cgen_->frame()->SpillAll(); |
| 124 VirtualFrame* target_frame = new VirtualFrame(cgen_->frame()); | 124 VirtualFrame* target_frame = new VirtualFrame(cgen_->frame()); |
| 125 target_frame->Adjust(1); | 125 target_frame->Adjust(1); |
| 126 AddReachingFrame(target_frame); | 126 AddReachingFrame(target_frame); |
| 127 __ bl(&merge_labels_.last()); | 127 __ bl(&merge_labels_.last()); |
| 128 | 128 |
| 129 is_linked_ = !is_bound_; | 129 is_linked_ = !is_bound_; |
| 130 } | 130 } |
| 131 | 131 |
| 132 | 132 |
| 133 void JumpTarget::Bind() { | 133 void JumpTarget::Bind(int mergable_elements) { |
| 134 ASSERT(cgen_ != NULL); | 134 ASSERT(cgen_ != NULL); |
| 135 ASSERT(!is_bound()); | 135 ASSERT(!is_bound()); |
| 136 | 136 |
| 137 // Live non-frame registers are not allowed at the start of a basic | 137 // Live non-frame registers are not allowed at the start of a basic |
| 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(); | 142 ComputeEntryFrame(mergable_elements); |
| 143 | 143 |
| 144 if (is_linked()) { | 144 if (is_linked()) { |
| 145 // There were forward jumps. All the reaching frames, beginning | 145 // There were forward jumps. All the reaching frames, beginning |
| 146 // with the current frame if any, are merged to the expected one. | 146 // with the current frame if any, are merged to the expected one. |
| 147 int start_index = 0; | 147 int start_index = 0; |
| 148 if (!cgen_->has_valid_frame()) { | 148 if (!cgen_->has_valid_frame()) { |
| 149 // Pick up the first reaching frame as the code generator's | 149 // Pick up the first reaching frame as the code generator's |
| 150 // current frame. | 150 // current frame. |
| 151 RegisterFile reserved_registers = RegisterAllocator::Reserved(); | 151 RegisterFile reserved_registers = RegisterAllocator::Reserved(); |
| 152 cgen_->SetFrame(reaching_frames_[0], &reserved_registers); | 152 cgen_->SetFrame(reaching_frames_[0], &reserved_registers); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 | 185 |
| 186 is_linked_ = false; | 186 is_linked_ = false; |
| 187 is_bound_ = true; | 187 is_bound_ = true; |
| 188 } | 188 } |
| 189 | 189 |
| 190 #undef __ | 190 #undef __ |
| 191 | 191 |
| 192 | 192 |
| 193 } } // namespace v8::internal | 193 } } // namespace v8::internal |
| OLD | NEW |