| OLD | NEW |
| 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 |
| 11 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
| 12 // Imports | 12 // Imports |
| 13 | 13 |
| 14 var GlobalObject = global.Object; | 14 var GlobalObject = global.Object; |
| 15 var MathMax; | 15 var MathMax; |
| 16 var ToNumber; | 16 var ToNumber; |
| 17 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
| 17 | 18 |
| 18 utils.Import(function(from) { | 19 utils.Import(function(from) { |
| 19 MathMax = from.MathMax; | 20 MathMax = from.MathMax; |
| 20 ToNumber = from.ToNumber; | 21 ToNumber = from.ToNumber; |
| 21 }); | 22 }); |
| 22 | 23 |
| 23 // ------------------------------------------------------------------- | 24 // ------------------------------------------------------------------- |
| 24 | 25 |
| 25 | 26 |
| 26 function CheckSharedTypedArray(sta) { | 27 function CheckSharedTypedArray(sta) { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // ------------------------------------------------------------------- | 186 // ------------------------------------------------------------------- |
| 186 | 187 |
| 187 function AtomicsConstructor() {} | 188 function AtomicsConstructor() {} |
| 188 | 189 |
| 189 var Atomics = new AtomicsConstructor(); | 190 var Atomics = new AtomicsConstructor(); |
| 190 | 191 |
| 191 %InternalSetPrototype(Atomics, GlobalObject.prototype); | 192 %InternalSetPrototype(Atomics, GlobalObject.prototype); |
| 192 %AddNamedProperty(global, "Atomics", Atomics, DONT_ENUM); | 193 %AddNamedProperty(global, "Atomics", Atomics, DONT_ENUM); |
| 193 %FunctionSetInstanceClassName(AtomicsConstructor, 'Atomics'); | 194 %FunctionSetInstanceClassName(AtomicsConstructor, 'Atomics'); |
| 194 | 195 |
| 195 %AddNamedProperty(Atomics, symbolToStringTag, "Atomics", READ_ONLY | DONT_ENUM); | 196 %AddNamedProperty(Atomics, toStringTagSymbol, "Atomics", READ_ONLY | DONT_ENUM); |
| 196 | 197 |
| 197 // These must match the values in src/futex-emulation.h | 198 // These must match the values in src/futex-emulation.h |
| 198 utils.InstallConstants(Atomics, [ | 199 utils.InstallConstants(Atomics, [ |
| 199 "OK", 0, | 200 "OK", 0, |
| 200 "NOTEQUAL", -1, | 201 "NOTEQUAL", -1, |
| 201 "TIMEDOUT", -2, | 202 "TIMEDOUT", -2, |
| 202 ]); | 203 ]); |
| 203 | 204 |
| 204 utils.InstallFunctions(Atomics, DONT_ENUM, [ | 205 utils.InstallFunctions(Atomics, DONT_ENUM, [ |
| 205 "compareExchange", AtomicsCompareExchangeJS, | 206 "compareExchange", AtomicsCompareExchangeJS, |
| 206 "load", AtomicsLoadJS, | 207 "load", AtomicsLoadJS, |
| 207 "store", AtomicsStoreJS, | 208 "store", AtomicsStoreJS, |
| 208 "add", AtomicsAddJS, | 209 "add", AtomicsAddJS, |
| 209 "sub", AtomicsSubJS, | 210 "sub", AtomicsSubJS, |
| 210 "and", AtomicsAndJS, | 211 "and", AtomicsAndJS, |
| 211 "or", AtomicsOrJS, | 212 "or", AtomicsOrJS, |
| 212 "xor", AtomicsXorJS, | 213 "xor", AtomicsXorJS, |
| 213 "exchange", AtomicsExchangeJS, | 214 "exchange", AtomicsExchangeJS, |
| 214 "isLockFree", AtomicsIsLockFreeJS, | 215 "isLockFree", AtomicsIsLockFreeJS, |
| 215 "futexWait", AtomicsFutexWaitJS, | 216 "futexWait", AtomicsFutexWaitJS, |
| 216 "futexWake", AtomicsFutexWakeJS, | 217 "futexWake", AtomicsFutexWakeJS, |
| 217 "futexWakeOrRequeue", AtomicsFutexWakeOrRequeueJS, | 218 "futexWakeOrRequeue", AtomicsFutexWakeOrRequeueJS, |
| 218 ]); | 219 ]); |
| 219 | 220 |
| 220 }) | 221 }) |
| OLD | NEW |