Poor code generated for skip chain

NEW
Unassigned

Status

Tamarin
Baseline JIT (CodegenLIR)
8 years ago
8 years ago

People

(Reporter: William Maddox, Unassigned)

Tracking

(Blocks: 1 bug)

unspecified
Future
x86
All
Dependency tree / graph
Bug Flags:
flashplayer-qrb +

Details

(Whiteboard: PACMAN)

(Reporter)

Description

8 years ago
From the -Dverbose=jit output of the catch handler of a method:

    jt eq16 -> B255
00007686a6   cmp ebx,255
00007686ac   je    0x0
00007686b2   mov ebx,-920(ebp)  <= restore ld134
                          RR ebx(ld134)
                          AR 780-1552(vars) 792-800(methodFrame) 888-980(_ef) 892(ebx) 896(esi) 900(edi) 904(4) 908(6381608) 912(env) 916(env_scope) 920(ld134)
    jt eq17 -> B382
00007686b8   cmp ebx,382
00007686be   je    0x0
00007686c4   mov ebx,-920(ebp)  <= restore ld134
                          RR ebx(ld134)
                          AR 780-1552(vars) 792-800(methodFrame) 888-980(_ef) 892(ebx) 896(esi) 900(edi) 904(4) 908(6381608) 912(env) 916(env_scope) 920(ld134)
    jt eq18 -> B414
00007686ca   cmp ebx,414
00007686d0   je    0x0
00007686d6   mov ebx,-920(ebp)  <= restore ld134
                          RR ebx(ld134)
                          AR 780-1552(vars) 792-800(methodFrame) 888-980(_ef) 892(ebx) 896(esi) 900(edi) 904(4) 908(6381608) 912(env) 916(env_scope) 920(ld134)
    jt eq19 -> B541
00007686dc   cmp ebx,541
00007686e2   je    0x0
00007686e8   mov ebx,-920(ebp)  <= restore ld134
                          RR ebx(ld134)
                          AR 780-1552(vars) 792-800(methodFrame) 888-980(_ef) 892(ebx) 896(esi) 900(edi) 904(4) 908(6381608) 912(env) 916(env_scope)
    jt eq20 -> B573

Why do we keep reloading ebx?  It looks as if the code generator may
be assuming that the "destination" argument of the CMP instruction is
clobbered, but it is not.

Example above is from tamarin-redux-argo, but tamarin-redux shows the
same issue.

Noticed in passing while analyzing Bug 565184.

Updated

8 years ago
Flags: flashplayer-qrb+
Target Milestone: --- → Future

Updated

8 years ago
Whiteboard: PACMAN

Comment 1

8 years ago
Once bug 565184 is done, the skip chain will test plain ordinals [0...n], and a LIR_jtbl would be more compact on CPU's that support it.
Depends on: 565184

Updated

8 years ago
Blocks: 595012
You need to log in before you can comment on or make changes to this bug.