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

Side by Side Diff: test/mjsunit/harmony/futex.js

Issue 2659083004: [SAB] Fix crash in Atomics.wake w/ infinite count. (Closed)
Patch Set: fix Created 3 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
« no previous file with comments | « src/runtime/runtime-futex.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Flags: --allow-natives-syntax --harmony-sharedarraybuffer 5 // Flags: --allow-natives-syntax --harmony-sharedarraybuffer
6 6
7 (function TestFailsWithNonSharedArray() { 7 (function TestFailsWithNonSharedArray() {
8 var ab = new ArrayBuffer(16); 8 var ab = new ArrayBuffer(16);
9 9
10 var i8a = new Int8Array(ab); 10 var i8a = new Int8Array(ab);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 (function TestWaitNotAllowed() { 98 (function TestWaitNotAllowed() {
99 %SetAllowAtomicsWait(false); 99 %SetAllowAtomicsWait(false);
100 var i32a = new Int32Array(new SharedArrayBuffer(16)); 100 var i32a = new Int32Array(new SharedArrayBuffer(16));
101 assertThrows(function() { 101 assertThrows(function() {
102 Atomics.wait(i32a, 0, 0, -1); 102 Atomics.wait(i32a, 0, 0, -1);
103 }); 103 });
104 %SetAllowAtomicsWait(true); 104 %SetAllowAtomicsWait(true);
105 })(); 105 })();
106 106
107 (function TestWakePositiveInfinity() {
108 var i32a = new Int32Array(new SharedArrayBuffer(16));
109 Atomics.wake(i32a, 0, Number.POSITIVE_INFINITY);
110 })();
111
107 //// WORKER ONLY TESTS 112 //// WORKER ONLY TESTS
108 113
109 if (this.Worker) { 114 if (this.Worker) {
110 115
111 var TestWaitWithTimeout = function(timeout) { 116 var TestWaitWithTimeout = function(timeout) {
112 var sab = new SharedArrayBuffer(16); 117 var sab = new SharedArrayBuffer(16);
113 var i32a = new Int32Array(sab); 118 var i32a = new Int32Array(sab);
114 119
115 var workerScript = 120 var workerScript =
116 `onmessage = function(msg) { 121 `onmessage = function(msg) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // Finally wake the last waiter. 226 // Finally wake the last waiter.
222 assertEquals(1, Atomics.wake(i32a, 4, 1)); 227 assertEquals(1, Atomics.wake(i32a, 4, 1));
223 assertEquals("ok", workers[waitingId].getMessage()); 228 assertEquals("ok", workers[waitingId].getMessage());
224 workers[waitingId].terminate(); 229 workers[waitingId].terminate();
225 230
226 assertEquals(0, %AtomicsNumWaitersForTesting(i32a, 4)); 231 assertEquals(0, %AtomicsNumWaitersForTesting(i32a, 4));
227 232
228 })(); 233 })();
229 234
230 } 235 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-futex.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698