Ignore:
Timestamp:
Aug 3, 2015, 12:25:03 PM (10 years ago)
Author:
Yusuke Suzuki
Message:

Don't set up the callsite to operationGetByValDefault when the optimization is already done
https://bugs.webkit.org/show_bug.cgi?id=147577

Reviewed by Filip Pizlo.

operationGetByValDefault should be called only when the IC is not set.
operationGetByValString breaks this invariant and ASSERT(!byValInfo.stubRoutine) in
operationGetByValDefault raises the assertion failure.
In this patch, we change the callsite setting up code in operationGetByValString when
the IC is already set. And to make the operation's meaning explicitly, we changed the
name operationGetByValDefault to operationGetByValOptimize, that is aligned to the
GetById case.

  • jit/JITOperations.cpp:
  • jit/JITOperations.h:
  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitSlow_op_get_by_val):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emitSlow_op_get_by_val):

  • tests/stress/operation-get-by-val-default-should-not-called-for-already-optimized-site.js: Added.

(hello):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r187515 r187750  
    15101510}
    15111511
    1512 EncodedJSValue JIT_OPERATION operationGetByValDefault(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript, ArrayProfile* arrayProfile)
     1512EncodedJSValue JIT_OPERATION operationGetByValOptimize(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript, ArrayProfile* arrayProfile)
    15131513{
    15141514    VM& vm = exec->vm();
     
    16441644        else {
    16451645            result = baseValue.get(exec, i);
    1646             if (!isJSString(baseValue))
    1647                 ctiPatchCallByReturnAddress(exec->codeBlock(), ReturnAddressPtr(OUR_RETURN_ADDRESS), FunctionPtr(operationGetByValDefault));
     1646            if (!isJSString(baseValue)) {
     1647                unsigned bytecodeOffset = exec->locationAsBytecodeOffset();
     1648                ASSERT(bytecodeOffset);
     1649                ByValInfo& byValInfo = exec->codeBlock()->getByValInfo(bytecodeOffset - 1);
     1650                ctiPatchCallByReturnAddress(exec->codeBlock(), ReturnAddressPtr(OUR_RETURN_ADDRESS), FunctionPtr(byValInfo.stubRoutine ? operationGetByValGeneric : operationGetByValOptimize));
     1651            }
    16481652        }
    16491653    } else {
Note: See TracChangeset for help on using the changeset viewer.