haikuwebkit/LayoutTests/js/dfg-new-array-double-const-...

10 lines
294 B
Plaintext
Raw Permalink Normal View History

DFG FixupPhase should insert Int32ToDouble nodes for number uses in NewArray, and SpeculativeJIT 64-bit should not try to coerce integer constants to double constants https://bugs.webkit.org/show_bug.cgi?id=119528 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Either of the two fixes would solve the crash I saw. Basically, for best performance, we want the DFG register allocator to track double uses and non-double uses of a node separately, and we accomplish this by inserting Int32ToDouble nodes in the FixupPhase. But even if FixupPhase fails to do this, we still want the DFG register allocator to do the right thing: if it encounters a double use of an integer, it should perform a conversion and preserve the original format of the value (namely, that it was an integer). For constants, the best format to preserve is None, so that future integer uses rematerialize the int from scratch. This only affects the 64-bit backend; the 32-bit backend was already doing the right thing. This also fixes some more debug dumping code, and adds some stronger assertions for integer arrays. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finalizeUnconditionally): * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): * runtime/JSObject.h: (JSC::JSObject::getIndexQuickly): (JSC::JSObject::tryGetIndexQuickly): LayoutTests: * fast/js/dfg-new-array-double-const-then-int-const.html: Added. * fast/js/dfg-new-array-double-const-then-int-const-expected.txt: Added. * fast/js/jsc-test-list: * fast/js/script-tests/dfg-new-array-double-const-then-int-const.js: Added. (bar): (foo): Canonical link: https://commits.webkit.org/137491@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153778 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-07 04:04:50 +00:00
Tests what happens when you have a NewArray that uses an integer constant as a double constant, and then that constant is subsequently used as an integer constant.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Passed some tests silently.
TEST COMPLETE