MIPS: Fix NaN handling for start and end indexes in ArraySlice.

Casting NaN to int is unpredictable, on different architectures it produces different int value.

TEST=test262/S15.4.4.10_A2.1_T2, test262/S15.4.4.10_A2.2_T2

BUG=

Review URL: https://codereview.chromium.org/14812014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14621 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
palfia@homejinni.com 2013-05-10 13:04:42 +00:00
parent 64651ed565
commit 1235ce419a

View File

@ -845,7 +845,7 @@ BUILTIN(ArraySlice) {
if (start < kMinInt || start > kMaxInt) {
return CallJsBuiltin(isolate, "ArraySlice", args);
}
relative_start = static_cast<int>(start);
relative_start = std::isnan(start) ? 0 : static_cast<int>(start);
} else if (!arg1->IsUndefined()) {
return CallJsBuiltin(isolate, "ArraySlice", args);
}
@ -858,7 +858,7 @@ BUILTIN(ArraySlice) {
if (end < kMinInt || end > kMaxInt) {
return CallJsBuiltin(isolate, "ArraySlice", args);
}
relative_end = static_cast<int>(end);
relative_end = std::isnan(end) ? 0 : static_cast<int>(end);
} else if (!arg2->IsUndefined()) {
return CallJsBuiltin(isolate, "ArraySlice", args);
}