RFR (S): 8021898: Broken JIT compiler optimization for loop unswitching
Vladimir Kozlov
vladimir.kozlov at oracle.com
Tue Aug 13 16:15:53 PDT 2013
http://cr.openjdk.java.net/~kvn/8021898/webrev/
The problem is not in loop unswitching. Loop unswitching creates
particular code shape (partialSubtypeCheck_vs_Zero mach node followed by
cmovI_reg node) with which we hit the problem in RA.
RA clones the node producing flag (partialSubtypeCheck_vs_Zero) and
place it near user (cmovI_reg) in split_Rematerialize(). When a node is
cloned RA also should clone related MachProj nodes which indicate KILLed
flags and registers (effect(KILL rcx, KILL result)). The problem is RA
clones only one MachProj node in PhaseChaitin::clone_projs_shared().
The fixed is to clone all related MachProj nodes. The method
clone_projs() returns number of cloned MachProj nodes.
The increment of max_lrg_id is moved inside clone_projs_shared() which
is renamed to clone_projs() since we don't need second version of
clone_projs().
I also fixed/modified output in hs_err file in case VM crash in compiled
code.
Compiled frame output now has compile_id, compiler name, bytecode size,
and offset in the code is hex:
# J 61 C2
org.apache.http.impl.cookie.BestMatchSpec.formatCookies(Ljava/util/Lis
t;)Ljava/util/List; (116 bytes) @ 0xfffffd7ff8f26907
[0xfffffd7ff8f25340+0x15c7]
before:
# J
org.apache.http.impl.cookie.BestMatchSpec.formatCookies(Ljava/util/List;)Ljava/util/List;
@ 0xfffffd7ff8f2a837 [0xfffffd7ff8f29280+5559]
I also added java frames prints in "Native frames:" during error report
(hs_err). Before it printed only last compiled frame and stopped because
C2 compiled frame trash EBP. Note: hs_err file does not have "Java
frames:" in such case because it is guarded by has_last_Java_frame() and
error reporting is called from signal processing code so last frame is
native, I assume it is the reason - I did not investigated it in deap.
Thanks,
Vladimir
More information about the hotspot-compiler-dev
mailing list