Multiple copies of same code

Chuck Rasbold rasbold at google.com
Sun Nov 22 08:59:15 PST 2009


Sure.  It would be great to merge redundant code paths.  But I don't
think the cost/benefit ratio is worth it.

In the case you cite, there would be a savings of 4 bytes per path
removed, which are projected to be very infrequent. In a JIT, you
have to spend your compilation budget wisely.

It's not that it can't be done. There are just better places to spend time.

On Sat, Nov 21, 2009 at 5:54 AM, Ulf Zibis <Ulf.Zibis at gmx.de> wrote:

> In output of PrintAssembly I frequently see :
>
> ...
> ...   # more than 10 recurrences
> ...
> 726   B108: #        B114 <- B10  Freq: 9.99898e-006
> 726           # exception oop is in EAX; no code emitted
> 726           MOV    ECX,EAX
> 728           JMP,s  B114
> 728
> 72a   B109: #        B114 <- B9  Freq: 9.99918e-006
> 72a           # exception oop is in EAX; no code emitted
> 72a           MOV    ECX,EAX
> 72c           JMP,s  B114
> 72c
> 72e   B110: #        B114 <- B6  Freq: 9.99938e-006
> 72e           # exception oop is in EAX; no code emitted
> 72e           MOV    ECX,EAX
> 730           JMP,s  B114
> 730
> 732   B111: #        B114 <- B4  Freq: 9.99959e-006
> 732           # exception oop is in EAX; no code emitted
> 732           MOV    ECX,EAX
> 734           JMP,s  B114
> 734
> 736   B112: #        B114 <- B3  Freq: 9.99979e-006
> 736           # exception oop is in EAX; no code emitted
> 736           MOV    ECX,EAX
> 738           JMP,s  B114
> 738
> 73a   B113: #        B114 <- B2  Freq: 9.99999e-006
> 73a           # exception oop is in EAX; no code emitted
> 73a           MOV    ECX,EAX
> 73a
> 73c   B114: #        N1132 <- B79 B113 B112 B111 B110 B109 B108 B103 B102
> B101 B100 B93 B92 B91 B90 B87 B86 B85 B84 B83 B82 B81 B80 B107 B106 B105
> B104 B78 B77 B76 B75 B99  Freq: 7.11172e-005
>
>
> Wouldn't it be better to have :
>
> ...
> ...   # more than 10 recurrences
> ...
> 73a   B108: #        B114 <- B10  Freq: 9.99898e-006
> 73a   B109: #        B114 <- B9  Freq: 9.99918e-006
> 73a   B110: #        B114 <- B6  Freq: 9.99938e-006
> 73a   B111: #        B114 <- B4  Freq: 9.99959e-006
> 73a   B112: #        B114 <- B3  Freq: 9.99979e-006
> 73a   B113: #        B114 <- B2  Freq: 9.99999e-006
> 73a           # exception oop is in EAX; no code emitted
> 73a           MOV    ECX,EAX
> 73a
> 73c   B114: #        N1132 <- B79 B113 B112 B111 B110 B109 B108 B103 B102
> B101 B100 B93 B92 B91 B90 B87 B86 B85 B84 B83 B82 B81 B80 B107 B106 B105
> B104 B78 B77 B76 B75 B99  Freq: 7.11172e-005
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20091122/7847a5e2/attachment.html 


More information about the hotspot-compiler-dev mailing list