OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 4208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4219 int16_t Int16ArrayTraits::defaultValue() { return 0; } | 4219 int16_t Int16ArrayTraits::defaultValue() { return 0; } |
4220 | 4220 |
4221 | 4221 |
4222 uint32_t Uint32ArrayTraits::defaultValue() { return 0; } | 4222 uint32_t Uint32ArrayTraits::defaultValue() { return 0; } |
4223 | 4223 |
4224 | 4224 |
4225 int32_t Int32ArrayTraits::defaultValue() { return 0; } | 4225 int32_t Int32ArrayTraits::defaultValue() { return 0; } |
4226 | 4226 |
4227 | 4227 |
4228 float Float32ArrayTraits::defaultValue() { | 4228 float Float32ArrayTraits::defaultValue() { |
4229 return static_cast<float>(base::OS::nan_value()); | 4229 return std::numeric_limits<float>::quiet_NaN(); |
4230 } | 4230 } |
4231 | 4231 |
4232 | 4232 |
4233 double Float64ArrayTraits::defaultValue() { return base::OS::nan_value(); } | 4233 double Float64ArrayTraits::defaultValue() { |
| 4234 return std::numeric_limits<double>::quiet_NaN(); |
| 4235 } |
4234 | 4236 |
4235 | 4237 |
4236 template <class Traits> | 4238 template <class Traits> |
4237 typename Traits::ElementType FixedTypedArray<Traits>::get_scalar(int index) { | 4239 typename Traits::ElementType FixedTypedArray<Traits>::get_scalar(int index) { |
4238 DCHECK((index >= 0) && (index < this->length())); | 4240 DCHECK((index >= 0) && (index < this->length())); |
4239 ElementType* ptr = reinterpret_cast<ElementType*>( | 4241 ElementType* ptr = reinterpret_cast<ElementType*>( |
4240 FIELD_ADDR(this, kDataOffset)); | 4242 FIELD_ADDR(this, kDataOffset)); |
4241 return ptr[index]; | 4243 return ptr[index]; |
4242 } | 4244 } |
4243 | 4245 |
(...skipping 3256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7500 #undef READ_SHORT_FIELD | 7502 #undef READ_SHORT_FIELD |
7501 #undef WRITE_SHORT_FIELD | 7503 #undef WRITE_SHORT_FIELD |
7502 #undef READ_BYTE_FIELD | 7504 #undef READ_BYTE_FIELD |
7503 #undef WRITE_BYTE_FIELD | 7505 #undef WRITE_BYTE_FIELD |
7504 #undef NOBARRIER_READ_BYTE_FIELD | 7506 #undef NOBARRIER_READ_BYTE_FIELD |
7505 #undef NOBARRIER_WRITE_BYTE_FIELD | 7507 #undef NOBARRIER_WRITE_BYTE_FIELD |
7506 | 7508 |
7507 } } // namespace v8::internal | 7509 } } // namespace v8::internal |
7508 | 7510 |
7509 #endif // V8_OBJECTS_INL_H_ | 7511 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |