Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test262
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmaksimo
test262
Commits
7ec0cdba
Commit
7ec0cdba
authored
6 years ago
by
Rick Waldron
Browse files
Options
Downloads
Patches
Plain Diff
Atomics: more fixes for review
parent
84f448f0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/built-ins/Atomics/and/expected-return-value.js
+8
-6
8 additions, 6 deletions
test/built-ins/Atomics/and/expected-return-value.js
test/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js
+14
-11
14 additions, 11 deletions
...ins/Atomics/wait/waiterlist-block-indexedposition-wake.js
with
22 additions
and
17 deletions
test/built-ins/Atomics/and/expected-return-value.js
+
8
−
6
View file @
7ec0cdba
...
...
@@ -29,14 +29,16 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
var
buffer
=
new
SharedArrayBuffer
(
Int32Array
.
BYTES_PER_ELEMENT
);
var
i32a
=
new
Int32Array
(
buffer
);
var
value
=
0b00000001000000001000000010000001
;
var
initial
=
0b00000001000000001000000010000001
;
var
other
=
0b00000001111111111000000011111111
;
var
anded
=
0b00000001000000001000000010000001
;
i32a
[
0
]
=
value
;
i32a
[
0
]
=
initial
;
assert
.
sameValue
(
Atomics
.
and
(
i32a
,
0
,
value
),
value
,
'
Atomics.and(i32a, 0,
value
) equals the value of
value
(0b00000001000000001000000010000001)
'
Atomics
.
and
(
i32a
,
0
,
other
),
initial
,
'
Atomics.and(i32a, 0,
other
) equals the value of
`initial`
(0b00000001000000001000000010000001)
'
);
assert
.
sameValue
(
i32a
[
0
],
value
&
other
,
'
The value of i32a[0] is value & other
'
);
assert
.
sameValue
(
i32a
[
0
],
anded
,
'
The value of i32a[0] equals the value of `anded` (0b00000001000000001000000010000001)
'
);
This diff is collapsed.
Click to expand it.
test/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js
+
14
−
11
View file @
7ec0cdba
...
...
@@ -27,8 +27,7 @@ $262.agent.start(`
const i32a = new Int32Array(sab);
// Wait on index 0
Atomics.wait(i32a, 0, 0, 200);
$262.agent.report(0);
$262.agent.report(Atomics.wait(i32a, 0, 0, Infinity));
$262.agent.leaving();
});
`
);
...
...
@@ -38,23 +37,27 @@ $262.agent.start(`
const i32a = new Int32Array(sab);
// Wait on index 2
Atomics.wait(i32a, 2, 0, 200);
$262.agent.report(2);
$262.agent.report(Atomics.wait(i32a, 2, 0, Infinity));
$262.agent.leaving();
});
`
);
const
i32a
=
new
Int32Array
(
new
SharedArrayBuffer
(
4
*
Int32Array
.
BYTES_PER_ELEMENT
)
new
SharedArrayBuffer
(
Int32Array
.
BYTES_PER_ELEMENT
*
4
)
);
$262
.
agent
.
broadcast
(
i32a
.
buffer
);
$262
.
agent
.
sleep
(
10
);
// Wake index 2
Atomics
.
wake
(
i32a
,
2
,
1
);
assert
.
sameValue
(
getReport
(),
'
2
'
);
// Wake index 1, wakes nothing
assert
.
sameValue
(
Atomics
.
wake
(
i32a
,
1
),
0
,
'
Atomics.wake(i32a, 1) returns 0
'
);
// Wake index 3, wakes nothing
assert
.
sameValue
(
Atomics
.
wake
(
i32a
,
3
),
0
,
'
Atomics.wake(i32a, 3) returns 0
'
);
// Wake index 0
Atomics
.
wake
(
i32a
,
0
,
1
);
assert
.
sameValue
(
getReport
(),
'
0
'
);
// Wake index 2, wakes 1
assert
.
sameValue
(
Atomics
.
wake
(
i32a
,
2
),
1
,
'
Atomics.wake(i32a, 2) returns 1
'
);
assert
.
sameValue
(
getReport
(),
'
ok
'
,
'
getReport() returns "ok"
'
);
// Wake index 0, wakes 1
assert
.
sameValue
(
Atomics
.
wake
(
i32a
,
0
),
1
,
'
Atomics.wake(i32a, 0) returns 1
'
);
assert
.
sameValue
(
getReport
(),
'
ok
'
,
'
getReport() returns "ok"
'
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment