Closed Bug 2087434 Opened 19 days ago Closed 18 days ago

[loong64] Test for null or undefined with one tag compare on Loong64

Categories

(Core :: JavaScript Engine: JIT, task)

Other
Unspecified
task

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: csmantle, Assigned: csmantle)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

No description provided.

This saves one branch for each such check, for example in the following
snippet:

    function f(x) {
      return x ? 1 : 2;
    }
    for (let i = 0; i < 20000; i++) {
      f((i & 1) ? null : 3);
    }

Before:

    [...]
    ld.d         $a2, $fp, 40
    srai.d       $t6, $a2, 0x2f
    addi.w       $t7, $zero, -12
    beq          $t6, $t7, 752 -> [...]
    bge          $zero, $zero, 8 -> [...]
    nop
    addi.w       $t7, $zero, -10
    beq          $t6, $t7, 736 -> [...]
    bge          $zero, $zero, 8 -> [...]
    nop
    [...]

After:

    [...]
    ld.d         $a2, $fp, 40
    srai.d       $t6, $a2, 0x2f
    srai.d       $t7, $t6, 0x2
    addi.d       $t7, $t7, 3
    beqz         $t7, 736 -> [...]
    bge          $zero, $zero, 8 -> [...]
    nop
    [...]

(Note that here $t6 is reused for subsequent tag checks.)

Status: ASSIGNED → RESOLVED
Closed: 18 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch
QA Whiteboard: [qa-triage-done-c162/b161]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: