зеркало из https://github.com/mozilla/gecko-dev.git
Bug 933001 - Part 4/5 - Add SharedArrayBuffer tests.
This commit is contained in:
Родитель
8e4c7b954b
Коммит
6861540eca
|
@ -0,0 +1,10 @@
|
|||
// Don't assert.
|
||||
function $(stdlib, foreign, heap) {
|
||||
"use asm";
|
||||
var Float64ArrayView = new stdlib.Float64Array(heap);
|
||||
function f() {}
|
||||
return f
|
||||
}
|
||||
|
||||
if (typeof SharedArrayBuffer !== "undefined")
|
||||
$(this, {}, new SharedArrayBuffer(4096));
|
|
@ -0,0 +1,10 @@
|
|||
// Test tracing of a single linked ArrayBufferViewObject.
|
||||
|
||||
function f() {
|
||||
var x = new SharedArrayBuffer(0x1000);
|
||||
var y = new Int32Array(x);
|
||||
gc();
|
||||
}
|
||||
|
||||
if (typeof SharedArrayBuffer !== "undefined")
|
||||
f();
|
|
@ -0,0 +1,11 @@
|
|||
// Test tracing of two views of a SharedArrayBuffer. Uses a different path.
|
||||
|
||||
function f() {
|
||||
var x = new SharedArrayBuffer(0x1000);
|
||||
var y = new Int32Array(x);
|
||||
var z = new Int8Array(x);
|
||||
gc();
|
||||
}
|
||||
|
||||
if (typeof SharedArrayBuffer !== "undefined")
|
||||
f();
|
|
@ -0,0 +1,12 @@
|
|||
// Test that the SharedArrayBuffer memory is properly zeroed.
|
||||
|
||||
function f() {
|
||||
var x = new SharedArrayBuffer(4096);
|
||||
var y = new Int32Array(x);
|
||||
assertEq(y[0], 0);
|
||||
assertEq(y[1], 0);
|
||||
assertEq(y[1023], 0);
|
||||
}
|
||||
|
||||
if (typeof SharedArrayBuffer !== "undefined")
|
||||
f();
|
Загрузка…
Ссылка в новой задаче