Ignore:
Timestamp:
Mar 7, 2012, 2:18:43 AM (13 years ago)
Author:
[email protected]
Message:

Parser: Inline ScopeNodeData into ScopeNode
https://bugs.webkit.org/show_bug.cgi?id=79776

Reviewed by Geoffrey Garen.

It used to be that some ScopeNode members were kept in a separate
structure because sometimes they wouldn't be needed, and
allocating a ParserArena was expensive. This patch makes
ParserArena lazily allocate its IdentifierArena, allowing the
members to be included directly, which is simpler and easier to
reason about.

  • parser/ParserArena.cpp:

(JSC::ParserArena::ParserArena):
(JSC::ParserArena::reset):
(JSC::ParserArena::isEmpty):

  • parser/ParserArena.h:

(JSC::ParserArena::identifierArena): Lazily allocate the
IdentifierArena.

  • parser/Nodes.cpp:

(JSC::ScopeNode::ScopeNode):
(JSC::ScopeNode::singleStatement):
(JSC::ProgramNode::create):
(JSC::EvalNode::create):
(JSC::FunctionBodyNode::create):

  • parser/Nodes.h:

(JSC::ScopeNode::destroyData):
(JSC::ScopeNode::needsActivationForMoreThanVariables):
(JSC::ScopeNode::needsActivation):
(JSC::ScopeNode::hasCapturedVariables):
(JSC::ScopeNode::capturedVariableCount):
(JSC::ScopeNode::captures):
(JSC::ScopeNode::varStack):
(JSC::ScopeNode::functionStack):
(JSC::ScopeNode::neededConstants):
(ScopeNode):

  • bytecompiler/NodesCodegen.cpp:

(JSC::ScopeNode::emitStatementsBytecode): Inline ScopeNodeData
into ScopeNode. Adapt accessors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r109007 r110039  
    20182018inline void ScopeNode::emitStatementsBytecode(BytecodeGenerator& generator, RegisterID* dst)
    20192019{
    2020     if (m_data->m_statements)
    2021         m_data->m_statements->emitBytecode(generator, dst);
     2020    if (m_statements)
     2021        m_statements->emitBytecode(generator, dst);
    20222022}
    20232023
Note: See TracChangeset for help on using the changeset viewer.