[Webkit-unassigned] [Bug 169832] [JSC] Remove unnecessary condition from needsDerivedConstructorInArrowFunctionLexicalEnvironment in BytecodeGenerator.cpp

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Mar 18 09:08:21 PDT 2017


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

Mark Lam <mark.lam at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #304865|review?, commit-queue?      |review+, commit-queue-
              Flags|                            |

--- Comment #5 from Mark Lam <mark.lam at apple.com> ---
Comment on attachment 304865
  --> https://bugs.webkit.org/attachment.cgi?id=304865
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=304865&action=review

> Source/JavaScriptCore/ChangeLog:10
> +        isConstructor.

I think you mean "isClassContext" here.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1031
> -    if ((isConstructor() && constructorKind() == ConstructorKind::Extends) || m_codeBlock->isClassContext()) {
> -        if (isSuperUsedInInnerArrowFunction())
> -            return true;
> -    }
> -    return false;
> +    return m_codeBlock->isClassContext() && isSuperUsedInInnerArrowFunction();

I understand that m_codeBlock->isClassContext() means that "executable->superBinding() == SuperBinding::Needed", and that in turn is true because we set "expectedSuperBinding = m_defaultConstructorKind == ConstructorKind::Extends ? SuperBinding::Needed : SuperBinding::NotNeeded".  However, this relationship is a few steps removed.  Can you add an assert before this so that the relationship doesn't change without us noticing?
    ASSERT(m_codeBlock->isClassContext() || !(isConstructor() && constructorKind() == ConstructorKind::Extends));

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170318/4ff934b7/attachment.html>


More information about the webkit-unassigned mailing list