Ignore:
Timestamp:
Nov 28, 2011, 3:51:51 PM (14 years ago)
Author:
[email protected]
Message:

GetById should not always speculate cell
https://bugs.webkit.org/show_bug.cgi?id=73181

Reviewed by Gavin Barraclough.

GetById will now speculate cell if the predictions of the base are cell.
Otherwise it will do like the old JIT (and like the old non-speculative
DFG JIT): if not cell, go straight to slow-path but otherwise don't OSR
out. This is a 1% speed-up on SunSpider.

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::setupArgumentsWithExecState):
(JSC::DFG::SpeculativeJIT::callOperation):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r101283 r101298  
    4949#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function)    FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, rsi)
    5050#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function)  FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, rcx)
     51#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function)  FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, rcx)
    5152#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, r8)
    5253
     
    6364#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function)    FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 8)
    6465#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function)  FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 16)
     66#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function)  FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 20)
    6567#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 24)
    6668
     
    9395    );
    9496
     97#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) \
     98    asm ( \
     99    ".text" "\n" \
     100    ".align 2" "\n" \
     101    ".globl " SYMBOL_STRING(function) "\n" \
     102    HIDE_SYMBOL(function) "\n" \
     103    ".thumb" "\n" \
     104    ".thumb_func " THUMB_FUNC_PARAM(function) "\n" \
     105    SYMBOL_STRING(function) ":" "\n" \
     106        "str lr, [sp, #0]" "\n" \
     107        "b " SYMBOL_STRING_RELOCATION(function) "WithReturnAddress" "\n" \
     108    );
     109
    95110#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) \
    96111    asm ( \
     
    116131FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function)
    117132
     133#define J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) \
     134EncodedJSValue DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, Identifier*, ReturnAddressPtr); \
     135FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function)
     136
    118137#define V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) \
    119138void DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, JSCell*, Identifier*, ReturnAddressPtr); \
     
    313332}
    314333
    315 EncodedJSValue DFG_OPERATION operationGetById(ExecState* exec, JSCell* base, Identifier* propertyName)
    316 {
    317     JSValue baseValue(base);
     334EncodedJSValue DFG_OPERATION operationGetById(ExecState* exec, EncodedJSValue base, Identifier* propertyName)
     335{
     336    JSValue baseValue = JSValue::decode(base);
    318337    PropertySlot slot(baseValue);
    319338    return JSValue::encode(baseValue.get(exec, *propertyName, slot));
    320339}
    321340
    322 J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(operationGetByIdBuildList);
    323 EncodedJSValue DFG_OPERATION operationGetByIdBuildListWithReturnAddress(ExecState* exec, JSCell* base, Identifier* propertyName, ReturnAddressPtr returnAddress)
    324 {
    325     JSValue baseValue(base);
     341J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(operationGetByIdBuildList);
     342EncodedJSValue DFG_OPERATION operationGetByIdBuildListWithReturnAddress(ExecState* exec, EncodedJSValue base, Identifier* propertyName, ReturnAddressPtr returnAddress)
     343{
     344    JSValue baseValue = JSValue::decode(base);
    326345    PropertySlot slot(baseValue);
    327346    JSValue result = baseValue.get(exec, *propertyName, slot);
     
    333352}
    334353
    335 J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(operationGetByIdProtoBuildList);
    336 EncodedJSValue DFG_OPERATION operationGetByIdProtoBuildListWithReturnAddress(ExecState* exec, JSCell* base, Identifier* propertyName, ReturnAddressPtr returnAddress)
    337 {
    338     JSValue baseValue(base);
     354J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(operationGetByIdProtoBuildList);
     355EncodedJSValue DFG_OPERATION operationGetByIdProtoBuildListWithReturnAddress(ExecState* exec, EncodedJSValue base, Identifier* propertyName, ReturnAddressPtr returnAddress)
     356{
     357    JSValue baseValue = JSValue::decode(base);
    339358    PropertySlot slot(baseValue);
    340359    JSValue result = baseValue.get(exec, *propertyName, slot);
     
    346365}
    347366
    348 J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(operationGetByIdOptimize);
    349 EncodedJSValue DFG_OPERATION operationGetByIdOptimizeWithReturnAddress(ExecState* exec, JSCell* base, Identifier* propertyName, ReturnAddressPtr returnAddress)
    350 {
    351     JSValue baseValue(base);
     367J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(operationGetByIdOptimize);
     368EncodedJSValue DFG_OPERATION operationGetByIdOptimizeWithReturnAddress(ExecState* exec, EncodedJSValue base, Identifier* propertyName, ReturnAddressPtr returnAddress)
     369{
     370    JSValue baseValue = JSValue::decode(base);
    352371    PropertySlot slot(baseValue);
    353372    JSValue result = baseValue.get(exec, *propertyName, slot);
Note: See TracChangeset for help on using the changeset viewer.