| 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 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 result = new(zone) Range(); | 1680 result = new(zone) Range(); |
| 1681 result->set_can_be_minus_zero(!representation().IsInteger32()); | 1681 result->set_can_be_minus_zero(!representation().IsInteger32()); |
| 1682 } | 1682 } |
| 1683 return result; | 1683 return result; |
| 1684 } | 1684 } |
| 1685 | 1685 |
| 1686 | 1686 |
| 1687 Range* HChange::InferRange(Zone* zone) { | 1687 Range* HChange::InferRange(Zone* zone) { |
| 1688 Range* input_range = value()->range(); | 1688 Range* input_range = value()->range(); |
| 1689 if (from().IsInteger32() && | 1689 if (from().IsInteger32() && |
| 1690 to().IsTagged() && | 1690 to().IsSmiOrTagged() && |
| 1691 !value()->CheckFlag(HInstruction::kUint32) && | 1691 !value()->CheckFlag(HInstruction::kUint32) && |
| 1692 input_range != NULL && input_range->IsInSmiRange()) { | 1692 input_range != NULL && input_range->IsInSmiRange()) { |
| 1693 set_type(HType::Smi()); | 1693 set_type(HType::Smi()); |
| 1694 ClearGVNFlag(kChangesNewSpacePromotion); | 1694 ClearGVNFlag(kChangesNewSpacePromotion); |
| 1695 } | 1695 } |
| 1696 Range* result = (input_range != NULL) | 1696 Range* result = (input_range != NULL) |
| 1697 ? input_range->Copy(zone) | 1697 ? input_range->Copy(zone) |
| 1698 : HValue::InferRange(zone); | 1698 : HValue::InferRange(zone); |
| 1699 if (to().IsInteger32()) result->set_can_be_minus_zero(false); | 1699 if (to().IsInteger32()) result->set_can_be_minus_zero(false); |
| 1700 return result; | 1700 return result; |
| (...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3556 | 3556 |
| 3557 Representation HPhi::RepresentationFromInputs() { | 3557 Representation HPhi::RepresentationFromInputs() { |
| 3558 bool double_occurred = false; | 3558 bool double_occurred = false; |
| 3559 bool int32_occurred = false; | 3559 bool int32_occurred = false; |
| 3560 for (int i = 0; i < OperandCount(); ++i) { | 3560 for (int i = 0; i < OperandCount(); ++i) { |
| 3561 HValue* value = OperandAt(i); | 3561 HValue* value = OperandAt(i); |
| 3562 if (value->IsUnknownOSRValue()) { | 3562 if (value->IsUnknownOSRValue()) { |
| 3563 HPhi* hint_value = HUnknownOSRValue::cast(value)->incoming_value(); | 3563 HPhi* hint_value = HUnknownOSRValue::cast(value)->incoming_value(); |
| 3564 if (hint_value != NULL) { | 3564 if (hint_value != NULL) { |
| 3565 Representation hint = hint_value->representation(); | 3565 Representation hint = hint_value->representation(); |
| 3566 if (hint.IsTagged()) return hint; | 3566 if (hint.IsSmiOrTagged()) return hint; |
| 3567 if (hint.IsDouble()) double_occurred = true; | 3567 if (hint.IsDouble()) double_occurred = true; |
| 3568 if (hint.IsInteger32()) int32_occurred = true; | 3568 if (hint.IsInteger32()) int32_occurred = true; |
| 3569 } | 3569 } |
| 3570 continue; | 3570 continue; |
| 3571 } | 3571 } |
| 3572 if (value->representation().IsDouble()) double_occurred = true; | 3572 if (value->representation().IsDouble()) double_occurred = true; |
| 3573 if (value->representation().IsInteger32()) int32_occurred = true; | 3573 if (value->representation().IsInteger32()) int32_occurred = true; |
| 3574 if (value->representation().IsTagged()) { | 3574 if (value->representation().IsSmiOrTagged()) { |
| 3575 if (value->IsConstant()) { | 3575 if (value->IsConstant()) { |
| 3576 HConstant* constant = HConstant::cast(value); | 3576 HConstant* constant = HConstant::cast(value); |
| 3577 if (constant->IsConvertibleToInteger()) { | 3577 if (constant->IsConvertibleToInteger()) { |
| 3578 int32_occurred = true; | 3578 int32_occurred = true; |
| 3579 } else if (constant->HasNumberValue()) { | 3579 } else if (constant->HasNumberValue()) { |
| 3580 double_occurred = true; | 3580 double_occurred = true; |
| 3581 } else { | 3581 } else { |
| 3582 return Representation::Tagged(); | 3582 return Representation::Tagged(); |
| 3583 } | 3583 } |
| 3584 } else { | 3584 } else { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3662 | 3662 |
| 3663 | 3663 |
| 3664 void HCheckFunction::Verify() { | 3664 void HCheckFunction::Verify() { |
| 3665 HInstruction::Verify(); | 3665 HInstruction::Verify(); |
| 3666 ASSERT(HasNoUses()); | 3666 ASSERT(HasNoUses()); |
| 3667 } | 3667 } |
| 3668 | 3668 |
| 3669 #endif | 3669 #endif |
| 3670 | 3670 |
| 3671 } } // namespace v8::internal | 3671 } } // namespace v8::internal |
| OLD | NEW |