Let's rename FunctionBodyNode
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Aug 2015 20:24:35 +0000 (20:24 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Aug 2015 20:24:35 +0000 (20:24 +0000)
commitb5c12c0b0923c76ec58d02cde5e38a375d76594e
tree37be795e8db5ce457157a38446e4ed9fbfafe246
parent92588042d1c585ce866afb84164c467305e4270a
Let's rename FunctionBodyNode
https://bugs.webkit.org/show_bug.cgi?id=147292

Reviewed by Mark Lam & Saam Barati.

FunctionBodyNode => FunctionMetadataNode

Make FunctionMetadataNode inherit from Node instead of StatementNode
because a FunctionMetadataNode can appear in expression context and does
not have a next statement.

(I decided to continue allocating FunctionMetadataNode in the AST arena,
and to retain "Node" in its name, because it really is a parsing
construct, and we transform its data before consuming it elsewhere.

There is still room for a future patch to distill and simplify the
metadata we track about functions between FunDeclNode/FuncExprNode,
FunctionMetadataNode, and UnlinkedFunctionExecutable. But this is a start.)

* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutableInternal):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::generateFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedCodeBlock.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitNewArray):
(JSC::BytecodeGenerator::emitNewFunction):
(JSC::BytecodeGenerator::emitNewFunctionExpression):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::makeFunction):
* bytecompiler/NodesCodegen.cpp:
(JSC::EvalNode::emitBytecode):
(JSC::FunctionNode::emitBytecode):
(JSC::FunctionBodyNode::emitBytecode): Deleted.
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionExpr):
(JSC::ASTBuilder::createFunctionBody):
* parser/NodeConstructors.h:
(JSC::FunctionParameters::FunctionParameters):
(JSC::FuncExprNode::FuncExprNode):
(JSC::FuncDeclNode::FuncDeclNode):
* parser/Nodes.cpp:
(JSC::EvalNode::EvalNode):
(JSC::FunctionMetadataNode::FunctionMetadataNode):
(JSC::FunctionMetadataNode::finishParsing):
(JSC::FunctionMetadataNode::setEndPosition):
(JSC::FunctionBodyNode::FunctionBodyNode): Deleted.
(JSC::FunctionBodyNode::finishParsing): Deleted.
(JSC::FunctionBodyNode::setEndPosition): Deleted.
* parser/Nodes.h:
(JSC::FuncExprNode::body):
(JSC::FuncDeclNode::body):
* parser/Parser.h:
(JSC::Parser::isFunctionMetadataNode):
(JSC::Parser::next):
(JSC::Parser<LexerType>::parse):
(JSC::Parser::isFunctionBodyNode): Deleted.
* runtime/CodeCache.cpp:
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/CodeCache.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
Source/JavaScriptCore/parser/ASTBuilder.h
Source/JavaScriptCore/parser/NodeConstructors.h
Source/JavaScriptCore/parser/Nodes.cpp
Source/JavaScriptCore/parser/Nodes.h
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/parser/Parser.h
Source/JavaScriptCore/parser/SyntaxChecker.h
Source/JavaScriptCore/runtime/CodeCache.cpp
Source/JavaScriptCore/runtime/CodeCache.h