Ignore:
Timestamp:
Aug 19, 2009, 12:54:55 PM (16 years ago)
Author:
[email protected]
Message:

We probably shouldn't be keeping the AST for eval nodes around forevar.

https://bugs.webkit.org/show_bug.cgi?id=28469

Reviewed by Darin Adler.

EvalNodes don't destroyData() (delete their parser data) since they need to hold onto
their varStack. Copy a list of variable onto EvalCodeBlock, and this can go away.

  • bytecode/CodeBlock.h:

(JSC::EvalCodeBlock::variable):
(JSC::EvalCodeBlock::numVariables):
(JSC::EvalCodeBlock::adoptVariables):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):

  • parser/Nodes.h:
  • runtime/Executable.cpp:

(JSC::EvalExecutable::generateBytecode):

  • runtime/Executable.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r47412 r47519  
    403403        m_codeBlock->addFunctionDecl(adoptRef(new FunctionExecutable(function->ident(), function)));
    404404    }
     405
     406    const DeclarationStacks::VarStack& varStack = evalNode->varStack();
     407    unsigned numVariables = varStack.size();
     408    Vector<Identifier> variables;
     409    variables.reserveCapacity(numVariables);
     410    for (size_t i = 0; i < numVariables; ++i)
     411        variables.append(varStack[i].first);
     412    codeBlock->adoptVariables(variables);
    405413
    406414    preserveLastVar();
Note: See TracChangeset for help on using the changeset viewer.