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

Unified Diff: src/harmony-atomics.js

Issue 1227913006: Don't use length property when bounds checking atomics functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: modify regression test 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..4ddf3b04f74273f43ce062c16c90728c7b77489d 100644
--- a/src/harmony-atomics.js
+++ b/src/harmony-atomics.js
@@ -33,7 +33,7 @@ function CheckSharedIntegerTypedArray(ia) {
function AtomicsCompareExchangeJS(sta, index, oldValue, newValue) {
CheckSharedTypedArray(sta);
index = $toInteger(index);
- if (index < 0 || index >= sta.length) {
+ if (index < 0 || index >= %_TypedArrayGetLength(sta)) {
return UNDEFINED;
}
return %_AtomicsCompareExchange(sta, index, oldValue, newValue);
@@ -42,7 +42,7 @@ function AtomicsCompareExchangeJS(sta, index, oldValue, newValue) {
function AtomicsLoadJS(sta, index) {
CheckSharedTypedArray(sta);
index = $toInteger(index);
- if (index < 0 || index >= sta.length) {
+ if (index < 0 || index >= %_TypedArrayGetLength(sta)) {
return UNDEFINED;
}
return %_AtomicsLoad(sta, index);
@@ -51,7 +51,7 @@ function AtomicsLoadJS(sta, index) {
function AtomicsStoreJS(sta, index, value) {
CheckSharedTypedArray(sta);
index = $toInteger(index);
- if (index < 0 || index >= sta.length) {
+ if (index < 0 || index >= %_TypedArrayGetLength(sta)) {
return UNDEFINED;
}
return %_AtomicsStore(sta, index, value);
@@ -60,7 +60,7 @@ function AtomicsStoreJS(sta, index, value) {
function AtomicsAddJS(ia, index, value) {
CheckSharedIntegerTypedArray(ia);
index = $toInteger(index);
- if (index < 0 || index >= ia.length) {
+ if (index < 0 || index >= %_TypedArrayGetLength(ia)) {
return UNDEFINED;
}
return %_AtomicsAdd(ia, index, value);
@@ -69,7 +69,7 @@ function AtomicsAddJS(ia, index, value) {
function AtomicsSubJS(ia, index, value) {
CheckSharedIntegerTypedArray(ia);
index = $toInteger(index);
- if (index < 0 || index >= ia.length) {
+ if (index < 0 || index >= %_TypedArrayGetLength(ia)) {
return UNDEFINED;
}
return %_AtomicsSub(ia, index, value);
@@ -78,7 +78,7 @@ function AtomicsSubJS(ia, index, value) {
function AtomicsAndJS(ia, index, value) {
CheckSharedIntegerTypedArray(ia);
index = $toInteger(index);
- if (index < 0 || index >= ia.length) {
+ if (index < 0 || index >= %_TypedArrayGetLength(ia)) {
return UNDEFINED;
}
return %_AtomicsAnd(ia, index, value);
@@ -87,7 +87,7 @@ function AtomicsAndJS(ia, index, value) {
function AtomicsOrJS(ia, index, value) {
CheckSharedIntegerTypedArray(ia);
index = $toInteger(index);
- if (index < 0 || index >= ia.length) {
+ if (index < 0 || index >= %_TypedArrayGetLength(ia)) {
return UNDEFINED;
}
return %_AtomicsOr(ia, index, value);
@@ -96,7 +96,7 @@ function AtomicsOrJS(ia, index, value) {
function AtomicsXorJS(ia, index, value) {
CheckSharedIntegerTypedArray(ia);
index = $toInteger(index);
- if (index < 0 || index >= ia.length) {
+ if (index < 0 || index >= %_TypedArrayGetLength(ia)) {
return UNDEFINED;
}
return %_AtomicsXor(ia, index, value);
@@ -105,7 +105,7 @@ function AtomicsXorJS(ia, index, value) {
function AtomicsExchangeJS(ia, index, value) {
CheckSharedIntegerTypedArray(ia);
index = $toInteger(index);
- if (index < 0 || index >= ia.length) {
+ if (index < 0 || index >= %_TypedArrayGetLength(ia)) {
return UNDEFINED;
}
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