Changeset 242067 in webkit


Ignore:
Timestamp:
Feb 25, 2019 6:59:47 PM (5 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] stress/function-constructor-reading-from-global-lexical-environment.js fails in 32bit arch
https://bugs.webkit.org/show_bug.cgi?id=195030
<rdar://problem/48385088>

Reviewed by Saam Barati.

While LLInt64 has checkTDZInGlobalPutToScopeIfNecessary for op_put_to_scope GlobalLexicalVar to check the value in the variable slot is not empty,
this check is missing in LLInt32_64. Previously, this check was subsumed accidentally by the WatchpointSet check in GlobalLexicalVar in notifyWrite:
because no "put" attempt succeeds here, the status WatchpointSet was ClearWatchpoint, we always go to the slow path, and we always throw the TDZ error
before configuring the WatchpointSet in the slow path. But after r241862, WatchpointSet is not used under non-JIT configuration. This skips WatchpointSet
check and LLInt32_64 starts failing tests because of lack of checkTDZInGlobalPutToScopeIfNecessary. This patch adds checkTDZInGlobalPutToScopeIfNecessary
in LLInt32_64 too. This patch fixes the following four failing tests.

stress/function-constructor-reading-from-global-lexical-environment.js.bytecode-cache
stress/function-constructor-reading-from-global-lexical-environment.js.default
stress/global-lexical-variable-tdz.js.bytecode-cache
stress/global-lexical-variable-tdz.js.default

  • llint/LowLevelInterpreter32_64.asm:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r242064 r242067  
     12019-02-25  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] stress/function-constructor-reading-from-global-lexical-environment.js fails in 32bit arch
     4        https://bugs.webkit.org/show_bug.cgi?id=195030
     5        <rdar://problem/48385088>
     6
     7        Reviewed by Saam Barati.
     8
     9        While LLInt64 has checkTDZInGlobalPutToScopeIfNecessary for op_put_to_scope GlobalLexicalVar to check the value in the variable slot is not empty,
     10        this check is missing in LLInt32_64. Previously, this check was subsumed accidentally by the WatchpointSet check in GlobalLexicalVar in `notifyWrite`:
     11        because no "put" attempt succeeds here, the status WatchpointSet was ClearWatchpoint, we always go to the slow path, and we always throw the TDZ error
     12        before configuring the WatchpointSet in the slow path. But after r241862, WatchpointSet is not used under non-JIT configuration. This skips WatchpointSet
     13        check and LLInt32_64 starts failing tests because of lack of checkTDZInGlobalPutToScopeIfNecessary. This patch adds checkTDZInGlobalPutToScopeIfNecessary
     14        in LLInt32_64 too. This patch fixes the following four failing tests.
     15
     16            stress/function-constructor-reading-from-global-lexical-environment.js.bytecode-cache
     17            stress/function-constructor-reading-from-global-lexical-environment.js.default
     18            stress/global-lexical-variable-tdz.js.bytecode-cache
     19            stress/global-lexical-variable-tdz.js.default
     20
     21        * llint/LowLevelInterpreter32_64.asm:
     22
    1232019-02-25  Yusuke Suzuki  <ysuzuki@apple.com>
    224
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm

    r241862 r242067  
    23032303    end
    23042304
     2305    macro checkTDZInGlobalPutToScopeIfNecessary()
     2306        loadi OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0
     2307        andi InitializationModeMask, t0
     2308        rshifti InitializationModeShift, t0
     2309        bineq t0, NotInitialization, .noNeedForTDZCheck
     2310        loadp OpPutToScope::Metadata::m_operand[t5], t0
     2311        loadi TagOffset[t0], t0
     2312        bieq t0, EmptyValueTag, .pDynamic
     2313    .noNeedForTDZCheck:
     2314    end
    23052315
    23062316    metadata(t5, t0)
     
    23302340.pGlobalLexicalVar:
    23312341    bineq t0, GlobalLexicalVar, .pClosureVar
     2342    checkTDZInGlobalPutToScopeIfNecessary()
    23322343    putGlobalVariable()
    23332344    writeBarrierOnGlobalLexicalEnvironment(size, get, m_value)
     
    23582369    bineq t0, GlobalLexicalVarWithVarInjectionChecks, .pClosureVarWithVarInjectionChecks
    23592370    varInjectionCheck(.pDynamic)
     2371    checkTDZInGlobalPutToScopeIfNecessary()
    23602372    putGlobalVariable()
    23612373    writeBarrierOnGlobalLexicalEnvironment(size, get, m_value)
Note: See TracChangeset for help on using the changeset viewer.