Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 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 "register-allocator-inl.h" | 31 #include "register-allocator-inl.h" |
| 32 #include "jump-target-inl.h" | |
|
Kevin Millikin (Chromium)
2009/05/14 11:29:02
Same question.
Mads Ager (chromium)
2009/05/14 11:42:40
Done.
| |
| 32 | 33 |
| 33 namespace v8 { namespace internal { | 34 namespace v8 { namespace internal { |
| 34 | 35 |
| 35 // ------------------------------------------------------------------------- | 36 // ------------------------------------------------------------------------- |
| 36 // JumpTarget implementation. | 37 // JumpTarget implementation. |
| 37 | 38 |
| 38 bool JumpTarget::compiling_deferred_code_ = false; | 39 bool JumpTarget::compiling_deferred_code_ = false; |
| 39 | 40 |
| 40 | 41 |
| 41 JumpTarget::JumpTarget(CodeGenerator* cgen, Directionality direction) | 42 JumpTarget::JumpTarget(CodeGenerator* cgen, Directionality direction) |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 // return address). Replace those first. | 159 // return address). Replace those first. |
| 159 entry_frame_ = new VirtualFrame(cgen_); | 160 entry_frame_ = new VirtualFrame(cgen_); |
| 160 int index = 0; | 161 int index = 0; |
| 161 for (; index < entry_frame_->elements_.length(); index++) { | 162 for (; index < entry_frame_->elements_.length(); index++) { |
| 162 FrameElement* target = elements[index]; | 163 FrameElement* target = elements[index]; |
| 163 // If the element is determined, set it now. Count registers. Mark | 164 // If the element is determined, set it now. Count registers. Mark |
| 164 // elements as copied exactly when they have a copy. Undetermined | 165 // elements as copied exactly when they have a copy. Undetermined |
| 165 // elements are initially recorded as if in memory. | 166 // elements are initially recorded as if in memory. |
| 166 if (target != NULL) { | 167 if (target != NULL) { |
| 167 entry_frame_->elements_[index] = *target; | 168 entry_frame_->elements_[index] = *target; |
| 168 entry_frame_->InitializeEntryElement(index, target); | 169 InitializeEntryElement(index, target); |
| 169 } | 170 } |
| 170 } | 171 } |
| 171 // Then fill in the rest of the frame with new elements. | 172 // Then fill in the rest of the frame with new elements. |
| 172 for (; index < length; index++) { | 173 for (; index < length; index++) { |
| 173 FrameElement* target = elements[index]; | 174 FrameElement* target = elements[index]; |
| 174 if (target == NULL) { | 175 if (target == NULL) { |
| 175 entry_frame_->elements_.Add(FrameElement::MemoryElement()); | 176 entry_frame_->elements_.Add(FrameElement::MemoryElement()); |
| 176 } else { | 177 } else { |
| 177 entry_frame_->elements_.Add(*target); | 178 entry_frame_->elements_.Add(*target); |
| 178 entry_frame_->InitializeEntryElement(index, target); | 179 InitializeEntryElement(index, target); |
| 179 } | 180 } |
| 180 } | 181 } |
| 181 | 182 |
| 182 // Allocate any still-undetermined frame elements to registers or | 183 // Allocate any still-undetermined frame elements to registers or |
| 183 // memory, from the top down. | 184 // memory, from the top down. |
| 184 for (int i = length - 1; i >= 0; i--) { | 185 for (int i = length - 1; i >= 0; i--) { |
| 185 if (elements[i] == NULL) { | 186 if (elements[i] == NULL) { |
| 186 // Loop over all the reaching frames to check whether the element | 187 // Loop over all the reaching frames to check whether the element |
| 187 // is synced on all frames, to count the registers it occupies, | 188 // is synced on all frames, to count the registers it occupies, |
| 188 // and to compute a merged static type. | 189 // and to compute a merged static type. |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 678 temp.CopyTo(this); | 679 temp.CopyTo(this); |
| 679 temp.Unuse(); | 680 temp.Unuse(); |
| 680 | 681 |
| 681 #ifdef DEBUG | 682 #ifdef DEBUG |
| 682 is_shadowing_ = false; | 683 is_shadowing_ = false; |
| 683 #endif | 684 #endif |
| 684 } | 685 } |
| 685 | 686 |
| 686 | 687 |
| 687 } } // namespace v8::internal | 688 } } // namespace v8::internal |
| OLD | NEW |