Ignore:
Timestamp:
May 5, 2009, 4:34:23 AM (16 years ago)
Author:
[email protected]
Message:

Bug 25559: Improve native function call performance
<https://bugs.webkit.org/show_bug.cgi?id=25559>

Reviewed by Gavin Barraclough

In order to cache calls to native functions we now make the standard
prototype functions use a small assembly thunk that converts the JS
calling convention into the native calling convention. As this is
only beneficial in the JIT we use the NativeFunctionWrapper typedef
to alternate between PrototypeFunction and JSFunction to keep the
code sane. This change from PrototypeFunction to NativeFunctionWrapper
is the bulk of this patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalData.h

    r43122 r43220  
    4747    class ArgList;
    4848    class CommonIdentifiers;
     49    class FunctionBodyNode;
    4950    class Heap;
    5051    class IdentifierTable;
     
    120121#if ENABLE(JIT)
    121122        JITStubs jitStubs;
     123        FunctionBodyNode* nativeFunctionThunk() {
     124            if (!lazyNativeFunctionThunk)
     125                createNativeThunk();
     126            return lazyNativeFunctionThunk.get();
     127        }
     128        RefPtr<FunctionBodyNode> lazyNativeFunctionThunk;
    122129#endif
    123130        TimeoutChecker timeoutChecker;
     
    148155        JSGlobalData(bool isShared, const VPtrSet&);
    149156        static JSGlobalData*& sharedInstanceInternal();
     157        void createNativeThunk();
    150158    };
    151159} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.