| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 10 matching lines...) Expand all Loading... |
| 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #include "codegen-inl.h" | 30 #include "codegen-inl.h" |
| 31 #include "jump-target-inl.h" | |
| 32 #include "register-allocator-inl.h" | 31 #include "register-allocator-inl.h" |
| 33 | 32 |
| 34 namespace v8 { namespace internal { | 33 namespace v8 { namespace internal { |
| 35 | 34 |
| 36 // ------------------------------------------------------------------------- | 35 // ------------------------------------------------------------------------- |
| 37 // JumpTarget implementation. | 36 // JumpTarget implementation. |
| 38 | 37 |
| 39 bool JumpTarget::compiling_deferred_code_ = false; | 38 bool JumpTarget::compiling_deferred_code_ = false; |
| 40 | 39 |
| 41 | 40 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // return address). Replace those first. | 158 // return address). Replace those first. |
| 160 entry_frame_ = new VirtualFrame(cgen_); | 159 entry_frame_ = new VirtualFrame(cgen_); |
| 161 int index = 0; | 160 int index = 0; |
| 162 for (; index < entry_frame_->elements_.length(); index++) { | 161 for (; index < entry_frame_->elements_.length(); index++) { |
| 163 FrameElement* target = elements[index]; | 162 FrameElement* target = elements[index]; |
| 164 // If the element is determined, set it now. Count registers. Mark | 163 // If the element is determined, set it now. Count registers. Mark |
| 165 // elements as copied exactly when they have a copy. Undetermined | 164 // elements as copied exactly when they have a copy. Undetermined |
| 166 // elements are initially recorded as if in memory. | 165 // elements are initially recorded as if in memory. |
| 167 if (target != NULL) { | 166 if (target != NULL) { |
| 168 entry_frame_->elements_[index] = *target; | 167 entry_frame_->elements_[index] = *target; |
| 169 InitializeEntryElement(index, target); | 168 entry_frame_->InitializeEntryElement(index, target); |
| 170 } | 169 } |
| 171 } | 170 } |
| 172 // Then fill in the rest of the frame with new elements. | 171 // Then fill in the rest of the frame with new elements. |
| 173 for (; index < length; index++) { | 172 for (; index < length; index++) { |
| 174 FrameElement* target = elements[index]; | 173 FrameElement* target = elements[index]; |
| 175 if (target == NULL) { | 174 if (target == NULL) { |
| 176 entry_frame_->elements_.Add(FrameElement::MemoryElement()); | 175 entry_frame_->elements_.Add(FrameElement::MemoryElement()); |
| 177 } else { | 176 } else { |
| 178 entry_frame_->elements_.Add(*target); | 177 entry_frame_->elements_.Add(*target); |
| 179 InitializeEntryElement(index, target); | 178 entry_frame_->InitializeEntryElement(index, target); |
| 180 } | 179 } |
| 181 } | 180 } |
| 182 | 181 |
| 183 // Allocate any still-undetermined frame elements to registers or | 182 // Allocate any still-undetermined frame elements to registers or |
| 184 // memory, from the top down. | 183 // memory, from the top down. |
| 185 for (int i = length - 1; i >= 0; i--) { | 184 for (int i = length - 1; i >= 0; i--) { |
| 186 if (elements[i] == NULL) { | 185 if (elements[i] == NULL) { |
| 187 // Loop over all the reaching frames to check whether the element | 186 // Loop over all the reaching frames to check whether the element |
| 188 // is synced on all frames, to count the registers it occupies, | 187 // is synced on all frames, to count the registers it occupies, |
| 189 // and to compute a merged static type. | 188 // and to compute a merged static type. |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 temp.CopyTo(this); | 678 temp.CopyTo(this); |
| 680 temp.Unuse(); | 679 temp.Unuse(); |
| 681 | 680 |
| 682 #ifdef DEBUG | 681 #ifdef DEBUG |
| 683 is_shadowing_ = false; | 682 is_shadowing_ = false; |
| 684 #endif | 683 #endif |
| 685 } | 684 } |
| 686 | 685 |
| 687 | 686 |
| 688 } } // namespace v8::internal | 687 } } // namespace v8::internal |
| OLD | NEW |