OLD | NEW |
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_COMPILER_TYPE_CACHE_H_ | 5 #ifndef V8_COMPILER_TYPE_CACHE_H_ |
6 #define V8_COMPILER_TYPE_CACHE_H_ | 6 #define V8_COMPILER_TYPE_CACHE_H_ |
7 | 7 |
8 #include "src/compiler/types.h" | 8 #include "src/compiler/types.h" |
9 #include "src/date.h" | 9 #include "src/date.h" |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // The JSDate::weekday property always contains a tagged number in the range | 134 // The JSDate::weekday property always contains a tagged number in the range |
135 // [0, 6] or NaN. | 135 // [0, 6] or NaN. |
136 Type* const kJSDateWeekdayType = | 136 Type* const kJSDateWeekdayType = |
137 Type::Union(CreateRange(0, 6.0), Type::NaN(), zone()); | 137 Type::Union(CreateRange(0, 6.0), Type::NaN(), zone()); |
138 | 138 |
139 // The JSDate::year property always contains a tagged number in the signed | 139 // The JSDate::year property always contains a tagged number in the signed |
140 // small range or NaN. | 140 // small range or NaN. |
141 Type* const kJSDateYearType = | 141 Type* const kJSDateYearType = |
142 Type::Union(Type::SignedSmall(), Type::NaN(), zone()); | 142 Type::Union(Type::SignedSmall(), Type::NaN(), zone()); |
143 | 143 |
| 144 // The valid number of arguments for JavaScript functions. |
| 145 Type* const kArgumentsLengthType = |
| 146 Type::Range(0.0, Code::kMaxArguments, zone()); |
| 147 |
144 private: | 148 private: |
145 template <typename T> | 149 template <typename T> |
146 Type* CreateRange() { | 150 Type* CreateRange() { |
147 return CreateRange(std::numeric_limits<T>::min(), | 151 return CreateRange(std::numeric_limits<T>::min(), |
148 std::numeric_limits<T>::max()); | 152 std::numeric_limits<T>::max()); |
149 } | 153 } |
150 | 154 |
151 Type* CreateRange(double min, double max) { | 155 Type* CreateRange(double min, double max) { |
152 return Type::Range(min, max, zone()); | 156 return Type::Range(min, max, zone()); |
153 } | 157 } |
154 | 158 |
155 Zone* zone() { return &zone_; } | 159 Zone* zone() { return &zone_; } |
156 }; | 160 }; |
157 | 161 |
158 } // namespace compiler | 162 } // namespace compiler |
159 } // namespace internal | 163 } // namespace internal |
160 } // namespace v8 | 164 } // namespace v8 |
161 | 165 |
162 #endif // V8_COMPILER_TYPE_CACHE_H_ | 166 #endif // V8_COMPILER_TYPE_CACHE_H_ |
OLD | NEW |