src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Compilation.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler

src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Compilation.java

Print this page
rev 6447 : 8043638: Multiple compilation attempts break LogCompulation, lead to confusing PrintInlining output
Summary: dumps inlining only for last compilation attempt. Fix LogCompilation tool so it handles multiple compilation attempts.
Reviewed-by:


  32     private int id;
  33     private boolean osr;
  34     private Method method;
  35     private CallSite call = new CallSite();
  36     private CallSite lateInlineCall = new CallSite();
  37     private int osrBci;
  38     private String icount;
  39     private String bcount;
  40     private String special;
  41     private double start;
  42     private double end;
  43     private int attempts;
  44     private NMethod nmethod;
  45     private ArrayList<Phase> phases = new ArrayList<Phase>(4);
  46     private String failureReason;
  47 
  48     Compilation(int id) {
  49         this.id = id;
  50     }
  51 






  52     Phase getPhase(String s) {
  53         for (Phase p : getPhases()) {
  54             if (p.getName().equals(s)) {
  55                 return p;
  56             }
  57         }
  58         return null;
  59     }
  60 
  61     double getRegallocTime() {
  62         return getPhase("regalloc").getElapsedTime();
  63     }
  64 
  65     public double getStart() {
  66         return start;
  67     }
  68 
  69     @Override
  70     public String toString() {
  71         StringBuilder sb = new StringBuilder();


 195     public int getAttempts() {
 196         return attempts;
 197     }
 198 
 199     public void setAttempts(int attempts) {
 200         this.attempts = attempts;
 201     }
 202 
 203     public NMethod getNMethod() {
 204         return nmethod;
 205     }
 206 
 207     public void setNMethod(NMethod NMethod) {
 208         this.nmethod = NMethod;
 209     }
 210 
 211     public ArrayList<Phase> getPhases() {
 212         return phases;
 213     }
 214 
 215     public void setPhases(ArrayList<Phase> phases) {
 216         this.setPhases(phases);
 217     }
 218 
 219     public String getFailureReason() {
 220         return failureReason;
 221     }
 222 
 223     public void setFailureReason(String failureReason) {
 224         this.failureReason = failureReason;
 225     }
 226 
 227     public Method getMethod() {
 228         return method;
 229     }
 230 
 231     public void setMethod(Method method) {
 232         // Don't change method if it is already set to avoid changing
 233         // it by post parse inlining info.
 234         if (getMethod() == null) {
 235             this.method = method;
 236         }
 237     }
 238 
 239     public CallSite getCall() {
 240         return call;
 241     }
 242 
 243     public void setCall(CallSite call) {
 244         this.call = call;
 245     }
 246 
 247     public CallSite getLateInlineCall() {
 248         return lateInlineCall;
 249     }
 250 
 251     public double getElapsedTime() {
 252         return end - start;
 253     }
 254 
 255     public Compilation getCompilation() {
 256         return this;
 257     }
 258 }


  32     private int id;
  33     private boolean osr;
  34     private Method method;
  35     private CallSite call = new CallSite();
  36     private CallSite lateInlineCall = new CallSite();
  37     private int osrBci;
  38     private String icount;
  39     private String bcount;
  40     private String special;
  41     private double start;
  42     private double end;
  43     private int attempts;
  44     private NMethod nmethod;
  45     private ArrayList<Phase> phases = new ArrayList<Phase>(4);
  46     private String failureReason;
  47 
  48     Compilation(int id) {
  49         this.id = id;
  50     }
  51 
  52     void reset() {
  53         call = new CallSite();
  54         lateInlineCall = new CallSite();
  55         phases = new ArrayList<Phase>(4);
  56     }
  57 
  58     Phase getPhase(String s) {
  59         for (Phase p : getPhases()) {
  60             if (p.getName().equals(s)) {
  61                 return p;
  62             }
  63         }
  64         return null;
  65     }
  66 
  67     double getRegallocTime() {
  68         return getPhase("regalloc").getElapsedTime();
  69     }
  70 
  71     public double getStart() {
  72         return start;
  73     }
  74 
  75     @Override
  76     public String toString() {
  77         StringBuilder sb = new StringBuilder();


 201     public int getAttempts() {
 202         return attempts;
 203     }
 204 
 205     public void setAttempts(int attempts) {
 206         this.attempts = attempts;
 207     }
 208 
 209     public NMethod getNMethod() {
 210         return nmethod;
 211     }
 212 
 213     public void setNMethod(NMethod NMethod) {
 214         this.nmethod = NMethod;
 215     }
 216 
 217     public ArrayList<Phase> getPhases() {
 218         return phases;
 219     }
 220 




 221     public String getFailureReason() {
 222         return failureReason;
 223     }
 224 
 225     public void setFailureReason(String failureReason) {
 226         this.failureReason = failureReason;
 227     }
 228 
 229     public Method getMethod() {
 230         return method;
 231     }
 232 
 233     public void setMethod(Method method) {
 234         // Don't change method if it is already set to avoid changing
 235         // it by post parse inlining info.
 236         if (getMethod() == null) {
 237             this.method = method;
 238         }
 239     }
 240 
 241     public CallSite getCall() {
 242         return call;




 243     }
 244 
 245     public CallSite getLateInlineCall() {
 246         return lateInlineCall;
 247     }
 248 
 249     public double getElapsedTime() {
 250         return end - start;
 251     }
 252 
 253     public Compilation getCompilation() {
 254         return this;
 255     }
 256 }
src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Compilation.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File