Changeset 268385 in webkit


Ignore:
Timestamp:
Oct 12, 2020, 9:52:53 PM (5 years ago)
Author:
ysuzuki@apple.com
Message:

JIT operations do not need extern "C"
https://bugs.webkit.org/show_bug.cgi?id=217636

Reviewed by Saam Barati.

Source/JavaScriptCore:

Since they are directly embedded by JIT code generator (not linked via linker), they do not need to be C linkage.

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • ftl/FTLOSRExitCompiler.cpp:
  • ftl/FTLOSRExitCompiler.h:
  • ftl/FTLOperations.cpp:
  • ftl/FTLOperations.h:
  • jit/JITOperations.cpp:
  • jit/JITOperations.h:

Source/WebCore:

  • domjit/DOMJITHelpers.h:
  • domjit/JSDocumentDOMJIT.cpp:
Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r268375 r268385  
     12020-10-12  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        JIT operations do not need extern "C"
     4        https://bugs.webkit.org/show_bug.cgi?id=217636
     5
     6        Reviewed by Saam Barati.
     7
     8        Since they are directly embedded by JIT code generator (not linked via linker), they do not need to be C linkage.
     9
     10        * dfg/DFGOperations.cpp:
     11        * dfg/DFGOperations.h:
     12        * ftl/FTLOSRExitCompiler.cpp:
     13        * ftl/FTLOSRExitCompiler.h:
     14        * ftl/FTLOperations.cpp:
     15        * ftl/FTLOperations.h:
     16        * jit/JITOperations.cpp:
     17        * jit/JITOperations.h:
     18
    1192020-10-12  Saam Barati  <sbarati@apple.com>
    220
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r268316 r268385  
    218218}
    219219
    220 extern "C" {
    221 
    222220JSC_DEFINE_JIT_OPERATION(operationToThis, EncodedJSValue, (JSGlobalObject* globalObject, EncodedJSValue encodedOp))
    223221{
     
    39973995#endif // ENABLE(FTL_JIT)
    39983996
    3999 } // extern "C"
    40003997} } // namespace JSC::DFG
    40013998
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.h

    r267754 r268385  
    4040
    4141struct OSRExitBase;
    42 
    43 extern "C" {
    4442
    4543JSC_DECLARE_JIT_OPERATION(operationStringFromCharCode, JSCell*, (JSGlobalObject*, int32_t));
     
    342340#endif // ENABLE(FTL_JIT)
    343341
    344 } // extern "C"
    345 
    346342inline auto operationNewTypedArrayWithSizeForType(TypedArrayType type) -> decltype(&operationNewInt8ArrayWithSize)
    347343{
  • trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp

    r267727 r268385  
    550550}
    551551
    552 extern "C" {
    553 
    554552JSC_DEFINE_JIT_OPERATION(operationCompileFTLOSRExit, void*, (CallFrame* callFrame, unsigned exitID))
    555553{
     
    605603}
    606604
    607 } // extern "C"
    608 
    609605} } // namespace JSC::FTL
    610606
  • trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.h

    r267727 r268385  
    3434// Takes the call frame and the index of the exit, and returns the address to
    3535// jump to.
    36 extern "C" {
    3736JSC_DECLARE_JIT_OPERATION(operationCompileFTLOSRExit, void*, (CallFrame*, unsigned exitID));
    38 }
    3937
    4038} } // namespace JSC::FTL
  • trunk/Source/JavaScriptCore/ftl/FTLOperations.cpp

    r267727 r268385  
    5454namespace JSC { namespace FTL {
    5555
    56 extern "C" {
    57 
    5856JSC_DEFINE_JIT_OPERATION(operationPopulateObjectInOSR, void, (JSGlobalObject* globalObject, ExitTimeObjectMaterialization* materialization, EncodedJSValue* encodedValue, EncodedJSValue* values))
    5957{
     
    753751}
    754752
    755 } // extern "C"
    756 
    757753} } // namespace JSC::FTL
    758754
  • trunk/Source/JavaScriptCore/ftl/FTLOperations.h

    r267732 r268385  
    3535class LazySlowPath;
    3636
    37 extern "C" {
    38 
    3937JSC_DECLARE_JIT_OPERATION(operationMaterializeObjectInOSR, JSCell*, (JSGlobalObject*, ExitTimeObjectMaterialization*, EncodedJSValue*));
    4038
     
    4846JSC_DECLARE_JIT_OPERATION(operationReportBoundsCheckEliminationErrorAndCrash, void, (intptr_t codeBlockAsIntPtr, int32_t, int32_t, int32_t, int32_t, int32_t));
    4947
    50 } // extern "C"
    51 
    5248} } // namespace JSC::DFG
    5349
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r268316 r268385  
    8181}
    8282
    83 extern "C" {
    84 
    8583#if COMPILER(MSVC)
    86 void * _ReturnAddress(void);
     84extern "C" void * _ReturnAddress(void);
    8785#pragma intrinsic(_ReturnAddress)
    8886
     
    672670}
    673671
    674 } // extern "C"
    675 
    676672template<typename PutPrivateFieldCallback>
    677673ALWAYS_INLINE static void setPrivateField(VM& vm, JSGlobalObject* globalObject, CallFrame* callFrame, JSValue baseValue, CacheableIdentifier identifier, JSValue value, PutPrivateFieldCallback callback)
     
    711707    callback(vm, codeBlock, oldStructure, putSlot, ident);
    712708}
    713 
    714 extern "C" {
    715709
    716710JSC_DEFINE_JIT_OPERATION(operationPutByIdDefinePrivateFieldStrict, void, (JSGlobalObject* globalObject, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, uintptr_t rawCacheableIdentifier))
     
    15151509}
    15161510
    1517 }
    1518 
    15191511template<typename FunctionType>
    15201512static EncodedJSValue newFunctionCommon(VM& vm, JSScope* scope, JSCell* functionExecutable, bool isInvalidated)
     
    15251517    return JSValue::encode(FunctionType::create(vm, static_cast<FunctionExecutable*>(functionExecutable), scope));
    15261518}
    1527 
    1528 extern "C" {
    15291519
    15301520JSC_DEFINE_JIT_OPERATION(operationNewFunction, EncodedJSValue, (VM* vmPointer, JSScope* scope, JSCell* functionExecutable))
     
    20912081}
    20922082
    2093 }
    2094 
    20952083ALWAYS_INLINE static JSValue getByVal(JSGlobalObject* globalObject, CallFrame* callFrame, ArrayProfile* arrayProfile, JSValue baseValue, JSValue subscript)
    20962084{
     
    21562144    RELEASE_AND_RETURN(scope, baseValue.get(globalObject, property));
    21572145}
    2158 
    2159 extern "C" {
    21602146
    21612147JSC_DEFINE_JIT_OPERATION(operationGetByValGeneric, EncodedJSValue, (JSGlobalObject* globalObject, StructureStubInfo* stubInfo, ArrayProfile* profile, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript))
     
    22502236}
    22512237
    2252 } // extern "C"
    2253 
    22542238ALWAYS_INLINE static JSValue getPrivateName(JSGlobalObject* globalObject, CallFrame* callFrame, JSValue baseValue, JSValue fieldNameValue)
    22552239{
     
    22702254    return slot.getValue(globalObject, fieldName);
    22712255}
    2272 
    2273 extern "C" {
    22742256
    22752257JSC_DEFINE_JIT_OPERATION(operationGetPrivateNameOptimize, EncodedJSValue, (JSGlobalObject* globalObject, StructureStubInfo* stubInfo, EncodedJSValue encodedBase, EncodedJSValue encodedFieldName))
     
    33423324}
    33433325
    3344 } // extern "C"
    3345 
    33463326} // namespace JSC
    33473327
  • trunk/Source/JavaScriptCore/jit/JITOperations.h

    r267754 r268385  
    6969struct InlineCallFrame;
    7070struct Instruction;
    71 
    72 extern "C" {
    7371
    7472typedef char* UnusedPtr;
     
    317315JSC_DECLARE_JIT_OPERATION(operationProcessShadowChickenLog, void, (VM*));
    318316
    319 } // extern "C"
    320 
    321317} // namespace JSC
    322318
  • trunk/Source/WebCore/ChangeLog

    r268382 r268385  
     12020-10-12  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        JIT operations do not need extern "C"
     4        https://bugs.webkit.org/show_bug.cgi?id=217636
     5
     6        Reviewed by Saam Barati.
     7
     8        * domjit/DOMJITHelpers.h:
     9        * domjit/JSDocumentDOMJIT.cpp:
     10
    1112020-10-12  Zalan Bujtas  <zalan@apple.com>
    212
  • trunk/Source/WebCore/domjit/DOMJITHelpers.h

    r267727 r268385  
    194194}
    195195
    196 extern "C" {
    197 
    198196JSC_DECLARE_JIT_OPERATION(operationToJSNode, JSC::EncodedJSValue, (JSC::JSGlobalObject*, void*));
    199197JSC_DECLARE_JIT_OPERATION(operationToJSContainerNode, JSC::EncodedJSValue, (JSC::JSGlobalObject*, void*));
     
    202200JSC_DECLARE_JIT_OPERATION(operationToJSDocument, JSC::EncodedJSValue, (JSC::JSGlobalObject*, void*));
    203201
    204 }
    205 
    206202} }
    207203
  • trunk/Source/WebCore/domjit/JSDocumentDOMJIT.cpp

    r267938 r268385  
    143143namespace DOMJIT {
    144144
    145 extern "C" {
    146 
    147145JSC_DEFINE_JIT_OPERATION(operationToJSElement, JSC::EncodedJSValue, (JSC::JSGlobalObject* globalObject, void* result))
    148146{
     
    195193}
    196194
    197 }
    198 
    199195} }
    200196
Note: See TracChangeset for help on using the changeset viewer.