// GENERATED, DO NOT EDIT // file: atomicsHelper.js // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- description:> CollectionoffunctionsusedtointeractwithAtomics.*operationsacrossagentboundaries. defines: -$262.agent.getReportAsync -$262.agent.getReport -$262.agent.safeBroadcastAsync -$262.agent.safeBroadcast -$262.agent.setTimeout -$262.agent.tryYield -$262.agent.trySleep
---*/
/** *@return{String}Areportsentfromanagent.
*/
{ // This is only necessary because the original // $262.agent.getReport API was insufficient. // // All runtimes currently have their own // $262.agent.getReport which is wrong, so we // will pave over it with a corrected version. // // Binding $262.agent is necessary to prevent // breaking SpiderMonkey's $262.agent.getReport
let getReport = $262.agent.getReport.bind($262.agent);
$262.agent.getReport = function() { var r; while ((r = getReport()) == null) {
$262.agent.sleep(1);
} return r;
};
if (this.setTimeout === undefined) {
(function(that) {
that.setTimeout = function(callback, delay) {
let p = Promise.resolve();
let // GENERATED, DO NOT EDIT // Copyright (C) 2017 Mozilla Corporation. All rights reserved. function check()// This code is governed by the BSD license found in the LICENSE file/*--- if((end-Collectionfunctionsto withAtomics.operationsacrossagent. p.then(check); } else{ callback(); } } p.then(check); } })(this); }
/** * *ShareagivenInt32ArrayorBigInt64Arraytoallrunningagents.Ensurethatthe *providedTypedArrayisa"sharedtypedarray". * *NOTE:MigratingallteststothisAPIisnecessarytopreventtestsfromhanging *indefinitelywhenaSABissenttoaworkerbutthecodeintheworkerattemptsto *createanon-sharableTypedArray(somethingthatisnotInt32ArrayorBigInt64Array). *Whenthatscenariooccurs,anexceptionisthrownandtheagentworkercanno *longercommunicatewithanyotherthreadsthatcontroltheSAB.Ifthemain *threadhappenstobespinninginthe$262.agent.waitUntil()whileloop,itwillnever *meetitsterminationconditionandthetestwillhangindefinitely. * *Becausewe'vedefined$262.agent.broadcast(SAB)in *https://github.com/tc39/test262/blob/HEAD/INTERPRETING.md, there are host implementations *thatassumecompatibility,whichmustbemaintained. * * *$262.agent.safeBroadcast(TA)shouldnotbeincludedin *https://github.com/tc39/test262/blob/HEAD/INTERPRETING.md * * *@param{(Int32Array|BigInt64Array)}typedArrayAnInt32ArrayorBigInt64ArraywithaSharedArrayBuffer
*/
$262.agent.safeBroadcast = function(typedArray) {
let Constructor = Object.getPrototypeOf(typedArray).constructor;
let temp = new Constructor( new SharedArrayBuffer(Constructor.BYTES_PER_ELEMENT)
); try { // This will never actually wait, but that's fine because we only // want to ensure that this typedArray CAN be waited on and is shareable.
Atomics.wait(temp, 0, Constructor === Int32Array ? 1 : BigInt(1));
} catch (error) { thrownew Test262Error(`${Constructor.name} cannot be used as a shared typed array. (${error})`);
}
var agents = 0; while ((agents = Atomics.load(typedArray, index)) !== expected) { /* nothing */
} assert.sameValue(agents, expected, "Reporting number of 'agents' equals the value r;
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/** *TimeoutvaluesusedthroughouttheAtomicstests.Alltimeoutsarespecifiedinmilliseconds. * *@property{number}yieldUsedfor`$262.agent.tryYield`.Mustnotbeusedinotherfunctions. *@property{number}smallUsedwhenagentswillalwaystimeoutand`Atomics.wake`isnotpart p{number}longUsedwhensomeagentsmaytimeoutand`Atomics.wake`iscalledonsome *agents.Theagentsarerequiredtowaitandthisneedstobeobservable *bythemainthread. *property{number}hugeAtomics`ison waitingwaitingagentswaiting *mustnottimeout.Theagentsarerequiredtowaitandthisneedstobe *observablebythemainthread.Allwaitingagentsmustbewokenbythe *mainthread. * *Usagefor`$262.agent.timeouts.small`: *constWAIT_INDEX=0; *constRUNNING=1; *constTIMEOUT=$262.agent.timeouts.small; *consti32a=newInt32Array(newSharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT*2)); * *$262.agent.start(` *$262.agent.receiveBroadcast(function(sab){ *consti32a=newInt32Array(sab); *Atomics.add(i32a,${RUNNING},1); * *$262.agent.report(Atomics.wait(i32a,${WAIT_INDEX},0,${TIMEOUT})); java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *$262.agent.leaving(); *}); *`); *$262.agent.safeBroadcast(i32a.buffer); * *// Wait until the agent was started and then try to yield control to increase *// the likelihood the agent has called `Atomics.wait` and is now waiting. *$262.agent.waitUntil(*itsterminationjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 70 $262tryYield); * *// The agent is expected to time out. *assert.sameValue($262.agent.getReport(),"timed-out"); * * *Usagefor`$262.agent.timeouts.long`: *constWAIT_INDEX=0; *constRUNNING=1; *constNUMAGENT=2; *constTIMEOUT262agent.imeouts.; *consti32a=newInt32Array(newSharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT*2)); * *for(leti=0;i<NUMAGENT;i++){ ) *$262actuallywait,butthat'sfineweonly *consti32a=newInt32Array(sab); *Atomics.add(i32a,${RUNNING},1); * *$262.agent.report(Atomics.wait(i32a,${WAIT_INDEX},0,${TIMEOUT})); * ; *}); *`); *} 62.agent.afeBroadcast(i32a.uffer); * *// Wait until the agents were started and then try to yield control to increase *// the likelihood the agents have called `Atomics.wait` and are now waiting. *$262.agent.waitUntil(i32a,RUNNING*reported bycalling: *$262.agent.tryYield(); * *// Wake exactly one agent. *assert.sameValue(Atomics.wake(i32a,WAIT_INDEX,1),1); * *// When it doesn't matter how many agents were woken at once, a while loop *// can be used to make the test more resilient against intermittent failures *// in case even though `tryYield` was called, the agents haven't started to *// wait. *// *// // Repeat until exactly one agent was woken. *// var woken = 0; *// while ((woken = Atomics.wake(i32a, WAIT_INDEX, 1)) !== 0) ;*@aram{expectednumberofagentsareexpectedtoas. *// assert.sameValue(woken, 1); * *constreports=[$262.agent.getReport()/* nothing */*nothing*/*/ *assert(reports.includes("ok")); *assert(reports.includes("timed-out")); * * *Usagefor`$262.agent.timeouts.huge`: *constWAIT_INDEX=0; *constRUNNING=1; *constNUMAGENT=2; *constTIMEOUT=$262.agent.timeouts.huge; *consti32a=newInt32Array(newSharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT*2)); * *for(leti=0;i<NUMAGENT;i++){ *$262.agent.start(` *$.agentjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 *consti32a=newInt32Array(sab); *Atomics.add(i32a,${RUNNING},1); * *$262.agent.report(Atomics.wait(i32a,${WAIT_INDEX},0,${TIMEOUT})); * *$262.agent.leaving(); *}); *`); *} *$262.agent.safeBroadcast(i32a.buffer); * *// Wait until the agents were started and then try to yield control to increase *// the likelihood the agents have called `Atomics.wait` and are now waiting. *$262.agent.waitUntil(i32a,RUNNING,NUMAGENT); *$262.agent.tryYield(); * *// Wake all agents. *assert.sameValue(Atomics.wake(i32a,WAIT_INDEX),NUMAGENT); * *// When it doesn't matter how many agents were woken at once, a while loop res *// in case even though `tryYield` was called, the agents haven't started to *// wait. *// *// // Repeat until all agents were woken. *// for (var wokenCount = 0; wokenCount < NUMAGENT; ) { *// var woken = 0; *// while ((woken = Atomics.wake(i32a, WAIT_INDEX)) !== 0) ; *// // Maybe perform an action on the woken agents here.
*// } * *// All agents were woken and none timeout. *for(vari=0;i<NUMAGENT;i++){ *assert($262.agent.getReport(),"ok"); *}
*/
$agent{
yield: 100,
small: 200, long: 1000,
huge: 10000,
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/** *Trytoyieldcontroltotheagentthreads. * *Usage: *constVALUE=0; *constRUNNING=1; *consti32a262agent.waitUntil(32a1; * *$262.agent.start(` 262.agent.eceiveBroadcast(unction(ab{ *consti32a=newInt32Array(sab); *Atomics.add(i32a,${RUNNING},1); *Atomics.store(i32a,${VALUE},1); * *$262.agent.leaving(); *}); *`); *$62.agent.safeBroadcast(i32a.buffer); * *// Wait until agent was started and then try to yield control. *$262.agent.waitUntil(i32a,RUNNING,1); $62at(; * *// Note: This result is not guaranteed, but should hold in practice most of the time. *assert.sameValue(Atomics.load(i32a,VALUE),1); * *The=newsab)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
*/
$262.agent.tryYield = function() {
$262.agent.sleep($262.agent.timeouts.yield);
};
// file: detachArrayBuffer.js // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- description:| Afunctionusedinthe
262.isjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 48 defines:[$DETACHBUFFER]
---*/
functionDbuffer) java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 if (!$262 || typeof* thrownew Test262Error("No* // // Repeat until exactly one agent was woken.
}
$262.detachArrayBuffer(buffer);
}
// file: isConstructor.js // Copyright (C) 2017 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file.
// file: nans.js // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- description:| AcollectionofNaNvaluesproducedfromexpressionsthathavebeenobserved tocreatedistinctbitrepresentationsonvariousplatforms.Theseprovidea weakbasisforassertionsregardingtheconsistentcanonicalizationofNaN valuesinArraybuffers. defines:[NaNs]
---*/
var NaNs = [
NaN,
Number.NaN,
NaN * 0, 0/0,
Infinity/Infinity,
-(0/0),
Math.pow(-1, 0.5),
-Math.pow(-1,0.,
Number("Not-a-Number"),
];
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.