• jameslahm's avatar
    [interpreter] Optimize strict equal boolean · 62632c08
    jameslahm authored
    For strict equal boolean literal like "a===true"
    or "a===false", we could generate TestReferenceEqual
    rather than TestStrictEqual. And in `execution_result()->IsTest()`
    case, we could directly emit JumpIfTrue/JumpIfFalse.
    
    E.g.
    ```
    a === true
    ```
    Generated Bytecode From:
    ```
    LdaGlobal
    Star1
    LdaTrue
    TestEqualStrict
    ```
    To:
    ```
    LdaGlobal
    Star1
    LdaTrue
    TestReferenceEqual
    ```
    
    E.g.
    ```
    if (a === true)
    ```
    Generated Bytecode From:
    ```
    LdaGlobal
    Star1
    LdaTrue
    TestEqualStrict
    JumpIfFalse
    ```
    To
    ```
    LdaGlobal
    JumpIfTrue
    Jump
    ```
    
    
    Bug: v8:6403
    Change-Id: Ieaca147acd2d523ac0d2466e7861afb2d29a1310
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568923Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
    Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Commit-Queue: 王澳 <wangao.james@bytedance.com>
    Cr-Commit-Position: refs/heads/main@{#79935}
    62632c08
Name
Last commit
Last update
..
benchmarks Loading commit data...
bigint Loading commit data...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
debugging Loading commit data...
fuzzer Loading commit data...
fuzzilli Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mkgrokdump Loading commit data...
mozilla Loading commit data...
test262 Loading commit data...
torque Loading commit data...
unittests Loading commit data...
wasm-api-tests Loading commit data...
wasm-js Loading commit data...
wasm-spec-tests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
OWNERS Loading commit data...