Ignore:
Timestamp:
Sep 17, 2012, 12:07:32 PM (13 years ago)
Author:
[email protected]
Message:

Array profiling has convergence issues
https://bugs.webkit.org/show_bug.cgi?id=96891

Reviewed by Gavin Barraclough.

Source/JavaScriptCore:

Now each array profiling site merges in the indexing type it observed into
the m_observedArrayModes bitset. The ArrayProfile also uses this to detect
cases where the structure must have gone polymorphic (if the bitset is
polymorphic then the structure must be). This achieves something like the
best of both worlds: on the one hand, we get a probabilistic structure that
we can use to optimize the monomorphic structure case, but on the other hand,
we get an accurate view of the set of types that were encountered.

  • assembler/MacroAssemblerARMv7.h:

(JSC::MacroAssemblerARMv7::or32):
(MacroAssemblerARMv7):

  • assembler/MacroAssemblerX86.h:

(JSC::MacroAssemblerX86::or32):
(MacroAssemblerX86):

  • assembler/MacroAssemblerX86_64.h:

(JSC::MacroAssemblerX86_64::or32):
(MacroAssemblerX86_64):

  • assembler/X86Assembler.h:

(X86Assembler):
(JSC::X86Assembler::orl_rm):

  • bytecode/ArrayProfile.cpp:

(JSC::ArrayProfile::computeUpdatedPrediction):

  • bytecode/ArrayProfile.h:

(JSC::ArrayProfile::addressOfArrayModes):
(JSC::ArrayProfile::structureIsPolymorphic):

  • jit/JIT.h:

(JIT):

  • jit/JITInlineMethods.h:

(JSC):
(JSC::JIT::emitArrayProfilingSite):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::privateCompilePatchGetArrayLength):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::privateCompilePatchGetArrayLength):

  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:

Source/WTF:

Added functions for testing if something is a power of 2.

  • wtf/MathExtras.h:

(hasZeroOrOneBitsSet):
(hasTwoOrMoreBitsSet):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

    r128534 r128790  
    10241024    loadConstantOrVariableCell(t0, t3, .opGetArrayLengthSlow)
    10251025    loadp JSCell::m_structure[t3], t2
    1026     if VALUE_PROFILER
    1027         storep t2, ArrayProfile::m_lastSeenStructure[t1]
    1028     end
    1029     loadb Structure::m_indexingType[t2], t1
    1030     btiz t1, IsArray, .opGetArrayLengthSlow
    1031     btiz t1, HasArrayStorage, .opGetArrayLengthSlow
     1026    arrayProfile(t2, t1, t0)
     1027    btiz t2, IsArray, .opGetArrayLengthSlow
     1028    btiz t2, HasArrayStorage, .opGetArrayLengthSlow
    10321029    loadis 8[PB, PC, 8], t1
    10331030    loadp 64[PB, PC, 8], t2
     
    11531150    traceExecution()
    11541151    loadis 16[PB, PC, 8], t2
     1152    loadConstantOrVariableCell(t2, t0, .opGetByValSlow)
     1153    loadp JSCell::m_structure[t0], t2
     1154    loadp 32[PB, PC, 8], t3
     1155    arrayProfile(t2, t3, t1)
    11551156    loadis 24[PB, PC, 8], t3
    1156     loadConstantOrVariableCell(t2, t0, .opGetByValSlow)
     1157    btiz t2, HasArrayStorage, .opGetByValSlow
    11571158    loadConstantOrVariableInt32(t3, t1, .opGetByValSlow)
    11581159    sxi2p t1, t1
    1159     loadp JSCell::m_structure[t0], t3
    1160     loadp 32[PB, PC, 8], t2
    1161     if VALUE_PROFILER
    1162         storep t3, ArrayProfile::m_lastSeenStructure[t2]
    1163     end
    1164     btbz Structure::m_indexingType[t3], HasArrayStorage, .opGetByValSlow
    11651160    loadp JSObject::m_butterfly[t0], t3
    11661161    biaeq t1, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t3], .opGetByValSlow
     
    12361231    loadis 8[PB, PC, 8], t0
    12371232    loadConstantOrVariableCell(t0, t1, .opPutByValSlow)
     1233    loadp JSCell::m_structure[t1], t2
     1234    loadp 32[PB, PC, 8], t0
     1235    arrayProfile(t2, t0, t3)
     1236    btiz t2, HasArrayStorage, .opPutByValSlow
    12381237    loadis 16[PB, PC, 8], t0
    12391238    loadConstantOrVariableInt32(t0, t2, .opPutByValSlow)
    12401239    sxi2p t2, t2
    1241     loadp JSCell::m_structure[t1], t3
    1242     loadp 32[PB, PC, 8], t0
    1243     if VALUE_PROFILER
    1244         storep t3, ArrayProfile::m_lastSeenStructure[t0]
    1245     end
    1246     btbz Structure::m_indexingType[t3], HasArrayStorage, .opPutByValSlow
    12471240    loadp JSObject::m_butterfly[t1], t0
    12481241    biaeq t2, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t0], .opPutByValSlow
Note: See TracChangeset for help on using the changeset viewer.