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

Side by Side Diff: src/types.h

Issue 636283009: [turbofan] Use range types to type and lower arithmetic ops. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rename MaybeWeaken and rebase Created 6 years, 1 month 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/compiler/typer.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_TYPES_H_ 5 #ifndef V8_TYPES_H_
6 #define V8_TYPES_H_ 6 #define V8_TYPES_H_
7 7
8 #include "src/conversions.h" 8 #include "src/conversions.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/handles.h" 10 #include "src/handles.h"
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 780
781 template<class Config> 781 template<class Config>
782 class TypeImpl<Config>::RangeType : public StructuralType { 782 class TypeImpl<Config>::RangeType : public StructuralType {
783 public: 783 public:
784 int BitsetLub() { return this->Get(0)->AsBitset(); } 784 int BitsetLub() { return this->Get(0)->AsBitset(); }
785 i::Handle<i::Object> Min() { return this->template GetValue<i::Object>(1); } 785 i::Handle<i::Object> Min() { return this->template GetValue<i::Object>(1); }
786 i::Handle<i::Object> Max() { return this->template GetValue<i::Object>(2); } 786 i::Handle<i::Object> Max() { return this->template GetValue<i::Object>(2); }
787 787
788 static RangeHandle New( 788 static RangeHandle New(
789 i::Handle<i::Object> min, i::Handle<i::Object> max, Region* region) { 789 i::Handle<i::Object> min, i::Handle<i::Object> max, Region* region) {
790 DCHECK(IsInteger(min->Number()) && IsInteger(max->Number()));
790 DCHECK(min->Number() <= max->Number()); 791 DCHECK(min->Number() <= max->Number());
791 RangeHandle type = Config::template cast<RangeType>( 792 RangeHandle type = Config::template cast<RangeType>(
792 StructuralType::New(StructuralType::kRangeTag, 3, region)); 793 StructuralType::New(StructuralType::kRangeTag, 3, region));
793 type->Set(0, BitsetType::New( 794 type->Set(0, BitsetType::New(
794 BitsetType::Lub(min->Number(), max->Number()), region)); 795 BitsetType::Lub(min->Number(), max->Number()), region));
795 type->SetValue(1, min); 796 type->SetValue(1, min);
796 type->SetValue(2, max); 797 type->SetValue(2, max);
797 return type; 798 return type;
798 } 799 }
799 800
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 bool Narrows(BoundsImpl that) { 1057 bool Narrows(BoundsImpl that) {
1057 return that.lower->Is(this->lower) && this->upper->Is(that.upper); 1058 return that.lower->Is(this->lower) && this->upper->Is(that.upper);
1058 } 1059 }
1059 }; 1060 };
1060 1061
1061 typedef BoundsImpl<ZoneTypeConfig> Bounds; 1062 typedef BoundsImpl<ZoneTypeConfig> Bounds;
1062 1063
1063 } } // namespace v8::internal 1064 } } // namespace v8::internal
1064 1065
1065 #endif // V8_TYPES_H_ 1066 #endif // V8_TYPES_H_
OLDNEW
« no previous file with comments | « src/compiler/typer.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698