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

Side by Side Diff: src/objects-inl.h

Issue 7342048: Make sure that canonical NaN is also platform NaN. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: remove whitespace changes 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 | « src/objects-debug.cc ('k') | src/v8globals.h » ('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 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 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 return BitCast<uint64_t, double>(value) == kHoleNanInt64; 1614 return BitCast<uint64_t, double>(value) == kHoleNanInt64;
1615 } 1615 }
1616 1616
1617 1617
1618 inline double FixedDoubleArray::hole_nan_as_double() { 1618 inline double FixedDoubleArray::hole_nan_as_double() {
1619 return BitCast<double, uint64_t>(kHoleNanInt64); 1619 return BitCast<double, uint64_t>(kHoleNanInt64);
1620 } 1620 }
1621 1621
1622 1622
1623 inline double FixedDoubleArray::canonical_not_the_hole_nan_as_double() { 1623 inline double FixedDoubleArray::canonical_not_the_hole_nan_as_double() {
1624 return BitCast<double, uint64_t>(kCanonicalNonHoleNanInt64); 1624 ASSERT(BitCast<uint64_t>(OS::nan_value()) != kHoleNanInt64);
1625 ASSERT((BitCast<uint64_t>(OS::nan_value()) >> 32) != kHoleNanUpper32);
1626 return OS::nan_value();
1625 } 1627 }
1626 1628
1627 1629
1628 double FixedDoubleArray::get(int index) { 1630 double FixedDoubleArray::get(int index) {
1629 ASSERT(map() != HEAP->fixed_cow_array_map() && 1631 ASSERT(map() != HEAP->fixed_cow_array_map() &&
1630 map() != HEAP->fixed_array_map()); 1632 map() != HEAP->fixed_array_map());
1631 ASSERT(index >= 0 && index < this->length()); 1633 ASSERT(index >= 0 && index < this->length());
1632 double result = READ_DOUBLE_FIELD(this, kHeaderSize + index * kDoubleSize); 1634 double result = READ_DOUBLE_FIELD(this, kHeaderSize + index * kDoubleSize);
1633 ASSERT(!is_the_hole_nan(result)); 1635 ASSERT(!is_the_hole_nan(result));
1634 return result; 1636 return result;
(...skipping 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after
4461 #undef WRITE_INT_FIELD 4463 #undef WRITE_INT_FIELD
4462 #undef READ_SHORT_FIELD 4464 #undef READ_SHORT_FIELD
4463 #undef WRITE_SHORT_FIELD 4465 #undef WRITE_SHORT_FIELD
4464 #undef READ_BYTE_FIELD 4466 #undef READ_BYTE_FIELD
4465 #undef WRITE_BYTE_FIELD 4467 #undef WRITE_BYTE_FIELD
4466 4468
4467 4469
4468 } } // namespace v8::internal 4470 } } // namespace v8::internal
4469 4471
4470 #endif // V8_OBJECTS_INL_H_ 4472 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/v8globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698