OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "hydrogen-escape-analysis.h" | 5 #include "hydrogen-escape-analysis.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 | 9 |
10 | 10 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 | 126 |
127 // Insert a newly created value check as a replacement for map checks. | 127 // Insert a newly created value check as a replacement for map checks. |
128 HValue* HEscapeAnalysisPhase::NewMapCheckAndInsert(HCapturedObject* state, | 128 HValue* HEscapeAnalysisPhase::NewMapCheckAndInsert(HCapturedObject* state, |
129 HCheckMaps* mapcheck) { | 129 HCheckMaps* mapcheck) { |
130 Zone* zone = graph()->zone(); | 130 Zone* zone = graph()->zone(); |
131 HValue* value = state->map_value(); | 131 HValue* value = state->map_value(); |
132 // TODO(mstarzinger): This will narrow a map check against a set of maps | 132 // TODO(mstarzinger): This will narrow a map check against a set of maps |
133 // down to the first element in the set. Revisit and fix this. | 133 // down to the first element in the set. Revisit and fix this. |
134 HCheckValue* check = HCheckValue::New( | 134 HCheckValue* check = HCheckValue::New( |
135 zone, NULL, value, mapcheck->first_map(), false); | 135 zone, NULL, value, mapcheck->maps()->at(0), false); |
136 check->InsertBefore(mapcheck); | 136 check->InsertBefore(mapcheck); |
137 return check; | 137 return check; |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 // Replace a field load with a given value, forcing Smi representation if | 141 // Replace a field load with a given value, forcing Smi representation if |
142 // necessary. | 142 // necessary. |
143 HValue* HEscapeAnalysisPhase::NewLoadReplacement( | 143 HValue* HEscapeAnalysisPhase::NewLoadReplacement( |
144 HLoadNamedField* load, HValue* load_value) { | 144 HLoadNamedField* load, HValue* load_value) { |
145 HValue* replacement = load_value; | 145 HValue* replacement = load_value; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 for (int i = 0; i < max_fixpoint_iteration_count; i++) { | 319 for (int i = 0; i < max_fixpoint_iteration_count; i++) { |
320 CollectCapturedValues(); | 320 CollectCapturedValues(); |
321 if (captured_.is_empty()) break; | 321 if (captured_.is_empty()) break; |
322 PerformScalarReplacement(); | 322 PerformScalarReplacement(); |
323 captured_.Clear(); | 323 captured_.Clear(); |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 | 327 |
328 } } // namespace v8::internal | 328 } } // namespace v8::internal |
OLD | NEW |