Ignore:
Timestamp:
Sep 6, 2012, 12:45:35 PM (13 years ago)
Author:
[email protected]
Message:

Rolled out <http://trac.webkit.org/changeset/127698> because it broke
fast/dom/HTMLScriptElement/script-reexecution-pretty-diff.html

Named functions should not allocate scope objects for their names
https://bugs.webkit.org/show_bug.cgi?id=95659

Reviewed by Oliver Hunt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r127698 r127774  
    540540        typedef ScriptExecutable Base;
    541541
    542         static FunctionExecutable* create(JSGlobalData& globalData, FunctionBodyNode* node)
    543         {
    544             FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, node);
    545             executable->finishCreation(globalData);
     542        static FunctionExecutable* create(ExecState* exec, const Identifier& name, const Identifier& inferredName, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
     543        {
     544            FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, inferredName, source, forceUsesArguments, parameters, isInStrictContext);
     545            executable->finishCreation(exec->globalData(), name, firstLine, lastLine);
    546546            return executable;
    547547        }
    548         static FunctionExecutable* fromGlobalCode(const Identifier& name, ExecState*, Debugger*, const SourceCode&, JSObject** exception);
     548
     549        static FunctionExecutable* create(JSGlobalData& globalData, const Identifier& name, const Identifier& inferredName, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
     550        {
     551            FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, inferredName, source, forceUsesArguments, parameters, isInStrictContext);
     552            executable->finishCreation(globalData, name, firstLine, lastLine);
     553            return executable;
     554        }
    549555
    550556        static void destroy(JSCell*);
    551557
     558        JSFunction* make(ExecState* exec, JSScope* scope)
     559        {
     560            return JSFunction::create(exec, this, scope);
     561        }
     562       
    552563        // Returns either call or construct bytecode. This can be appropriate
    553564        // for answering questions that that don't vary between call and construct --
     
    698709        void clearCodeIfNotCompiling();
    699710        static void visitChildren(JSCell*, SlotVisitor&);
     711        static FunctionExecutable* fromGlobalCode(const Identifier&, ExecState*, Debugger*, const SourceCode&, JSObject** exception);
    700712        static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto)
    701713        {
     
    710722
    711723    protected:
    712         void finishCreation(JSGlobalData& globalData)
     724        void finishCreation(JSGlobalData& globalData, const Identifier& name, int firstLine, int lastLine)
    713725        {
    714726            Base::finishCreation(globalData);
    715             m_nameValue.set(globalData, this, jsString(&globalData, name().ustring()));
     727            m_firstLine = firstLine;
     728            m_lastLine = lastLine;
     729            m_nameValue.set(globalData, this, jsString(&globalData, name.ustring()));
    716730        }
    717731
    718732    private:
    719         FunctionExecutable(JSGlobalData&, FunctionBodyNode*);
     733        FunctionExecutable(JSGlobalData&, const Identifier& name, const Identifier& inferredName, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool);
     734        FunctionExecutable(ExecState*, const Identifier& name, const Identifier& inferredName, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool);
    720735
    721736        JSObject* compileForCallInternal(ExecState*, JSScope*, JITCode::JITType, unsigned bytecodeIndex = UINT_MAX);
Note: See TracChangeset for help on using the changeset viewer.