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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 } else { | 474 } else { |
475 removed->set_tail(new_value->use_list_); | 475 removed->set_tail(new_value->use_list_); |
476 new_value->use_list_ = removed; | 476 new_value->use_list_ = removed; |
477 } | 477 } |
478 } | 478 } |
479 } | 479 } |
480 | 480 |
481 | 481 |
482 void HValue::AddNewRange(Range* r) { | 482 void HValue::AddNewRange(Range* r) { |
483 if (!HasRange()) ComputeInitialRange(); | 483 if (!HasRange()) ComputeInitialRange(); |
484 if (!HasRange()) range_ = new Range(); | |
485 ASSERT(HasRange()); | 484 ASSERT(HasRange()); |
486 r->StackUpon(range_); | 485 r->StackUpon(range_); |
487 range_ = r; | 486 range_ = r; |
488 } | 487 } |
489 | 488 |
490 | 489 |
491 void HValue::RemoveLastAddedRange() { | 490 void HValue::RemoveLastAddedRange() { |
492 ASSERT(HasRange()); | 491 ASSERT(HasRange()); |
493 ASSERT(range_->next() != NULL); | 492 ASSERT(range_->next() != NULL); |
494 range_ = range_->next(); | 493 range_ = range_->next(); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 void HInstanceOf::PrintDataTo(StringStream* stream) { | 854 void HInstanceOf::PrintDataTo(StringStream* stream) { |
856 left()->PrintNameTo(stream); | 855 left()->PrintNameTo(stream); |
857 stream->Add(" "); | 856 stream->Add(" "); |
858 right()->PrintNameTo(stream); | 857 right()->PrintNameTo(stream); |
859 stream->Add(" "); | 858 stream->Add(" "); |
860 context()->PrintNameTo(stream); | 859 context()->PrintNameTo(stream); |
861 } | 860 } |
862 | 861 |
863 | 862 |
864 Range* HValue::InferRange() { | 863 Range* HValue::InferRange() { |
865 if (representation().IsTagged()) { | 864 if (representation().IsInteger32 ()) { |
866 // Tagged values are always in int32 range when converted to integer, | 865 // Untagged integer32 cannot be -0. |
867 // but they can contain -0. | 866 return new Range (); |
| 867 } else { |
| 868 // Tagged values, untagged doubles, and values with unknown representation |
| 869 // can contain -0. |
868 Range* result = new Range(); | 870 Range* result = new Range(); |
869 result->set_can_be_minus_zero(true); | 871 result->set_can_be_minus_zero(true); |
870 return result; | 872 return result; |
871 } else if (representation().IsNone()) { | |
872 return NULL; | |
873 } else { | |
874 // Untagged integer32 cannot be -0 and we don't compute ranges for | |
875 // untagged doubles. | |
876 return new Range(); | |
877 } | 873 } |
878 } | 874 } |
879 | 875 |
880 | 876 |
881 Range* HConstant::InferRange() { | 877 Range* HConstant::InferRange() { |
882 if (has_int32_value_) { | 878 if (has_int32_value_) { |
883 Range* result = new Range(int32_value_, int32_value_); | 879 return new Range(int32_value_, int32_value_); |
884 result->set_can_be_minus_zero(false); | |
885 return result; | |
886 } | 880 } |
887 return HValue::InferRange(); | 881 return HValue::InferRange(); |
888 } | 882 } |
889 | 883 |
890 | 884 |
891 Range* HPhi::InferRange() { | 885 Range* HPhi::InferRange() { |
892 if (representation().IsInteger32()) { | 886 if (representation().IsInteger32()) { |
893 if (block()->IsLoopHeader()) { | 887 if (block()->IsLoopHeader()) { |
894 Range* range = new Range(kMinInt, kMaxInt); | 888 return new Range(); |
895 return range; | |
896 } else { | 889 } else { |
897 Range* range = OperandAt(0)->range()->Copy(); | 890 Range* range = OperandAt(0)->range()->Copy(); |
898 for (int i = 1; i < OperandCount(); ++i) { | 891 for (int i = 1; i < OperandCount(); ++i) { |
899 range->Union(OperandAt(i)->range()); | 892 range->Union(OperandAt(i)->range()); |
900 } | 893 } |
901 return range; | 894 return range; |
902 } | 895 } |
903 } else { | 896 } else { |
904 return HValue::InferRange(); | 897 return HValue::InferRange(); |
905 } | 898 } |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 | 1834 |
1842 | 1835 |
1843 void HCheckPrototypeMaps::Verify() { | 1836 void HCheckPrototypeMaps::Verify() { |
1844 HInstruction::Verify(); | 1837 HInstruction::Verify(); |
1845 ASSERT(HasNoUses()); | 1838 ASSERT(HasNoUses()); |
1846 } | 1839 } |
1847 | 1840 |
1848 #endif | 1841 #endif |
1849 | 1842 |
1850 } } // namespace v8::internal | 1843 } } // namespace v8::internal |
OLD | NEW |