Ignore:
Timestamp:
Dec 14, 2020, 2:32:10 AM (5 years ago)
Author:
[email protected]
Message:

[JSC] Introduce vmEntryCustomAccessor and vmEntryHostFunction for JITCage
https://bugs.webkit.org/show_bug.cgi?id=219847

Reviewed by Mark Lam.

Source/JavaScriptCore:

Instead of registering all host-functions and custom accessors with OperationPtrTag or HostFunctionPtrTag,
this patch introduces a trampoline which invokes them with special ptr-tag to reduce memory usage of JITOperationList.

When invoking custom accessor, we pass that pointer as a forth argument, and call vmEntryCustomAccessor.
And vmEntryCustomAccessor jumps to the passed argument with special ptr tag. And we register vmEntryCustomAccessor as an operation.
For host-functions, we pass that pointer as a third argument.

  • assembler/JITOperationList.cpp:

(JSC::addPointers):
(JSC::JITOperationList::populatePointersInJavaScriptCore):
(JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt):
(JSC::JITOperationList::populatePointersInEmbedder):

  • assembler/JITOperationList.h:

(JSC::JITOperationList::assertIsHostFunction): Deleted.

  • b3/testb3_1.cpp:

(main):

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::generateImpl):

  • bytecode/GetByIdVariant.cpp:

(JSC::GetByIdVariant::GetByIdVariant):

  • bytecode/GetByIdVariant.h:

(JSC::GetByIdVariant::customAccessorGetter const):

  • bytecode/GetByStatus.cpp:

(JSC::GetByStatus::computeForStubInfoWithoutExitSiteFeedback):

  • bytecode/GetterSetterAccessCase.cpp:

(JSC::GetterSetterAccessCase::create):

  • bytecode/GetterSetterAccessCase.h:
  • dfg/DFGNode.h:
  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileCallDOMGetter):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter):

  • jit/JITOperations.h:
  • jit/Repatch.cpp:

(JSC::tryCacheGetBy):
(JSC::tryCachePutByID):

  • jit/ThunkGenerators.cpp:

(JSC::nativeForGenerator):

  • jsc.cpp:

(jscmain):

  • llint/LLIntData.cpp:

(JSC::LLInt::initialize):

  • llint/LLIntThunks.cpp:
  • llint/LLIntThunks.h:
  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/Gate.h:
  • runtime/JSCPtrTag.h:

(JSC::tagJSCCodePtrImpl):
(JSC::untagJSCCodePtrImpl):

  • runtime/NativeFunction.h:
  • runtime/PropertySlot.h:
  • runtime/PutPropertySlot.h:

(JSC::PutPropertySlot::customSetter const):

  • runtime/VM.cpp:

(JSC::VM::getHostFunction):

Source/WebCore:

  • bindings/js/WebCoreJITOperations.cpp:

(WebCore::populateJITOperations):

  • testing/js/WebCoreTestSupport.cpp:

(WebCoreTestSupport::populateJITOperations):

Source/WebKit:

  • Shared/WebKitJITOperations.cpp:

(WebKit::populateJITOperations):

Source/WTF:

  • wtf/PlatformCallingConventions.h:
File:
1 edited

Legend:

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

    r268247 r270764  
    3939    enum Type : uint8_t { Uncachable, ExistingProperty, NewProperty, SetterProperty, CustomValue, CustomAccessor };
    4040    enum Context { UnknownContext, PutById, PutByIdEval };
    41     typedef bool (*PutValueFunc)(JSGlobalObject*, EncodedJSValue thisObject, EncodedJSValue value);
     41    using PutValueFunc = bool (*)(JSGlobalObject*, EncodedJSValue thisObject, EncodedJSValue value);
     42    using PutValueFuncWithPtr = bool (*)(JSGlobalObject*, EncodedJSValue thisObject, EncodedJSValue value, void*);
    4243
    4344    PutPropertySlot(JSValue thisValue, bool isStrictMode = false, Context context = UnknownContext, bool isInitialization = false)
     
    9899    }
    99100
    100     FunctionPtr<PutValuePtrTag> customSetter() const
     101    FunctionPtr<CustomAccessorPtrTag> customSetter() const
    101102    {
    102103        ASSERT(isCacheableCustom());
     
    138139    uint8_t m_context;
    139140    CacheabilityType m_cacheability;
    140     FunctionPtr<PutValuePtrTag> m_putFunction;
     141    FunctionPtr<CustomAccessorPtrTag> m_putFunction;
    141142};
    142143
Note: See TracChangeset for help on using the changeset viewer.