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/bytecompiler/NodesCodegen.cpp

    r164738 r164835  
    2929#include "NodeConstructors.h"
    3030
     31#include "BuiltinNames.h"
    3132#include "BytecodeGenerator.h"
    3233#include "CallFrame.h"
     
    550551    bool emitCallCheck = !generator.isBuiltinFunction();
    551552    if (emitCallCheck) {
    552         function = generator.emitGetById(generator.tempDestination(dst), base.get(), generator.propertyNames().call);
     553        function = generator.emitGetById(generator.tempDestination(dst), base.get(), generator.propertyNames().builtinNames().callPublicName());
    553554        generator.emitJumpIfNotFunctionCall(function.get(), realCall.get());
    554555    }
     
    621622    bool emitCallCheck = !generator.isBuiltinFunction();
    622623    if (emitCallCheck) {
    623         function = generator.emitGetById(generator.tempDestination(dst), base.get(), generator.propertyNames().apply);
     624        function = generator.emitGetById(generator.tempDestination(dst), base.get(), generator.propertyNames().builtinNames().applyPublicName());
    624625        generator.emitJumpIfNotFunctionApply(function.get(), realCall.get());
    625626    }
Note: See TracChangeset for help on using the changeset viewer.