haikuwebkit/LayoutTests/js/script-tests/dfg-int16array.js

141 lines
3.0 KiB
JavaScript
Raw Permalink Normal View History

Enable DFG on ARM/Linux again https://bugs.webkit.org/show_bug.cgi?id=192496 Reviewed by Yusuke Suzuki. JSTests: Test wasn't really skipped before moving the line with skip to the top. * stress/regress-192717.js: Source/JavaScriptCore: After changing the bytecode format DFG was disabled on all 32-bit architectures. Enable DFG now again on ARM/Linux. Do not use register r11 in compiled DFG mode since it is already used in LLInt as metadataTable register. Also clean up code since ARM traditional isn't supported anymore. * dfg/DFGOSRExit.cpp: (JSC::DFG::restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer): (JSC::DFG::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer): * jit/CallFrameShuffler.cpp: (JSC::CallFrameShuffler::CallFrameShuffler): * jit/GPRInfo.h: (JSC::GPRInfo::toIndex): * llint/LowLevelInterpreter32_64.asm: * offlineasm/arm.rb: Source/WTF: After changing the bytecode format DFG was disabled on all 32-bit architectures. Enable DFG now again on ARM/Linux. * wtf/Platform.h: Tools: After changing the bytecode format DFG was disabled on all 32-bit architectures. Enable DFG now again on ARM/Linux. Run again JIT-tests on ARM by default. * Scripts/run-jsc-stress-tests: LayoutTests: After changing the bytecode format DFG was disabled on all 32-bit architectures. Enable DFG now again on ARM/Linux. Disable tests that run out of executable memory with LLInt disabled. * js/script-tests/dfg-float32array.js: * js/script-tests/dfg-float64array.js: * js/script-tests/dfg-int16array.js: * js/script-tests/dfg-int32array-overflow-values.js: * js/script-tests/dfg-int32array.js: * js/script-tests/dfg-int8array.js: * js/script-tests/dfg-uint16array.js: * js/script-tests/dfg-uint32array.js: * js/script-tests/dfg-uint8array.js: Canonical link: https://commits.webkit.org/207852@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-11 20:41:42 +00:00
//@ noNoLLIntRunLayoutTest if $architecture == "arm"
DFG loads from signed 8-bit and 16-bit typed arrays are broken https://bugs.webkit.org/show_bug.cgi?id=75163 Source/JavaScriptCore: Reviewed by Geoffrey Garen. Added 8-bit and 16-bit signed loads. Because doing so on ARM is less trivial, I'm currently disabling Int8Array and Int16Array optimizations on ARM. * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::load8Signed): (JSC::MacroAssemblerX86Common::load16Signed): * assembler/X86Assembler.h: (JSC::X86Assembler::movswl_mr): (JSC::X86Assembler::movsbl_mr): * bytecode/PredictedType.h: (JSC::isActionableMutableArrayPrediction): * dfg/DFGNode.h: (JSC::DFG::Node::shouldSpeculateInt8Array): (JSC::DFG::Node::shouldSpeculateInt16Array): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): LayoutTests: Reviewed by Geoffrey Garen. Fixed some minor goofs in the previously comitted typed array tests, and added new ones to cover this bug. * fast/js/dfg-int16array-expected.txt: Added. * fast/js/dfg-int16array.html: Added. * fast/js/dfg-int8array-expected.txt: Added. * fast/js/dfg-int8array.html: Added. * fast/js/script-tests/dfg-float32array.js: (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): * fast/js/script-tests/dfg-int16array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): * fast/js/script-tests/dfg-int32array.js: (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): * fast/js/script-tests/dfg-int8array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): Canonical link: https://commits.webkit.org/91942@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-12-23 21:08:12 +00:00
description(
JSC testing should have complete coverage over typed array types https://bugs.webkit.org/show_bug.cgi?id=84302 Source/JavaScriptCore: Reviewed by Geoff Garen. Added Uint8ClampedArray to the set of typed arrays that are supported by jsc command-line. * JSCTypedArrayStubs.h: (JSC): * jsc.cpp: (GlobalObject::finishCreation): Tools: Reviewed by Geoff Garen. Made run-fast-jsc print something and a newline if jsc threw an exception or otherwise returned with an error code, but did not crash. * Scripts/run-fast-jsc: LayoutTests: Reviewed by Geoff Garen. Added tests for uint8 and uint16 arrays. Added a test for uint32 arrays that does not focus entirely on overflow values. Also added the typed array tests to the repertoire that can be run by run-fast-jsc. * fast/js/dfg-int16array-expected.txt: * fast/js/dfg-int8array-expected.txt: * fast/js/dfg-uint16array-expected.txt: Added. * fast/js/dfg-uint16array.html: Added. * fast/js/dfg-uint32array-expected.txt: Added. * fast/js/dfg-uint32array.html: Added. * fast/js/dfg-uint8array-expected.txt: Added. * fast/js/dfg-uint8array.html: Added. * fast/js/jsc-test-list: * fast/js/script-tests/dfg-int16array.js: * fast/js/script-tests/dfg-int8array.js: * fast/js/script-tests/dfg-uint16array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): * fast/js/script-tests/dfg-uint32array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): * fast/js/script-tests/dfg-uint8array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): Canonical link: https://commits.webkit.org/101807@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-19 00:15:29 +00:00
"This tests that int16 arrays work in the DFG."
DFG loads from signed 8-bit and 16-bit typed arrays are broken https://bugs.webkit.org/show_bug.cgi?id=75163 Source/JavaScriptCore: Reviewed by Geoffrey Garen. Added 8-bit and 16-bit signed loads. Because doing so on ARM is less trivial, I'm currently disabling Int8Array and Int16Array optimizations on ARM. * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::load8Signed): (JSC::MacroAssemblerX86Common::load16Signed): * assembler/X86Assembler.h: (JSC::X86Assembler::movswl_mr): (JSC::X86Assembler::movsbl_mr): * bytecode/PredictedType.h: (JSC::isActionableMutableArrayPrediction): * dfg/DFGNode.h: (JSC::DFG::Node::shouldSpeculateInt8Array): (JSC::DFG::Node::shouldSpeculateInt16Array): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): LayoutTests: Reviewed by Geoffrey Garen. Fixed some minor goofs in the previously comitted typed array tests, and added new ones to cover this bug. * fast/js/dfg-int16array-expected.txt: Added. * fast/js/dfg-int16array.html: Added. * fast/js/dfg-int8array-expected.txt: Added. * fast/js/dfg-int8array.html: Added. * fast/js/script-tests/dfg-float32array.js: (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): * fast/js/script-tests/dfg-int16array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): * fast/js/script-tests/dfg-int32array.js: (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): * fast/js/script-tests/dfg-int8array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): Canonical link: https://commits.webkit.org/91942@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-12-23 21:08:12 +00:00
);
function getter1(a, b) {
return a[b];
}
function setter1(a, b, c) {
a[b] = c;
}
function getter2(a, b) {
a = a.f;
return a[b];
}
function setter2(a, b, c) {
a = a.f;
a[b] = c;
}
function getter3(a, b) {
a = a.f;
b = b.f;
return a[b];
}
function setter3(a, b, c) {
a = a.f;
b = b.f;
c = c.f;
a[b] = c;
}
function getter4(p, a, b) {
var x = a.f;
var y = b.f;
if (p) {
return x[y];
} else {
return x[y + 1];
}
}
function setter4(p, a, b, c) {
var x = a.f;
var y = b.f;
var z = c.f;
if (p) {
x[y] = z;
} else {
x[y + 1] = z;
}
}
var True = true;
var Empty = "";
var getters = [
getter1,
function(a, b) { a = {f:a}; return eval(Empty + "getter2(a, b)"); },
function(a, b) { a = {f:a}; b = {f:b}; return eval(Empty + "getter3(a, b)"); },
function(a, b) { a = {f:a}; b = {f:b}; return eval(Empty + "getter4(True, a, b)"); }
];
var setters = [
setter1,
function(a, b, c) { a = {f:a}; return eval(Empty + "setter2(a, b, c)"); },
function(a, b, c) { a = {f:a}; b = {f:b}; c = {f:c}; return eval(Empty + "setter3(a, b, c)"); },
function(a, b, c) { a = {f:a}; b = {f:b}; c = {f:c}; return eval(Empty + "setter4(True, a, b, c)"); }
];
function safeGetter(a, b) {
return eval("a[\"\" + " + b + "]");
}
function safeSetter(a, b, c) {
return eval("a[\"\" + " + b + "] = c");
}
for (var si = 0; si < setters.length; ++si) {
var array = new Int16Array(101);
var checkArray = new Int16Array(101);
var indexOffset = 0;
var valueOffset = 0;
var getter = getters[gi];
var setter = setters[si];
for (var i = 0; i < 1000; ++i) {
if (i == 500) {
array = [];
checkArray = [];
}
if (i == 600)
indexOffset = 0.4;
if (i == 700)
valueOffset = 1000.5;
var a = array;
var checkA = checkArray;
var b = (i % 100) + indexOffset;
var c = (i << 8) + i + valueOffset;
if (i % 2)
c = -c;
setter(a, b, c);
safeSetter(checkA, b, c);
shouldBe("safeGetter(a, " + b + ", " + c + ")", "" + safeGetter(checkA, b, c));
DFG loads from signed 8-bit and 16-bit typed arrays are broken https://bugs.webkit.org/show_bug.cgi?id=75163 Source/JavaScriptCore: Reviewed by Geoffrey Garen. Added 8-bit and 16-bit signed loads. Because doing so on ARM is less trivial, I'm currently disabling Int8Array and Int16Array optimizations on ARM. * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::load8Signed): (JSC::MacroAssemblerX86Common::load16Signed): * assembler/X86Assembler.h: (JSC::X86Assembler::movswl_mr): (JSC::X86Assembler::movsbl_mr): * bytecode/PredictedType.h: (JSC::isActionableMutableArrayPrediction): * dfg/DFGNode.h: (JSC::DFG::Node::shouldSpeculateInt8Array): (JSC::DFG::Node::shouldSpeculateInt16Array): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): LayoutTests: Reviewed by Geoffrey Garen. Fixed some minor goofs in the previously comitted typed array tests, and added new ones to cover this bug. * fast/js/dfg-int16array-expected.txt: Added. * fast/js/dfg-int16array.html: Added. * fast/js/dfg-int8array-expected.txt: Added. * fast/js/dfg-int8array.html: Added. * fast/js/script-tests/dfg-float32array.js: (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): * fast/js/script-tests/dfg-int16array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): * fast/js/script-tests/dfg-int32array.js: (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): * fast/js/script-tests/dfg-int8array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): Canonical link: https://commits.webkit.org/91942@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-12-23 21:08:12 +00:00
}
}
for (var gi = 0; gi < getters.length; ++gi) {
var array = new Int16Array(101);
var indexOffset = 0;
var valueOffset = 0;
var getter = getters[gi];
var setter = setters[si];
for (var i = 0; i < 1000; ++i) {
if (i == 500)
array = [];
if (i == 600)
indexOffset = 0.4;
if (i == 700)
valueOffset = 1000.5;
var a = array;
var b = (i % 100) + indexOffset;
var c = (i << 8) + i + valueOffset;
if (i % 2)
c = -c;
safeSetter(a, b, c);
shouldBe("getter(a, " + b + ", " + c + ")", "" + safeGetter(a, b, c));
DFG loads from signed 8-bit and 16-bit typed arrays are broken https://bugs.webkit.org/show_bug.cgi?id=75163 Source/JavaScriptCore: Reviewed by Geoffrey Garen. Added 8-bit and 16-bit signed loads. Because doing so on ARM is less trivial, I'm currently disabling Int8Array and Int16Array optimizations on ARM. * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::load8Signed): (JSC::MacroAssemblerX86Common::load16Signed): * assembler/X86Assembler.h: (JSC::X86Assembler::movswl_mr): (JSC::X86Assembler::movsbl_mr): * bytecode/PredictedType.h: (JSC::isActionableMutableArrayPrediction): * dfg/DFGNode.h: (JSC::DFG::Node::shouldSpeculateInt8Array): (JSC::DFG::Node::shouldSpeculateInt16Array): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): LayoutTests: Reviewed by Geoffrey Garen. Fixed some minor goofs in the previously comitted typed array tests, and added new ones to cover this bug. * fast/js/dfg-int16array-expected.txt: Added. * fast/js/dfg-int16array.html: Added. * fast/js/dfg-int8array-expected.txt: Added. * fast/js/dfg-int8array.html: Added. * fast/js/script-tests/dfg-float32array.js: (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): * fast/js/script-tests/dfg-int16array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): * fast/js/script-tests/dfg-int32array.js: (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): * fast/js/script-tests/dfg-int8array.js: Added. (getter1): (setter1): (getter2): (setter2): (getter3): (setter3): (getter4): (setter4): (getters.getter1.a): (.a): (setters.setter1.a): (safeGetter): (safeSetter): Canonical link: https://commits.webkit.org/91942@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-12-23 21:08:12 +00:00
}
}