Ignore:
Timestamp:
May 18, 2010, 11:04:18 PM (15 years ago)
Author:
[email protected]
Message:

Bug 39343 - Dynamically generate a native call thunk per NativeFunction

Reviewed by Geoff Garen.

https://bugs.webkit.org/show_bug.cgi?id=39252 regressed performance on i386,
by adding an extra indirection to making a native call. By introducing per-
NativeFunction thunks we can hard code the function pointer into the thunk
so that it need not be loaded from the callee.

  • jit/JIT.h:

(JSC::JIT::compileCTINativeCall):

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileCTINativeCall):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTINativeCall):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitSlow_op_get_by_val):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emitSlow_op_get_by_val):

  • jit/JITStubs.cpp:

(JSC::JITThunks::ctiStub):
(JSC::JITThunks::hostFunctionStub):

  • jit/JITStubs.h:
  • jit/SpecializedThunkJIT.h:

(JSC::SpecializedThunkJIT::finalize):

  • jit/ThunkGenerators.cpp:

(JSC::charCodeAtThunkGenerator):
(JSC::charAtThunkGenerator):
(JSC::fromCharCodeThunkGenerator):
(JSC::sqrtThunkGenerator):
(JSC::powThunkGenerator):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::JSFunction):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::getHostFunction):

  • runtime/JSGlobalData.h:

(JSC::JSGlobalData::getCTIStub):

  • runtime/Lookup.cpp:

(JSC::setUpStaticFunctionSlot):

  • runtime/StringConstructor.cpp:

(JSC::StringConstructor::StringConstructor):

  • wtf/Platform.h:
File:
1 edited

Legend:

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

    r59676 r59746  
    255255
    256256#if ENABLE(JIT)
    257 PassRefPtr<NativeExecutable> JSGlobalData::getNativeExecutable(NativeFunction function)
    258 {
    259     std::pair<NativeExecutableMap::iterator, bool> entry = m_nativeExecutableMap.add(function, 0);
    260     if (entry.second)
    261         entry.first->second = NativeExecutable::create(jitStubs.ctiNativeCall(), function);
    262     return entry.first->second;
    263 }
    264 
    265 PassRefPtr<NativeExecutable> JSGlobalData::getNativeExecutable(NativeFunction function, ThunkGenerator generator)
    266 {
    267     std::pair<NativeExecutableMap::iterator, bool> entry = m_nativeExecutableMap.add(function, 0);
    268     if (entry.second)
    269         entry.first->second = NativeExecutable::create(getThunk(generator), function);
    270     return entry.first->second;
     257PassRefPtr<NativeExecutable> JSGlobalData::getHostFunction(NativeFunction function)
     258{
     259    return jitStubs.hostFunctionStub(this, function);
     260}
     261PassRefPtr<NativeExecutable> JSGlobalData::getHostFunction(NativeFunction function, ThunkGenerator generator)
     262{
     263    return jitStubs.hostFunctionStub(this, function, generator);
    271264}
    272265#endif
Note: See TracChangeset for help on using the changeset viewer.