Ignore:
Timestamp:
Dec 4, 2013, 8:40:17 AM (11 years ago)
Author:
[email protected]
Message:

Move the setting up of callee's callFrame from pushFrame to callToJavaScript thunk
https://bugs.webkit.org/show_bug.cgi?id=123999

Reviewed by Filip Pizlo.

Changed LLInt and/or JIT enabled ports to allocate the stack frame in the
callToJavaScript stub. Added an additional stub, callToNativeFunction that
allocates a stack frame in a similar way for calling native entry points
that take a single ExecState* argument. These stubs are implemented
using common macros in LowLevelInterpreter{32_64,64}.asm. There are also
Windows X86 and X86-64 versions in the corresponding JitStubsXX.h.
The stubs allocate and create a sentinel frame, then create the callee's
frame, populating the header and arguments from the passed in ProtoCallFrame*.
It is assumed that the caller of either stub does a check for enough stack space
via JSStack::entryCheck().

For ports using the C-Loop interpreter, the prior method for allocating stack
frame and invoking functions is used, namely with JSStack::pushFrame() and
::popFrame().

Made spelling changes "sentinal" -> "sentinel".

(JSC::CachedCall::CachedCall):
(JSC::CachedCall::setThis):
(JSC::CachedCall::setArgument):

  • interpreter/CallFrameClosure.h:

(JSC::CallFrameClosure::resetCallFrame):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):

  • interpreter/Interpreter.h:
  • interpreter/JSStack.h:
  • interpreter/JSStackInlines.h:

(JSC::JSStack::entryCheck):
(JSC::JSStack::pushFrame):
(JSC::JSStack::popFrame):

  • interpreter/ProtoCallFrame.cpp: Added.

(JSC::ProtoCallFrame::init):

  • interpreter/ProtoCallFrame.h: Added.

(JSC::ProtoCallFrame::codeBlock):
(JSC::ProtoCallFrame::setCodeBlock):
(JSC::ProtoCallFrame::setScope):
(JSC::ProtoCallFrame::setCallee):
(JSC::ProtoCallFrame::argumentCountIncludingThis):
(JSC::ProtoCallFrame::argumentCount):
(JSC::ProtoCallFrame::setArgumentCountIncludingThis):
(JSC::ProtoCallFrame::setPaddedArgsCount):
(JSC::ProtoCallFrame::clearCurrentVPC):
(JSC::ProtoCallFrame::setThisValue):
(JSC::ProtoCallFrame::setArgument):

  • jit/JITCode.cpp:

(JSC::JITCode::execute):

  • jit/JITCode.h:
  • jit/JITOperations.cpp:
  • jit/JITStubs.h:
  • jit/JITStubsMSVC64.asm:
  • jit/JITStubsX86.h:
  • llint/LLIntOffsetsExtractor.cpp:
  • llint/LLIntThunks.h:
  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/ArgList.h:

(JSC::ArgList::data):

  • runtime/JSArray.cpp:

(JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):

  • runtime/StringPrototype.cpp:

(JSC::replaceUsingRegExpSearch):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/CallFrameClosure.h

    r148696 r160094  
    2727#define CallFrameClosure_h
    2828
     29#include "ProtoCallFrame.h"
     30
    2931namespace JSC {
    3032
    3133struct CallFrameClosure {
    3234    CallFrame* oldCallFrame;
     35#if ENABLE(LLINT_C_LOOP)
    3336    CallFrame* newCallFrame;
     37#else
     38    ProtoCallFrame* newCallFrame;
     39#endif
    3440    JSFunction* function;
    3541    FunctionExecutable* functionExecutable;
     
    5258    {
    5359        newCallFrame->setScope(scope);
     60#if ENABLE(LLINT_C_LOOP)
    5461        // setArgument() takes an arg index that starts from 0 for the first
    5562        // argument after the 'this' value. Since both argumentCountIncludingThis
    5663        // and parameterCountIncludingThis includes the 'this' value, we need to
    57         // subtract 1 from them to make i a valid argument index for setArgument().
     64        // subtract 1 from them to make it a valid argument index for setArgument().
    5865        for (int i = argumentCountIncludingThis-1; i < parameterCountIncludingThis-1; ++i)
    5966            newCallFrame->setArgument(i, jsUndefined());
     67#endif
    6068    }
    6169};
Note: See TracChangeset for help on using the changeset viewer.