| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 278 |
| 279 | 279 |
| 280 void HValue::SetOperandAt(int index, HValue* value) { | 280 void HValue::SetOperandAt(int index, HValue* value) { |
| 281 ASSERT(value == NULL || !value->representation().IsNone()); | 281 ASSERT(value == NULL || !value->representation().IsNone()); |
| 282 RegisterUse(index, value); | 282 RegisterUse(index, value); |
| 283 InternalSetOperandAt(index, value); | 283 InternalSetOperandAt(index, value); |
| 284 } | 284 } |
| 285 | 285 |
| 286 | 286 |
| 287 void HValue::ReplaceAndDelete(HValue* other) { | 287 void HValue::ReplaceAndDelete(HValue* other) { |
| 288 ReplaceValue(other); | 288 if (other != NULL) ReplaceValue(other); |
| 289 Delete(); | 289 Delete(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 | 292 |
| 293 void HValue::ReplaceValue(HValue* other) { | 293 void HValue::ReplaceValue(HValue* other) { |
| 294 ZoneList<HValue*> start_uses(2); | |
| 295 for (int i = 0; i < uses_.length(); ++i) { | 294 for (int i = 0; i < uses_.length(); ++i) { |
| 296 HValue* use = uses_.at(i); | 295 HValue* use = uses_[i]; |
| 297 if (!use->block()->IsStartBlock()) { | 296 ASSERT(!use->block()->IsStartBlock()); |
| 298 InternalReplaceAtUse(use, other); | 297 InternalReplaceAtUse(use, other); |
| 299 other->uses_.Add(use); | 298 other->uses_.Add(use); |
| 300 } else { | |
| 301 start_uses.Add(use); | |
| 302 } | |
| 303 } | 299 } |
| 304 uses_.Clear(); | 300 uses_.Rewind(0); |
| 305 uses_.AddAll(start_uses); | |
| 306 } | 301 } |
| 307 | 302 |
| 308 | 303 |
| 309 void HValue::ClearOperands() { | 304 void HValue::ClearOperands() { |
| 310 for (int i = 0; i < OperandCount(); ++i) { | 305 for (int i = 0; i < OperandCount(); ++i) { |
| 311 SetOperandAt(i, NULL); | 306 SetOperandAt(i, NULL); |
| 312 } | 307 } |
| 313 } | 308 } |
| 314 | 309 |
| 315 | 310 |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 | 1476 |
| 1482 | 1477 |
| 1483 void HCheckPrototypeMaps::Verify() { | 1478 void HCheckPrototypeMaps::Verify() { |
| 1484 HInstruction::Verify(); | 1479 HInstruction::Verify(); |
| 1485 ASSERT(HasNoUses()); | 1480 ASSERT(HasNoUses()); |
| 1486 } | 1481 } |
| 1487 | 1482 |
| 1488 #endif | 1483 #endif |
| 1489 | 1484 |
| 1490 } } // namespace v8::internal | 1485 } } // namespace v8::internal |
| OLD | NEW |