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

Side by Side Diff: test/test262/harness-agent.js

Issue 2733843002: test262 roll (Closed)
Patch Set: in a comment, s/gn/gyp Created 3 years, 9 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 | « test/test262/harness-adapt.js ('k') | test/test262/list.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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 $.agent = (function () { 5 $262.agent = (function () {
6 6
7 var workers = []; 7 var workers = [];
8 var i32a = null; 8 var i32a = null;
9 var pendingReports = []; 9 var pendingReports = [];
10 10
11 // Agents call Atomics.wait on this location to sleep. 11 // Agents call Atomics.wait on this location to sleep.
12 var SLEEP_LOC = 0; 12 var SLEEP_LOC = 0;
13 // 1 if the started worker is ready, 0 otherwise. 13 // 1 if the started worker is ready, 0 otherwise.
14 var START_LOC = 1; 14 var START_LOC = 1;
15 // The number of workers that have received the broadcast. 15 // The number of workers that have received the broadcast.
(...skipping 25 matching lines...) Expand all
41 break; 41 break;
42 42
43 case 'broadcast': 43 case 'broadcast':
44 Atomics.add(i32a, ${BROADCAST_LOC}, 1); 44 Atomics.add(i32a, ${BROADCAST_LOC}, 1);
45 broadcasts.push([msg.sab, msg.id]); 45 broadcasts.push([msg.sab, msg.id]);
46 handleBroadcast(); 46 handleBroadcast();
47 break; 47 break;
48 } 48 }
49 }; 49 };
50 50
51 var $ = { 51 var $262 = {
52 agent: { 52 agent: {
53 receiveBroadcast(receiver) { 53 receiveBroadcast(receiver) {
54 pendingReceiver = receiver; 54 pendingReceiver = receiver;
55 handleBroadcast(); 55 handleBroadcast();
56 }, 56 },
57 57
58 report(msg) { 58 report(msg) {
59 postMessage(msg); 59 postMessage(msg);
60 Atomics.add(i32a, ${WORKER_REPORT_LOC} + index, 1); 60 Atomics.add(i32a, ${WORKER_REPORT_LOC} + index, 1);
61 }, 61 },
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 return pendingReports.shift() || null; 99 return pendingReports.shift() || null;
100 }, 100 },
101 101
102 sleep(s) { Atomics.wait(i32a, SLEEP_LOC, 0, s); } 102 sleep(s) { Atomics.wait(i32a, SLEEP_LOC, 0, s); }
103 }; 103 };
104 return agent; 104 return agent;
105 105
106 })(); 106 })();
OLDNEW
« no previous file with comments | « test/test262/harness-adapt.js ('k') | test/test262/list.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698