Ignore:
Timestamp:
Feb 27, 2014, 3:25:29 PM (11 years ago)
Author:
[email protected]
Message:

Slow cases for function.apply and function.call should not require vm re-entry
https://bugs.webkit.org/show_bug.cgi?id=129454

Reviewed by Geoffrey Garen.

Implement call and apply using builtins. Happily the use
of @call and @apply don't perform function equality checks
and just plant direct var_args calls. This did expose a few
codegen issues, but they're all covered by existing tests
once call and apply are implemented in JS.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • builtins/Function.prototype.js: Added.

(call):
(apply):

  • bytecompiler/NodesCodegen.cpp:

(JSC::CallFunctionCallDotNode::emitBytecode):
(JSC::ApplyFunctionCallDotNode::emitBytecode):

  • dfg/DFGCapabilities.cpp:

(JSC::DFG::capabilityLevel):

  • interpreter/Interpreter.cpp:

(JSC::sizeFrameForVarargs):
(JSC::loadVarargs):

  • interpreter/Interpreter.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileLoadVarargs):

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::makeFunctionCallNode):

  • parser/Lexer.cpp:

(JSC::isSafeBuiltinIdentifier):

  • runtime/CommonIdentifiers.h:
  • runtime/FunctionPrototype.cpp:

(JSC::FunctionPrototype::addFunctionProperties):

  • runtime/JSObject.cpp:

(JSC::JSObject::putDirectBuiltinFunction):
(JSC::JSObject::putDirectBuiltinFunctionWithoutTransition):

  • runtime/JSObject.h:
File:
1 edited

Legend:

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

    r163960 r164835  
    6464    macro(add) \
    6565    macro(anonymous) \
    66     macro(apply) \
    6766    macro(arguments) \
    6867    macro(bind) \
     
    7473    macro(bytecodes) \
    7574    macro(bytecodesID) \
    76     macro(call) \
    7775    macro(callee) \
    7876    macro(caller) \
     
    208206
    209207#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
    210     macro(apply) \
    211     macro(call) \
    212208    macro(iterator) \
    213209    macro(iteratorNext) \
Note: See TracChangeset for help on using the changeset viewer.