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

Unified Diff: src/js/typedarray.js

Issue 1680783002: [intrinsics] Kill the %_IsMinusZero intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/runtime.js ('k') | src/ppc/macro-assembler-ppc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/typedarray.js
diff --git a/src/js/typedarray.js b/src/js/typedarray.js
index 7becd8947a5a9161b1584d3f1e2bfd93a223d7d3..adb41ec0fb1fbdb12123937b60a45e8018a27d42 100644
--- a/src/js/typedarray.js
+++ b/src/js/typedarray.js
@@ -565,22 +565,20 @@ function TypedArrayReverse() {
function TypedArrayComparefn(x, y) {
- if (IsNaN(x) && IsNaN(y)) {
- return IsNaN(y) ? 0 : 1;
+ if (x === 0 && x === y) {
+ x = 1 / x;
+ y = 1 / y;
}
- if (IsNaN(x)) {
+ if (x < y) {
+ return -1;
+ } else if (x > y) {
+ return 1;
+ } else if (IsNaN(x) && IsNaN(y)) {
+ return IsNaN(y) ? 0 : 1;
+ } else if (IsNaN(x)) {
return 1;
}
- if (x === 0 && x === y) {
- if (%_IsMinusZero(x)) {
- if (!%_IsMinusZero(y)) {
- return -1;
- }
- } else if (%_IsMinusZero(y)) {
- return 1;
- }
- }
- return x - y;
+ return 0;
}
« no previous file with comments | « src/js/runtime.js ('k') | src/ppc/macro-assembler-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698