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

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

Issue 7516001: InferRange simplifications (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: additional simplification to HValue::AddNewRange Created 9 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 } else { 872 } else {
874 // Untagged integer32 cannot be -0 and we don't compute ranges for 873 // Untagged integer32 cannot be -0 and we don't compute ranges for
875 // untagged doubles. 874 // untagged doubles.
876 return new Range(); 875 return new Range();
877 } 876 }
878 } 877 }
879 878
880 879
881 Range* HConstant::InferRange() { 880 Range* HConstant::InferRange() {
882 if (has_int32_value_) { 881 if (has_int32_value_) {
883 Range* result = new Range(int32_value_, int32_value_); 882 return new Range(int32_value_, int32_value_);
884 result->set_can_be_minus_zero(false);
885 return result;
886 } 883 }
887 return HValue::InferRange(); 884 return HValue::InferRange();
888 } 885 }
889 886
890 887
891 Range* HPhi::InferRange() { 888 Range* HPhi::InferRange() {
892 if (representation().IsInteger32()) { 889 if (representation().IsInteger32()) {
893 if (block()->IsLoopHeader()) { 890 if (block()->IsLoopHeader()) {
894 Range* range = new Range(kMinInt, kMaxInt); 891 return new Range();
895 return range;
896 } else { 892 } else {
897 Range* range = OperandAt(0)->range()->Copy(); 893 Range* range = OperandAt(0)->range()->Copy();
898 for (int i = 1; i < OperandCount(); ++i) { 894 for (int i = 1; i < OperandCount(); ++i) {
899 range->Union(OperandAt(i)->range()); 895 range->Union(OperandAt(i)->range());
900 } 896 }
901 return range; 897 return range;
902 } 898 }
903 } else { 899 } else {
904 return HValue::InferRange(); 900 return HValue::InferRange();
905 } 901 }
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 1837
1842 1838
1843 void HCheckPrototypeMaps::Verify() { 1839 void HCheckPrototypeMaps::Verify() {
1844 HInstruction::Verify(); 1840 HInstruction::Verify();
1845 ASSERT(HasNoUses()); 1841 ASSERT(HasNoUses());
1846 } 1842 }
1847 1843
1848 #endif 1844 #endif
1849 1845
1850 } } // namespace v8::internal 1846 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698