Commit f68b3140 authored by kasperl@chromium.org's avatar kasperl@chromium.org

Change custom NaN check to use isnan to fix pixel array

failures on ARM hardware.
Review URL: http://codereview.chromium.org/160269

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2557 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 516d47c7
...@@ -7060,20 +7060,16 @@ Object* PixelArray::SetValue(uint32_t index, Object* value) { ...@@ -7060,20 +7060,16 @@ Object* PixelArray::SetValue(uint32_t index, Object* value) {
if (value->IsSmi()) { if (value->IsSmi()) {
int_value = Smi::cast(value)->value(); int_value = Smi::cast(value)->value();
} else if (value->IsHeapNumber()) { } else if (value->IsHeapNumber()) {
static const DoubleRepresentation nan(OS::nan_value()); double double_value = HeapNumber::cast(value)->value();
DoubleRepresentation double_value = HeapNumber::cast(value)->value(); if (!isnan(double_value)) {
if (nan.bits != double_value.bits) { // NaN clamps to zero (default). Other doubles are rounded to
int_value = static_cast<int>(double_value.value + 0.5); // the nearest integer.
} else { int_value = static_cast<int>(double_value + 0.5);
// NaN clamps to zero.
int_value = 0;
} }
} else if (value->IsUndefined()) {
int_value = 0;
} else { } else {
// All other types have been converted to a number type further up in the // Clamp undefined to zero (default). All other types have been
// call chain. // converted to a number type further up in the call chain.
UNREACHABLE(); ASSERT(value->IsUndefined());
} }
if (int_value < 0) { if (int_value < 0) {
clamped_value = 0; clamped_value = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment