Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: src/hydrogen-instructions.cc

Issue 190713002: Replace the recursion in PropagateMinusZeroChecks() with a loop and a worklist. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/hydrogen-minus-zero.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3685 matching lines...) Expand 10 before | Expand all | Expand 10 after
3696 stream->Add(" ("); 3696 stream->Add(" (");
3697 if (IsNewSpaceAllocation()) stream->Add("N"); 3697 if (IsNewSpaceAllocation()) stream->Add("N");
3698 if (IsOldPointerSpaceAllocation()) stream->Add("P"); 3698 if (IsOldPointerSpaceAllocation()) stream->Add("P");
3699 if (IsOldDataSpaceAllocation()) stream->Add("D"); 3699 if (IsOldDataSpaceAllocation()) stream->Add("D");
3700 if (MustAllocateDoubleAligned()) stream->Add("A"); 3700 if (MustAllocateDoubleAligned()) stream->Add("A");
3701 if (MustPrefillWithFiller()) stream->Add("F"); 3701 if (MustPrefillWithFiller()) stream->Add("F");
3702 stream->Add(")"); 3702 stream->Add(")");
3703 } 3703 }
3704 3704
3705 3705
3706 HValue* HUnaryMathOperation::EnsureAndPropagateNotMinusZero(
3707 BitVector* visited) {
3708 visited->Add(id());
3709 if (representation().IsSmiOrInteger32() &&
3710 !value()->representation().Equals(representation())) {
3711 if (value()->range() == NULL || value()->range()->CanBeMinusZero()) {
3712 SetFlag(kBailoutOnMinusZero);
3713 }
3714 }
3715 if (RequiredInputRepresentation(0).IsSmiOrInteger32() &&
3716 representation().Equals(RequiredInputRepresentation(0))) {
3717 return value();
3718 }
3719 return NULL;
3720 }
3721
3722
3723 HValue* HChange::EnsureAndPropagateNotMinusZero(BitVector* visited) {
3724 visited->Add(id());
3725 if (from().IsSmiOrInteger32()) return NULL;
3726 if (CanTruncateToInt32()) return NULL;
3727 if (value()->range() == NULL || value()->range()->CanBeMinusZero()) {
3728 SetFlag(kBailoutOnMinusZero);
3729 }
3730 ASSERT(!from().IsSmiOrInteger32() || !to().IsSmiOrInteger32());
3731 return NULL;
3732 }
3733
3734
3735 HValue* HForceRepresentation::EnsureAndPropagateNotMinusZero(
3736 BitVector* visited) {
3737 visited->Add(id());
3738 return value();
3739 }
3740
3741
3742 HValue* HMod::EnsureAndPropagateNotMinusZero(BitVector* visited) {
3743 visited->Add(id());
3744 if (range() == NULL || range()->CanBeMinusZero()) {
3745 SetFlag(kBailoutOnMinusZero);
3746 return left();
3747 }
3748 return NULL;
3749 }
3750
3751
3752 HValue* HDiv::EnsureAndPropagateNotMinusZero(BitVector* visited) {
3753 visited->Add(id());
3754 if (range() == NULL || range()->CanBeMinusZero()) {
3755 SetFlag(kBailoutOnMinusZero);
3756 }
3757 return NULL;
3758 }
3759
3760
3761 HValue* HMathFloorOfDiv::EnsureAndPropagateNotMinusZero(BitVector* visited) {
3762 visited->Add(id());
3763 SetFlag(kBailoutOnMinusZero);
3764 return NULL;
3765 }
3766
3767
3768 HValue* HMul::EnsureAndPropagateNotMinusZero(BitVector* visited) {
3769 visited->Add(id());
3770 if (range() == NULL || range()->CanBeMinusZero()) {
3771 SetFlag(kBailoutOnMinusZero);
3772 }
3773 return NULL;
3774 }
3775
3776
3777 HValue* HSub::EnsureAndPropagateNotMinusZero(BitVector* visited) {
3778 visited->Add(id());
3779 // Propagate to the left argument. If the left argument cannot be -0, then
3780 // the result of the add operation cannot be either.
3781 if (range() == NULL || range()->CanBeMinusZero()) {
3782 return left();
3783 }
3784 return NULL;
3785 }
3786
3787
3788 HValue* HAdd::EnsureAndPropagateNotMinusZero(BitVector* visited) {
3789 visited->Add(id());
3790 // Propagate to the left argument. If the left argument cannot be -0, then
3791 // the result of the sub operation cannot be either.
3792 if (range() == NULL || range()->CanBeMinusZero()) {
3793 return left();
3794 }
3795 return NULL;
3796 }
3797
3798
3799 bool HStoreKeyed::NeedsCanonicalization() { 3706 bool HStoreKeyed::NeedsCanonicalization() {
3800 // If value is an integer or smi or comes from the result of a keyed load or 3707 // If value is an integer or smi or comes from the result of a keyed load or
3801 // constant then it is either be a non-hole value or in the case of a constant 3708 // constant then it is either be a non-hole value or in the case of a constant
3802 // the hole is only being stored explicitly: no need for canonicalization. 3709 // the hole is only being stored explicitly: no need for canonicalization.
3803 // 3710 //
3804 // The exception to that is keyed loads from external float or double arrays: 3711 // The exception to that is keyed loads from external float or double arrays:
3805 // these can load arbitrary representation of NaN. 3712 // these can load arbitrary representation of NaN.
3806 3713
3807 if (value()->IsConstant()) { 3714 if (value()->IsConstant()) {
3808 return false; 3715 return false;
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
4530 break; 4437 break;
4531 case kExternalMemory: 4438 case kExternalMemory:
4532 stream->Add("[external-memory]"); 4439 stream->Add("[external-memory]");
4533 break; 4440 break;
4534 } 4441 }
4535 4442
4536 stream->Add("@%d", offset()); 4443 stream->Add("@%d", offset());
4537 } 4444 }
4538 4445
4539 } } // namespace v8::internal 4446 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/hydrogen-minus-zero.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698