Ignore:
Timestamp:
Oct 17, 2018, 4:56:56 PM (7 years ago)
Author:
[email protected]
Message:

The parser should not emit a ApplyFunctionCallDotNode for Reflect.apply.
https://bugs.webkit.org/show_bug.cgi?id=190671
<rdar://problem/45201145>

Reviewed by Saam Barati.

The bytecode generator does not currently know how to inline Reflect.apply (see
https://bugs.webkit.org/show_bug.cgi?id=190668). Hence, it's a waste of time to
emit the ApplyFunctionCallDotNode since the function check against Function.apply
that it will generate will always fail.

Also fixed CallVariant::dump() to be able to handle dumping a non-executable
callee. Reflect.apply used to trip this up. Any object with an apply property
invoked as a function could also trip this up. This is now fixed.

  • bytecode/CallVariant.cpp:

(JSC::CallVariant::dump const):

  • bytecompiler/NodesCodegen.cpp:

(JSC::ApplyFunctionCallDotNode::emitBytecode):

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::makeFunctionCallNode):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r236161 r237241  
    14441444    if (emitCallCheck) {
    14451445        makeFunction();
     1446        ASSERT(!m_base->isResolveNode() || static_cast<ResolveNode*>(m_base)->identifier() != "Reflect");
    14461447        generator.emitJumpIfNotFunctionApply(function.get(), realCall.get());
    14471448    }
Note: See TracChangeset for help on using the changeset viewer.