Index: src/js/harmony-atomics.js |
diff --git a/src/js/harmony-atomics.js b/src/js/harmony-atomics.js |
index 598468084a3cff9f89c991d7df4370ef66a44cf5..9f80227426b41f106d34bf1604702be0ad2ae377 100644 |
--- a/src/js/harmony-atomics.js |
+++ b/src/js/harmony-atomics.js |
@@ -60,6 +60,12 @@ |
oldValue = TO_NUMBER(oldValue); |
newValue = TO_NUMBER(newValue); |
return %_AtomicsCompareExchange(sta, index, oldValue, newValue); |
+} |
+ |
+function AtomicsLoadJS(sta, index) { |
+ CheckSharedIntegerTypedArray(sta); |
+ index = ValidateIndex(index, %_TypedArrayGetLength(sta)); |
+ return %_AtomicsLoad(sta, index); |
} |
function AtomicsStoreJS(sta, index, value) { |
@@ -155,9 +161,13 @@ |
// ------------------------------------------------------------------- |
-var Atomics = global.Atomics; |
+function AtomicsConstructor() {} |
-// The Atomics global is defined by the bootstrapper. |
+var Atomics = new AtomicsConstructor(); |
+ |
+%InternalSetPrototype(Atomics, GlobalObject.prototype); |
+%AddNamedProperty(global, "Atomics", Atomics, DONT_ENUM); |
+%FunctionSetInstanceClassName(AtomicsConstructor, 'Atomics'); |
%AddNamedProperty(Atomics, toStringTagSymbol, "Atomics", READ_ONLY | DONT_ENUM); |
@@ -169,9 +179,8 @@ |
]); |
utils.InstallFunctions(Atomics, DONT_ENUM, [ |
- // TODO(binji): remove the rest of the (non futex) Atomics functions as they |
- // become builtins. |
"compareExchange", AtomicsCompareExchangeJS, |
+ "load", AtomicsLoadJS, |
"store", AtomicsStoreJS, |
"add", AtomicsAddJS, |
"sub", AtomicsSubJS, |