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 #include <iomanip> | 5 #include <iomanip> |
6 | 6 |
7 #include "src/types.h" | 7 #include "src/types.h" |
8 | 8 |
9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
10 #include "src/types-inl.h" | 10 #include "src/types-inl.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 DisallowHeapAllocation no_allocation; | 336 DisallowHeapAllocation no_allocation; |
337 DCHECK(Is(bits, kNumber)); | 337 DCHECK(Is(bits, kNumber)); |
338 const BitsetMin* mins = BitsetMins(); | 338 const BitsetMin* mins = BitsetMins(); |
339 bool mz = SEMANTIC(bits & kMinusZero); | 339 bool mz = SEMANTIC(bits & kMinusZero); |
340 for (size_t i = 0; i < BitsetMinsSize(); ++i) { | 340 for (size_t i = 0; i < BitsetMinsSize(); ++i) { |
341 if (Is(SEMANTIC(mins[i].bits), bits)) { | 341 if (Is(SEMANTIC(mins[i].bits), bits)) { |
342 return mz ? std::min(0.0, mins[i].min) : mins[i].min; | 342 return mz ? std::min(0.0, mins[i].min) : mins[i].min; |
343 } | 343 } |
344 } | 344 } |
345 if (mz) return 0; | 345 if (mz) return 0; |
346 return base::OS::nan_value(); | 346 return std::numeric_limits<double>::quiet_NaN(); |
347 } | 347 } |
348 | 348 |
349 | 349 |
350 template<class Config> | 350 template<class Config> |
351 double TypeImpl<Config>::BitsetType::Max(bitset bits) { | 351 double TypeImpl<Config>::BitsetType::Max(bitset bits) { |
352 DisallowHeapAllocation no_allocation; | 352 DisallowHeapAllocation no_allocation; |
353 DCHECK(Is(bits, kNumber)); | 353 DCHECK(Is(bits, kNumber)); |
354 const BitsetMin* mins = BitsetMins(); | 354 const BitsetMin* mins = BitsetMins(); |
355 bool mz = SEMANTIC(bits & kMinusZero); | 355 bool mz = SEMANTIC(bits & kMinusZero); |
356 if (BitsetType::Is(mins[BitsetMinsSize()-1].bits, bits)) { | 356 if (BitsetType::Is(mins[BitsetMinsSize()-1].bits, bits)) { |
357 return +V8_INFINITY; | 357 return +V8_INFINITY; |
358 } | 358 } |
359 for (size_t i = BitsetMinsSize()-1; i-- > 0; ) { | 359 for (size_t i = BitsetMinsSize()-1; i-- > 0; ) { |
360 if (Is(SEMANTIC(mins[i].bits), bits)) { | 360 if (Is(SEMANTIC(mins[i].bits), bits)) { |
361 return mz ? | 361 return mz ? |
362 std::max(0.0, mins[i+1].min - 1) : mins[i+1].min - 1; | 362 std::max(0.0, mins[i+1].min - 1) : mins[i+1].min - 1; |
363 } | 363 } |
364 } | 364 } |
365 if (mz) return 0; | 365 if (mz) return 0; |
366 return base::OS::nan_value(); | 366 return std::numeric_limits<double>::quiet_NaN(); |
367 } | 367 } |
368 | 368 |
369 | 369 |
370 // ----------------------------------------------------------------------------- | 370 // ----------------------------------------------------------------------------- |
371 // Predicates. | 371 // Predicates. |
372 | 372 |
373 | 373 |
374 template<class Config> | 374 template<class Config> |
375 bool TypeImpl<Config>::SimplyEquals(TypeImpl* that) { | 375 bool TypeImpl<Config>::SimplyEquals(TypeImpl* that) { |
376 DisallowHeapAllocation no_allocation; | 376 DisallowHeapAllocation no_allocation; |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; | 1098 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; |
1099 | 1099 |
1100 template TypeImpl<ZoneTypeConfig>::TypeHandle | 1100 template TypeImpl<ZoneTypeConfig>::TypeHandle |
1101 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( | 1101 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( |
1102 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); | 1102 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); |
1103 template TypeImpl<HeapTypeConfig>::TypeHandle | 1103 template TypeImpl<HeapTypeConfig>::TypeHandle |
1104 TypeImpl<HeapTypeConfig>::Convert<Type>( | 1104 TypeImpl<HeapTypeConfig>::Convert<Type>( |
1105 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); | 1105 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); |
1106 | 1106 |
1107 } } // namespace v8::internal | 1107 } } // namespace v8::internal |
OLD | NEW |