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/jit/ThunkGenerators.cpp

    r59637 r59746  
    6868    stringCharLoad(jit);
    6969    jit.returnInt32(SpecializedThunkJIT::regT0);
    70     return jit.finalize();
     70    return jit.finalize(globalData->jitStubs.ctiNativeCall());
    7171}
    7272
     
    7777    charToString(jit, globalData, SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT1);
    7878    jit.returnJSCell(SpecializedThunkJIT::regT0);
    79     return jit.finalize();
     79    return jit.finalize(globalData->jitStubs.ctiNativeCall());
    8080}
    8181
     
    8787    charToString(jit, globalData, SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT1);
    8888    jit.returnJSCell(SpecializedThunkJIT::regT0);
    89     return jit.finalize();
     89    return jit.finalize(globalData->jitStubs.ctiNativeCall());
    9090}
    9191
     
    100100    jit.sqrtDouble(SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT0);
    101101    jit.returnDouble(SpecializedThunkJIT::fpRegT0);
    102     return jit.finalize();
     102    return jit.finalize(globalData->jitStubs.ctiNativeCall());
    103103#else
    104104    UNUSED_PARAM(pool);
     
    148148        jit.appendFailure(nonIntExponent);
    149149
    150     return jit.finalize();
     150    return jit.finalize(globalData->jitStubs.ctiNativeCall());
    151151#else
    152152    UNUSED_PARAM(pool);
Note: See TracChangeset for help on using the changeset viewer.