Ignore:
Timestamp:
Dec 6, 2015, 5:54:43 PM (10 years ago)
Author:
[email protected]
Message:

REGRESSION(r193584): Causes heap use-after-free crashes in Web Inspector tests with AddressSanitizer (Requested by ddkilzer on #webkit).
https://bugs.webkit.org/show_bug.cgi?id=151929

Reverted changeset:

"[ES6] "super" and "this" should be lexically bound inside an
arrow function and should live in a JSLexicalEnvironment"
https://bugs.webkit.org/show_bug.cgi?id=149338
http://trac.webkit.org/changeset/193584

File:
1 edited

Legend:

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

    r193584 r193606  
    345345    bool usesArguments() const { return m_features & ArgumentsFeature; }
    346346    bool needsActivation() const { return m_hasCapturedVariables || m_features & (EvalFeature | WithFeature); }
    347     bool isArrowFunctionContext() const { return m_isArrowFunctionContext; }
    348347    bool isStrictMode() const { return m_features & StrictModeFeature; }
    349     bool isDerivedConstructorContext() const { return m_isDerivedConstructorContext; }
    350348    ECMAMode ecmaMode() const { return isStrictMode() ? StrictMode : NotStrictMode; }
    351349       
     
    396394
    397395protected:
    398     ScriptExecutable(Structure*, VM&, const SourceCode&, bool isInStrictContext, bool isInDerivedConstructorContext, bool isInArrowFunctionContext);
     396    ScriptExecutable(Structure* structure, VM& vm, const SourceCode& source, bool isInStrictContext);
    399397
    400398    void finishCreation(VM& vm)
     
    415413    bool m_neverOptimize { false };
    416414    bool m_didTryToEnterInLoop;
    417     bool m_isDerivedConstructorContext;
    418     bool m_isArrowFunctionContext;
    419415    int m_overrideLineNumber;
    420416    int m_firstLine;
     
    439435    }
    440436
    441     static EvalExecutable* create(ExecState*, const SourceCode&, bool isInStrictContext, ThisTDZMode, bool isDerivedConstructorContext, bool isArrowFunctionContext, const VariableEnvironment*);
     437    static EvalExecutable* create(ExecState*, const SourceCode&, bool isInStrictContext, ThisTDZMode, const VariableEnvironment*);
    442438
    443439    PassRefPtr<JITCode> generatedJITCode()
     
    453449    DECLARE_INFO;
    454450
    455 
    456     ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, isDerivedConstructorContext(), isArrowFunctionContext()); }
     451    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ProgramMode); }
    457452
    458453    unsigned numVariables() { return m_unlinkedEvalCodeBlock->numVariables(); }
     
    462457    friend class ExecutableBase;
    463458    friend class ScriptExecutable;
    464     EvalExecutable(ExecState*, const SourceCode&, bool inStrictContext, bool isDerivedConstructorContext, bool isArrowFunctionContext);
     459    EvalExecutable(ExecState*, const SourceCode&, bool);
    465460
    466461    static void visitChildren(JSCell*, SlotVisitor&);
     
    507502    DECLARE_INFO;
    508503
    509     ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, isDerivedConstructorContext(), false); }
     504    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ProgramMode); }
    510505
    511506private:
     
    548543    DECLARE_INFO;
    549544
    550     ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ModuleEvaluateMode, isDerivedConstructorContext(), false); }
    551 
     545    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, GeneratorThisMode::NonEmpty, SuperBinding::NotNeeded, SourceParseMode::ModuleEvaluateMode); }
    552546    UnlinkedModuleProgramCodeBlock* unlinkedModuleProgramCodeBlock() { return m_unlinkedModuleProgramCodeBlock.get(); }
    553547
     
    657651    bool isBuiltinFunction() const { return m_unlinkedExecutable->isBuiltinFunction(); }
    658652    ConstructAbility constructAbility() const { return m_unlinkedExecutable->constructAbility(); }
    659     // TODO:Think about avoid using isArrowFunction veriabl
    660     bool isArrowFunction() const { return parseMode() == SourceParseMode::ArrowFunctionMode; }
    661     bool isDerivedConstructorContext() const { return m_unlinkedExecutable->isDerivedConstructorContext(); }
    662653    bool isClassConstructorFunction() const { return m_unlinkedExecutable->isClassConstructorFunction(); }
    663654    const Identifier& name() { return m_unlinkedExecutable->name(); }
     
    666657    size_t parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'!
    667658    SourceParseMode parseMode() const { return m_unlinkedExecutable->parseMode(); }
     659    bool isArrowFunction() const { return parseMode() == SourceParseMode::ArrowFunctionMode; }
    668660
    669661    static void visitChildren(JSCell*, SlotVisitor&);
Note: See TracChangeset for help on using the changeset viewer.