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

Side by Side Diff: src/js/harmony-atomics.js

Issue 1617503003: [Atomics] code stubs for atomic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: more WIP on using CodeStubAssembler 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 index2 = TO_INTEGER(index2); 172 index2 = TO_INTEGER(index2);
173 if (index1 < 0 || index1 >= %_TypedArrayGetLength(ia) || 173 if (index1 < 0 || index1 >= %_TypedArrayGetLength(ia) ||
174 index2 < 0 || index2 >= %_TypedArrayGetLength(ia)) { 174 index2 < 0 || index2 >= %_TypedArrayGetLength(ia)) {
175 return UNDEFINED; 175 return UNDEFINED;
176 } 176 }
177 return %AtomicsFutexWakeOrRequeue(ia, index1, count, value, index2); 177 return %AtomicsFutexWakeOrRequeue(ia, index1, count, value, index2);
178 } 178 }
179 179
180 // ------------------------------------------------------------------- 180 // -------------------------------------------------------------------
181 181
182 function AtomicsConstructor() {} 182 var Atomics = global.Atomics;
183
184 var Atomics = new AtomicsConstructor();
185
186 %InternalSetPrototype(Atomics, GlobalObject.prototype);
187 %AddNamedProperty(global, "Atomics", Atomics, DONT_ENUM);
188 %FunctionSetInstanceClassName(AtomicsConstructor, 'Atomics');
189 183
190 %AddNamedProperty(Atomics, toStringTagSymbol, "Atomics", READ_ONLY | DONT_ENUM); 184 %AddNamedProperty(Atomics, toStringTagSymbol, "Atomics", READ_ONLY | DONT_ENUM);
191 185
192 // These must match the values in src/futex-emulation.h 186 // These must match the values in src/futex-emulation.h
193 utils.InstallConstants(Atomics, [ 187 utils.InstallConstants(Atomics, [
194 "OK", 0, 188 "OK", 0,
195 "NOTEQUAL", -1, 189 "NOTEQUAL", -1,
196 "TIMEDOUT", -2, 190 "TIMEDOUT", -2,
197 ]); 191 ]);
198 192
199 utils.InstallFunctions(Atomics, DONT_ENUM, [ 193 utils.InstallFunctions(Atomics, DONT_ENUM, [
200 "compareExchange", AtomicsCompareExchangeJS, 194 "compareExchange", AtomicsCompareExchangeJS,
201 "load", AtomicsLoadJS, 195 // "load", AtomicsLoadJS,
202 "store", AtomicsStoreJS, 196 "store", AtomicsStoreJS,
203 "add", AtomicsAddJS, 197 "add", AtomicsAddJS,
204 "sub", AtomicsSubJS, 198 "sub", AtomicsSubJS,
205 "and", AtomicsAndJS, 199 "and", AtomicsAndJS,
206 "or", AtomicsOrJS, 200 "or", AtomicsOrJS,
207 "xor", AtomicsXorJS, 201 "xor", AtomicsXorJS,
208 "exchange", AtomicsExchangeJS, 202 "exchange", AtomicsExchangeJS,
209 "isLockFree", AtomicsIsLockFreeJS, 203 "isLockFree", AtomicsIsLockFreeJS,
210 "futexWait", AtomicsFutexWaitJS, 204 "futexWait", AtomicsFutexWaitJS,
211 "futexWake", AtomicsFutexWakeJS, 205 "futexWake", AtomicsFutexWakeJS,
212 "futexWakeOrRequeue", AtomicsFutexWakeOrRequeueJS, 206 "futexWakeOrRequeue", AtomicsFutexWakeOrRequeueJS,
213 ]); 207 ]);
214 208
215 }) 209 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698