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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 for (int j = 1; j < reaching_frames_.length(); j++) { | 98 for (int j = 1; j < reaching_frames_.length(); j++) { |
99 // Element computation is monotonic: new information will not | 99 // Element computation is monotonic: new information will not |
100 // change our decision about undetermined or invalid elements. | 100 // change our decision about undetermined or invalid elements. |
101 if (element == NULL || !element->is_valid()) break; | 101 if (element == NULL || !element->is_valid()) break; |
102 | 102 |
103 element = element->Combine(&reaching_frames_[j]->elements_[i]); | 103 element = element->Combine(&reaching_frames_[j]->elements_[i]); |
104 | 104 |
105 FrameElement* other = &reaching_frames_[j]->elements_[i]; | 105 FrameElement* other = &reaching_frames_[j]->elements_[i]; |
106 if (element != NULL && !element->is_copy()) { | 106 if (element != NULL && !element->is_copy()) { |
107 ASSERT(other != NULL); | 107 ASSERT(other != NULL); |
108 ASSERT(!other->is_copy()); | |
109 // We overwrite the number information of one of the incoming frames. | 108 // We overwrite the number information of one of the incoming frames. |
110 // This is safe because we only use the frame for emitting merge code. | 109 // This is safe because we only use the frame for emitting merge code. |
111 // The number information of incoming frames is not used anymore. | 110 // The number information of incoming frames is not used anymore. |
112 element->set_number_info(NumberInfo::Combine(element->number_info(), | 111 element->set_number_info(NumberInfo::Combine(element->number_info(), |
113 other->number_info())); | 112 other->number_info())); |
114 } | 113 } |
115 } | 114 } |
116 elements[i] = element; | 115 elements[i] = element; |
117 } | 116 } |
118 } | 117 } |
119 | 118 |
120 // Build the new frame. A freshly allocated frame has memory elements | 119 // Build the new frame. A freshly allocated frame has memory elements |
121 // for the parameters and some platform-dependent elements (e.g., | 120 // for the parameters and some platform-dependent elements (e.g., |
122 // return address). Replace those first. | 121 // return address). Replace those first. |
123 entry_frame_ = new VirtualFrame(); | 122 entry_frame_ = new VirtualFrame(); |
124 int index = 0; | 123 int index = 0; |
125 for (; index < entry_frame_->element_count(); index++) { | 124 for (; index < entry_frame_->element_count(); index++) { |
126 FrameElement* target = elements[index]; | 125 FrameElement* target = elements[index]; |
127 // If the element is determined, set it now. Count registers. Mark | 126 // If the element is determined, set it now. Count registers. Mark |
128 // elements as copied exactly when they have a copy. Undetermined | 127 // elements as copied exactly when they have a copy. Undetermined |
129 // elements are initially recorded as if in memory. | 128 // elements are initially recorded as if in memory. |
130 if (target != NULL) { | 129 if (target != NULL) { |
131 ASSERT(!target->is_copy()); // These initial elements are never copies. | |
132 entry_frame_->elements_[index] = *target; | 130 entry_frame_->elements_[index] = *target; |
133 InitializeEntryElement(index, target); | 131 InitializeEntryElement(index, target); |
134 } | 132 } |
135 } | 133 } |
136 // Then fill in the rest of the frame with new elements. | 134 // Then fill in the rest of the frame with new elements. |
137 for (; index < length; index++) { | 135 for (; index < length; index++) { |
138 FrameElement* target = elements[index]; | 136 FrameElement* target = elements[index]; |
139 if (target == NULL) { | 137 if (target == NULL) { |
140 entry_frame_->elements_.Add( | 138 entry_frame_->elements_.Add( |
141 FrameElement::MemoryElement(NumberInfo::kUninitialized)); | 139 FrameElement::MemoryElement(NumberInfo::kUninitialized)); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 temp.CopyTo(this); | 416 temp.CopyTo(this); |
419 temp.Unuse(); | 417 temp.Unuse(); |
420 | 418 |
421 #ifdef DEBUG | 419 #ifdef DEBUG |
422 is_shadowing_ = false; | 420 is_shadowing_ = false; |
423 #endif | 421 #endif |
424 } | 422 } |
425 | 423 |
426 | 424 |
427 } } // namespace v8::internal | 425 } } // namespace v8::internal |
OLD | NEW |