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

Unified Diff: src/harmony-atomics.js

Issue 1232243002: In Atomics API, convert operands to numbers before calling runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: feedback Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/atomics.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-atomics.js
diff --git a/src/harmony-atomics.js b/src/harmony-atomics.js
index aa81822d1e2f877f4de933f02d269b81775eea11..e801939acbd229b581ae12e9ad0d5941290bc876 100644
--- a/src/harmony-atomics.js
+++ b/src/harmony-atomics.js
@@ -36,6 +36,8 @@ function AtomicsCompareExchangeJS(sta, index, oldValue, newValue) {
if (index < 0 || index >= sta.length) {
return UNDEFINED;
}
+ oldValue = $toNumber(oldValue);
+ newValue = $toNumber(newValue);
return %_AtomicsCompareExchange(sta, index, oldValue, newValue);
}
@@ -54,6 +56,7 @@ function AtomicsStoreJS(sta, index, value) {
if (index < 0 || index >= sta.length) {
return UNDEFINED;
}
+ value = $toNumber(value);
return %_AtomicsStore(sta, index, value);
}
@@ -63,6 +66,7 @@ function AtomicsAddJS(ia, index, value) {
if (index < 0 || index >= ia.length) {
return UNDEFINED;
}
+ value = $toNumber(value);
return %_AtomicsAdd(ia, index, value);
}
@@ -72,6 +76,7 @@ function AtomicsSubJS(ia, index, value) {
if (index < 0 || index >= ia.length) {
return UNDEFINED;
}
+ value = $toNumber(value);
return %_AtomicsSub(ia, index, value);
}
@@ -81,6 +86,7 @@ function AtomicsAndJS(ia, index, value) {
if (index < 0 || index >= ia.length) {
return UNDEFINED;
}
+ value = $toNumber(value);
return %_AtomicsAnd(ia, index, value);
}
@@ -90,6 +96,7 @@ function AtomicsOrJS(ia, index, value) {
if (index < 0 || index >= ia.length) {
return UNDEFINED;
}
+ value = $toNumber(value);
return %_AtomicsOr(ia, index, value);
}
@@ -99,6 +106,7 @@ function AtomicsXorJS(ia, index, value) {
if (index < 0 || index >= ia.length) {
return UNDEFINED;
}
+ value = $toNumber(value);
return %_AtomicsXor(ia, index, value);
}
@@ -108,6 +116,7 @@ function AtomicsExchangeJS(ia, index, value) {
if (index < 0 || index >= ia.length) {
return UNDEFINED;
}
+ value = $toNumber(value);
return %_AtomicsExchange(ia, index, value);
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/atomics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698