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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 element = element->Combine(&reaching_frames_[j]->elements_[i]); | 115 element = element->Combine(&reaching_frames_[j]->elements_[i]); |
116 } | 116 } |
117 elements[i] = element; | 117 elements[i] = element; |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
121 // Build the new frame. A freshly allocated frame has memory elements | 121 // Build the new frame. A freshly allocated frame has memory elements |
122 // for the parameters and some platform-dependent elements (e.g., | 122 // for the parameters and some platform-dependent elements (e.g., |
123 // return address). Replace those first. | 123 // return address). Replace those first. |
124 entry_frame_ = new VirtualFrame(cgen()); | 124 entry_frame_ = new VirtualFrame(); |
125 int index = 0; | 125 int index = 0; |
126 for (; index < entry_frame_->elements_.length(); index++) { | 126 for (; index < entry_frame_->elements_.length(); index++) { |
127 FrameElement* target = elements[index]; | 127 FrameElement* target = elements[index]; |
128 // If the element is determined, set it now. Count registers. Mark | 128 // If the element is determined, set it now. Count registers. Mark |
129 // elements as copied exactly when they have a copy. Undetermined | 129 // elements as copied exactly when they have a copy. Undetermined |
130 // elements are initially recorded as if in memory. | 130 // elements are initially recorded as if in memory. |
131 if (target != NULL) { | 131 if (target != NULL) { |
132 entry_frame_->elements_[index] = *target; | 132 entry_frame_->elements_[index] = *target; |
133 InitializeEntryElement(index, target); | 133 InitializeEntryElement(index, target); |
134 } | 134 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 entry_frame_->elements_[i] = | 208 entry_frame_->elements_[i] = |
209 FrameElement::RegisterElement(reg, | 209 FrameElement::RegisterElement(reg, |
210 FrameElement::NOT_SYNCED); | 210 FrameElement::NOT_SYNCED); |
211 if (is_copied) entry_frame_->elements_[i].set_copied(); | 211 if (is_copied) entry_frame_->elements_[i].set_copied(); |
212 entry_frame_->elements_[i].set_static_type(type); | 212 entry_frame_->elements_[i].set_static_type(type); |
213 entry_frame_->register_locations_[best_reg_code] = i; | 213 entry_frame_->register_locations_[best_reg_code] = i; |
214 } | 214 } |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 // Fill in the other fields of the entry frame. | |
219 entry_frame_->local_count_ = initial_frame->local_count_; | |
220 entry_frame_->frame_pointer_ = initial_frame->frame_pointer_; | |
221 | |
222 // The stack pointer is at the highest synced element or the base of | 218 // The stack pointer is at the highest synced element or the base of |
223 // the expression stack. | 219 // the expression stack. |
224 int stack_pointer = length - 1; | 220 int stack_pointer = length - 1; |
225 while (stack_pointer >= entry_frame_->expression_base_index() && | 221 while (stack_pointer >= entry_frame_->expression_base_index() && |
226 !entry_frame_->elements_[stack_pointer].is_synced()) { | 222 !entry_frame_->elements_[stack_pointer].is_synced()) { |
227 stack_pointer--; | 223 stack_pointer--; |
228 } | 224 } |
229 entry_frame_->stack_pointer_ = stack_pointer; | 225 entry_frame_->stack_pointer_ = stack_pointer; |
230 } | 226 } |
231 | 227 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 temp.CopyTo(this); | 600 temp.CopyTo(this); |
605 temp.Unuse(); | 601 temp.Unuse(); |
606 | 602 |
607 #ifdef DEBUG | 603 #ifdef DEBUG |
608 is_shadowing_ = false; | 604 is_shadowing_ = false; |
609 #endif | 605 #endif |
610 } | 606 } |
611 | 607 |
612 | 608 |
613 } } // namespace v8::internal | 609 } } // namespace v8::internal |
OLD | NEW |