OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 HCheckHeapObject* check = HCheckHeapObject::cast(instr); | 205 HCheckHeapObject* check = HCheckHeapObject::cast(instr); |
206 if (check->value() != allocate) continue; | 206 if (check->value() != allocate) continue; |
207 check->DeleteAndReplaceWith(NULL); | 207 check->DeleteAndReplaceWith(NULL); |
208 break; | 208 break; |
209 } | 209 } |
210 case HValue::kCheckMaps: { | 210 case HValue::kCheckMaps: { |
211 HCheckMaps* mapcheck = HCheckMaps::cast(instr); | 211 HCheckMaps* mapcheck = HCheckMaps::cast(instr); |
212 if (mapcheck->value() != allocate) continue; | 212 if (mapcheck->value() != allocate) continue; |
213 // TODO(mstarzinger): This approach breaks if the tracked map value | 213 // TODO(mstarzinger): This approach breaks if the tracked map value |
214 // is not a HConstant. Find a repro test case and fix this. | 214 // is not a HConstant. Find a repro test case and fix this. |
| 215 for (HUseIterator it(mapcheck->uses()); !it.Done(); it.Advance()) { |
| 216 if (!it.value()->IsLoadNamedField()) continue; |
| 217 HLoadNamedField* load = HLoadNamedField::cast(it.value()); |
| 218 ASSERT(load->typecheck() == mapcheck); |
| 219 load->clear_typecheck(); |
| 220 } |
215 ASSERT(mapcheck->HasNoUses()); | 221 ASSERT(mapcheck->HasNoUses()); |
| 222 |
216 mapcheck->DeleteAndReplaceWith(NULL); | 223 mapcheck->DeleteAndReplaceWith(NULL); |
217 break; | 224 break; |
218 } | 225 } |
219 default: | 226 default: |
220 // Nothing to see here, move along ... | 227 // Nothing to see here, move along ... |
221 break; | 228 break; |
222 } | 229 } |
223 } | 230 } |
224 | 231 |
225 // Propagate the block state forward to all successor blocks. | 232 // Propagate the block state forward to all successor blocks. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 AnalyzeDataFlow(allocate); | 287 AnalyzeDataFlow(allocate); |
281 | 288 |
282 cumulative_values_ += number_of_values_; | 289 cumulative_values_ += number_of_values_; |
283 ASSERT(allocate->HasNoUses()); | 290 ASSERT(allocate->HasNoUses()); |
284 ASSERT(!allocate->IsLinked()); | 291 ASSERT(!allocate->IsLinked()); |
285 } | 292 } |
286 } | 293 } |
287 | 294 |
288 | 295 |
289 } } // namespace v8::internal | 296 } } // namespace v8::internal |
OLD | NEW |