Ignore:
Timestamp:
May 7, 2012, 3:52:52 PM (13 years ago)
Author:
[email protected]
Message:

LLInt doesn't check for Ropes when performing a character switch
https://bugs.webkit.org/show_bug.cgi?id=85837

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Make LLint check if the scrutinee of a char switch is a rope, and if
so fall back to a slow case.

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(LLInt):

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

LayoutTests:

Add a few tests to force the use of ropes on switch statements.

  • fast/js/script-tests/switch-behaviour.js:
  • fast/js/switch-behaviour-expected.txt:
File:
1 edited

Legend:

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

    r114702 r116361  
    12931293    loadp JSCell::m_structure[t1], t0
    12941294    bbneq Structure::m_typeInfo + TypeInfo::m_type[t0], StringType, .opSwitchCharFallThrough
     1295    bineq JSString::m_length[t1], 1, .opSwitchCharFallThrough
    12951296    loadp JSString::m_value[t1], t0
    1296     bineq StringImpl::m_length[t0], 1, .opSwitchCharFallThrough
     1297    btpz  t0, .opSwitchOnRope
    12971298    loadp StringImpl::m_data8[t0], t1
    12981299    btinz StringImpl::m_hashAndFlags[t0], HashFlags8BitBuffer, .opSwitchChar8Bit
     
    13111312.opSwitchCharFallThrough:
    13121313    dispatchInt(16[PB, PC, 8])
     1314
     1315.opSwitchOnRope:
     1316    callSlowPath(_llint_slow_path_switch_char)
     1317    dispatch(0)
    13131318
    13141319
Note: See TracChangeset for help on using the changeset viewer.