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/interpreter/Interpreter.cpp

    r47412 r47519  
    837837        BatchedTransitionOptimizer optimizer(variableObject);
    838838
    839         const DeclarationStacks::VarStack& varStack = static_cast<EvalExecutable*>(codeBlock->ownerExecutable())->varStack();
    840         DeclarationStacks::VarStack::const_iterator varStackEnd = varStack.end();
    841         for (DeclarationStacks::VarStack::const_iterator it = varStack.begin(); it != varStackEnd; ++it) {
    842             const Identifier& ident = (*it).first;
     839        unsigned numVariables = codeBlock->numVariables();
     840        for (unsigned i = 0; i < numVariables; ++i) {
     841            const Identifier& ident = codeBlock->variable(i);
    843842            if (!variableObject->hasProperty(callFrame, ident)) {
    844843                PutPropertySlot slot;
Note: See TracChangeset for help on using the changeset viewer.