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

Unified Diff: src/js/harmony-atomics.js

Issue 1884883003: Revert of [Atomics] code stubs for atomic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/interface-descriptors.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/interface-descriptors.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698