| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1429 } | 1429 } |
| 1430 | 1430 |
| 1431 | 1431 |
| 1432 HValue* HSub::Canonicalize() { | 1432 HValue* HSub::Canonicalize() { |
| 1433 if (!representation().IsInteger32()) return this; | 1433 if (!representation().IsInteger32()) return this; |
| 1434 if (CheckUsesForFlag(kTruncatingToInt32)) ClearFlag(kCanOverflow); | 1434 if (CheckUsesForFlag(kTruncatingToInt32)) ClearFlag(kCanOverflow); |
| 1435 return this; | 1435 return this; |
| 1436 } | 1436 } |
| 1437 | 1437 |
| 1438 | 1438 |
| 1439 HValue* HMul::Canonicalize() { |
| 1440 if (left()->IsInteger32Constant() && |
| 1441 HConstant::cast(left())->Integer32Value() == 1 && |
| 1442 right()->representation().IsSpecialization()) { |
| 1443 return right(); |
| 1444 } |
| 1445 return this; |
| 1446 } |
| 1447 |
| 1448 |
| 1439 HValue* HChange::Canonicalize() { | 1449 HValue* HChange::Canonicalize() { |
| 1440 return (from().Equals(to())) ? value() : this; | 1450 return (from().Equals(to())) ? value() : this; |
| 1441 } | 1451 } |
| 1442 | 1452 |
| 1443 | 1453 |
| 1444 HValue* HWrapReceiver::Canonicalize() { | 1454 HValue* HWrapReceiver::Canonicalize() { |
| 1445 if (HasNoUses()) return NULL; | 1455 if (HasNoUses()) return NULL; |
| 1446 if (receiver()->type().IsJSObject()) { | 1456 if (receiver()->type().IsJSObject()) { |
| 1447 return receiver(); | 1457 return receiver(); |
| 1448 } | 1458 } |
| (...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3570 | 3580 |
| 3571 | 3581 |
| 3572 void HCheckFunction::Verify() { | 3582 void HCheckFunction::Verify() { |
| 3573 HInstruction::Verify(); | 3583 HInstruction::Verify(); |
| 3574 ASSERT(HasNoUses()); | 3584 ASSERT(HasNoUses()); |
| 3575 } | 3585 } |
| 3576 | 3586 |
| 3577 #endif | 3587 #endif |
| 3578 | 3588 |
| 3579 } } // namespace v8::internal | 3589 } } // namespace v8::internal |
| OLD | NEW |