Ignore:
Timestamp:
Dec 5, 2013, 12:33:35 PM (11 years ago)
Author:
[email protected]
Message:

Make the C Loop LLINT work with callToJavaScript.
https://bugs.webkit.org/show_bug.cgi?id=125294.

Reviewed by Michael Saboff.

  1. Changed the C Loop LLINT to dispatch to an Executable via its JITCode instance which is consistent with how the ASM LLINT works.
  2. Changed CLoop::execute() to take an Opcode instead of an OpcodeID. This makes it play nice with the use of JITCode for dispatching.
  3. Introduce a callToJavaScript and callToNativeFunction for the C Loop LLINT. These will call JSStack::pushFrame() and popFrame() to setup and teardown the CallFrame.
  4. Also introduced a C Loop returnFromJavaScript which is just a replacement for ctiOpThrowNotCaught which had the same function.
  5. Remove a lot of #if ENABLE(LLINT_C_LOOP) code now that the dispatch mechanism is consistent.

This patch has been tested with both configurations of COMPUTED_GOTOs
on and off.

  • interpreter/CachedCall.h:

(JSC::CachedCall::CachedCall):
(JSC::CachedCall::call):
(JSC::CachedCall::setArgument):

  • interpreter/CallFrameClosure.h:

(JSC::CallFrameClosure::setThis):
(JSC::CallFrameClosure::setArgument):
(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::pushFrame):

  • interpreter/ProtoCallFrame.h:

(JSC::ProtoCallFrame::scope):
(JSC::ProtoCallFrame::callee):
(JSC::ProtoCallFrame::thisValue):
(JSC::ProtoCallFrame::argument):
(JSC::ProtoCallFrame::setArgument):

  • jit/JITCode.cpp:

(JSC::JITCode::execute):

  • jit/JITCode.h:
  • jit/JITExceptions.cpp:

(JSC::genericUnwind):

  • llint/LLIntCLoop.cpp:

(JSC::LLInt::CLoop::initialize):

  • llint/LLIntCLoop.h:
  • llint/LLIntEntrypoint.cpp:

(JSC::LLInt::setFunctionEntrypoint):
(JSC::LLInt::setEvalEntrypoint):
(JSC::LLInt::setProgramEntrypoint):

  • Inverted the check for vm.canUseJIT(). This allows the JIT case to be #if'd out nicely when building the C Loop LLINT.
  • llint/LLIntOpcode.h:
  • llint/LLIntThunks.cpp:

(JSC::doCallToJavaScript):
(JSC::executeJS):
(JSC::callToJavaScript):
(JSC::executeNative):
(JSC::callToNativeFunction):

  • llint/LLIntThunks.h:
  • llint/LowLevelInterpreter.cpp:

(JSC::CLoop::execute):

  • runtime/Executable.h:

(JSC::ExecutableBase::offsetOfNumParametersFor):
(JSC::ExecutableBase::hostCodeEntryFor):
(JSC::ExecutableBase::jsCodeEntryFor):
(JSC::ExecutableBase::jsCodeWithArityCheckEntryFor):
(JSC::NativeExecutable::create):
(JSC::NativeExecutable::finishCreation):
(JSC::ProgramExecutable::generatedJITCode):

  • runtime/JSArray.cpp:

(JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):

  • runtime/StringPrototype.cpp:

(JSC::replaceUsingRegExpSearch):

  • runtime/VM.cpp:

(JSC::VM::getHostFunction):

File:
1 edited

Legend:

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

    r160094 r160186  
    11/*
    2  * Copyright (C) 2009 Apple Inc. All rights reserved.
     2 * Copyright (C) 2009, 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333struct CallFrameClosure {
    3434    CallFrame* oldCallFrame;
    35 #if ENABLE(LLINT_C_LOOP)
    36     CallFrame* newCallFrame;
    37 #else
    38     ProtoCallFrame* newCallFrame;
    39 #endif
     35    ProtoCallFrame* protoCallFrame;
    4036    JSFunction* function;
    4137    FunctionExecutable* functionExecutable;
     
    4743    void setThis(JSValue value)
    4844    {
    49         newCallFrame->setThisValue(value);
     45        protoCallFrame->setThisValue(value);
    5046    }
    5147
    5248    void setArgument(int argument, JSValue value)
    5349    {
    54         newCallFrame->setArgument(argument, value);
     50        protoCallFrame->setArgument(argument, value);
    5551    }
    5652
    5753    void resetCallFrame()
    5854    {
    59         newCallFrame->setScope(scope);
    60 #if ENABLE(LLINT_C_LOOP)
    61         // setArgument() takes an arg index that starts from 0 for the first
    62         // argument after the 'this' value. Since both argumentCountIncludingThis
    63         // and parameterCountIncludingThis includes the 'this' value, we need to
    64         // subtract 1 from them to make it a valid argument index for setArgument().
    65         for (int i = argumentCountIncludingThis-1; i < parameterCountIncludingThis-1; ++i)
    66             newCallFrame->setArgument(i, jsUndefined());
    67 #endif
     55        protoCallFrame->setScope(scope);
    6856    }
    6957};
Note: See TracChangeset for help on using the changeset viewer.