haikuwebkit/LayoutTests/js/basic-spread-expected.txt

61 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

Source/JavaScriptCore: Implement ES6 spread operator https://bugs.webkit.org/show_bug.cgi?id=122911 Reviewed by Michael Saboff. Implement the ES6 spread operator This has a little bit of refactoring to move the enumeration logic out ForOfNode and into BytecodeGenerator, and then adds the logic to make it nicely callback driven. The rest of the logic is just the addition of the SpreadExpressionNode, the parsing, and actually handling the spread. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitNewArray): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitEnumeration): * bytecompiler/BytecodeGenerator.h: * bytecompiler/NodesCodegen.cpp: (JSC::ArrayNode::emitBytecode): (JSC::ForOfNode::emitBytecode): (JSC::SpreadExpressionNode::emitBytecode): * parser/ASTBuilder.h: (JSC::ASTBuilder::createSpreadExpression): * parser/Lexer.cpp: (JSC::::lex): * parser/NodeConstructors.h: (JSC::SpreadExpressionNode::SpreadExpressionNode): * parser/Nodes.h: (JSC::ExpressionNode::isSpreadExpression): (JSC::SpreadExpressionNode::expression): * parser/Parser.cpp: (JSC::::parseArrayLiteral): (JSC::::parseArguments): (JSC::::parseMemberExpression): * parser/Parser.h: (JSC::Parser::getTokenName): (JSC::Parser::updateErrorMessageSpecialCase): * parser/ParserTokens.h: * parser/SyntaxChecker.h: (JSC::SyntaxChecker::createSpreadExpression): LayoutTests: Implement spread https://bugs.webkit.org/show_bug.cgi?id=122911 Reviewed by Michael Saboff. Add testcases * js/basic-spread-expected.txt: Added. * js/basic-spread.html: Added. * js/parser-syntax-check-expected.txt: * js/script-tests/basic-spread.js: Added. (f): (o.f.o.f.o.f.o.f.h.eval.o.h.o.h.o.h.o.h.g): * js/script-tests/parser-syntax-check.js: Canonical link: https://commits.webkit.org/141007@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-17 01:02:34 +00:00
This test checks the behavior of the spread construct.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS passedThis is o
PASS args[0] is 1
PASS args[1] is undefined
PASS args[2] is null
PASS args[3] is 4
PASS passedThis is o
PASS args[0] is 1
PASS args[1] is undefined
PASS args[2] is null
PASS args[3] is 4
PASS passedThis is o
PASS args[0] is 1
PASS args[1] is undefined
PASS args[2] is null
PASS args[3] is 4
PASS passedThis is o
PASS args[0] is 1
PASS args[1] is undefined
PASS args[2] is null
PASS args[3] is 4
PASS passedThis is o
PASS args[0] is 1
PASS args[1] is undefined
PASS args[2] is null
PASS args[3] is 4
PASS passedThis is o
PASS args[0] is 1
PASS args[1] is undefined
PASS args[2] is null
PASS args[3] is 4
PASS passedThis is o
PASS args[0] is 1
PASS args[1] is undefined
PASS args[2] is null
PASS args[3] is 4
PASS passedThis is o
PASS args[0] is 1
PASS args[1] is undefined
PASS args[2] is null
PASS args[3] is 4
PASS a is [1,2,3]
PASS [...a] is [1,2,3]
PASS [...a] is [1,2,3]
PASS [...a,...[...a]] is [1,2,3,1,2,3]
PASS [,,,...a] is [,,,1,2,3]
PASS [...a,,,].join('|') is [1,2,3,,,].join('|')
PASS [,...a,4] is [,1,2,3,4]
PASS [,...a,,5] is [,1,2,3,,5]
PASS [...a.keys()] is [0,1,2]
PASS [...a.entries()].join('|') is [[0,1],[1,2],[2,3]].join('|')
Spread operator should be performing direct "puts" and not triggering setters https://bugs.webkit.org/show_bug.cgi?id=123047 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Add a new opcode -- op_put_by_val_directue -- and make use of it in the spread to array construct. This required a new PutByValDirect node to be introduced to the DFG. The current implementation simply changes the slow path function that is called, but in future this could be made faster as it does not need to check the prototype chain. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecode): (JSC::CodeBlock::CodeBlock): * bytecode/Opcode.h: (JSC::padOpcodeName): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitDirectPutByVal): * bytecompiler/BytecodeGenerator.h: * bytecompiler/NodesCodegen.cpp: (JSC::ArrayNode::emitBytecode): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::::executeEffects): * dfg/DFGBackwardsPropagationPhase.cpp: (JSC::DFG::BackwardsPropagationPhase::propagate): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCSEPhase.cpp: (JSC::DFG::CSEPhase::getArrayLengthElimination): (JSC::DFG::CSEPhase::getByValLoadElimination): (JSC::DFG::CSEPhase::checkStructureElimination): (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination): (JSC::DFG::CSEPhase::getByOffsetLoadElimination): (JSC::DFG::CSEPhase::putByOffsetStoreElimination): (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination): (JSC::DFG::CSEPhase::performNodeCSE): * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.h: (JSC::DFG::Graph::clobbersWorld): * dfg/DFGNode.h: (JSC::DFG::Node::hasArrayMode): * dfg/DFGNodeType.h: * dfg/DFGOperations.cpp: (JSC::DFG::putByVal): (JSC::DFG::operationPutByValInternal): * dfg/DFGOperations.h: * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): (JSC::DFG::PredictionPropagationPhase::doDoubleVoting): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compileContiguousPutByVal): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGTypeCheckHoistingPhase.cpp: (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks): (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): * jit/JIT.h: (JSC::JIT::compileDirectPutByVal): * jit/JITOperations.cpp: * jit/JITOperations.h: * jit/JITPropertyAccess.cpp: (JSC::JIT::emitSlow_op_put_by_val): (JSC::JIT::privateCompilePutByVal): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emitSlow_op_put_by_val): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: LayoutTests: Add a new testcase for the setter case. run-javascriptcore-tests hits this with the llint, baseline, and dfg. * js/basic-spread-expected.txt: * js/script-tests/basic-spread.js: (Array): Canonical link: https://commits.webkit.org/141117@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-19 00:09:28 +00:00
PASS [...a] is [1,2,3]
Source/JavaScriptCore: Implement ES6 spread operator https://bugs.webkit.org/show_bug.cgi?id=122911 Reviewed by Michael Saboff. Implement the ES6 spread operator This has a little bit of refactoring to move the enumeration logic out ForOfNode and into BytecodeGenerator, and then adds the logic to make it nicely callback driven. The rest of the logic is just the addition of the SpreadExpressionNode, the parsing, and actually handling the spread. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitNewArray): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitEnumeration): * bytecompiler/BytecodeGenerator.h: * bytecompiler/NodesCodegen.cpp: (JSC::ArrayNode::emitBytecode): (JSC::ForOfNode::emitBytecode): (JSC::SpreadExpressionNode::emitBytecode): * parser/ASTBuilder.h: (JSC::ASTBuilder::createSpreadExpression): * parser/Lexer.cpp: (JSC::::lex): * parser/NodeConstructors.h: (JSC::SpreadExpressionNode::SpreadExpressionNode): * parser/Nodes.h: (JSC::ExpressionNode::isSpreadExpression): (JSC::SpreadExpressionNode::expression): * parser/Parser.cpp: (JSC::::parseArrayLiteral): (JSC::::parseArguments): (JSC::::parseMemberExpression): * parser/Parser.h: (JSC::Parser::getTokenName): (JSC::Parser::updateErrorMessageSpecialCase): * parser/ParserTokens.h: * parser/SyntaxChecker.h: (JSC::SyntaxChecker::createSpreadExpression): LayoutTests: Implement spread https://bugs.webkit.org/show_bug.cgi?id=122911 Reviewed by Michael Saboff. Add testcases * js/basic-spread-expected.txt: Added. * js/basic-spread.html: Added. * js/parser-syntax-check-expected.txt: * js/script-tests/basic-spread.js: Added. (f): (o.f.o.f.o.f.o.f.h.eval.o.h.o.h.o.h.o.h.g): * js/script-tests/parser-syntax-check.js: Canonical link: https://commits.webkit.org/141007@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-17 01:02:34 +00:00
PASS successfullyParsed is true
TEST COMPLETE