7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
authorkvn
Tue, 20 Sep 2011 08:39:40 -0700
changeset 10563 b9b82ff9f0e9
parent 10562 7d59afed6699
child 10564 db5bf5438c0a
7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded Summary: Add missing node limit check in IGVN optimizer Reviewed-by: iveresov, never
hotspot/make/linux/build.sh
hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java
hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java
hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java
hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Phase.java
hotspot/src/share/vm/opto/phaseX.cpp
--- a/hotspot/make/linux/build.sh	Mon Sep 19 15:21:03 2011 -0700
+++ b/hotspot/make/linux/build.sh	Tue Sep 20 08:39:40 2011 -0700
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,9 @@
   i386|i486|i586|i686)
     mach=i386
     ;;
+  x86_64)
+    mach=amd64
+    ;;
   *)
     echo "Unsupported machine: " `uname -m`
     exit 1
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java	Mon Sep 19 15:21:03 2011 -0700
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java	Tue Sep 20 08:39:40 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,8 @@
     private int receiver_count;
     private String reason;
     private List<CallSite> calls;
+    private int endNodes;
+    private double timeStamp;
 
     CallSite() {
     }
@@ -93,18 +95,22 @@
         emit(stream, indent);
         String m = getMethod().getHolder().replace('/', '.') + "::" + getMethod().getName();
         if (getReason() == null) {
-            stream.println("  @ " + getBci() + " " + m + " (" + getMethod().getBytes() + " bytes)");
+            stream.print("  @ " + getBci() + " " + m + " (" + getMethod().getBytes() + " bytes)");
 
         } else {
             if (isCompat()) {
-                stream.println("  @ " + getBci() + " " + m + " " + getReason());
+                stream.print("  @ " + getBci() + " " + m + " " + getReason());
             } else {
-                stream.println("- @ " + getBci() + " " + m +
+                stream.print("- @ " + getBci() + " " + m +
                         " (" + getMethod().getBytes() + " bytes) " + getReason());
             }
         }
+        if (getEndNodes() > 0) {
+          stream.printf(" (end time: %6.4f nodes: %d)", getTimeStamp(), getEndNodes());
+        }
+        stream.println("");
         if (getReceiver() != null) {
-            emit(stream, indent + 3);
+            emit(stream, indent + 4);
             //                 stream.println("type profile " + method.holder + " -> " + receiver + " (" +
             //                                receiver_count + "/" + count + "," + (receiver_count * 100 / count) + "%)");
             stream.println("type profile " + getMethod().getHolder() + " -> " + getReceiver() + " (" +
@@ -180,4 +186,21 @@
     public static void setCompat(boolean aCompat) {
         compat = aCompat;
     }
+
+    void setEndNodes(int n) {
+        endNodes = n;
+    }
+
+    public int getEndNodes() {
+        return endNodes;
+    }
+
+    void setTimeStamp(double time) {
+        timeStamp = time;
+    }
+
+    public double getTimeStamp() {
+        return timeStamp;
+    }
+
 }
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java	Mon Sep 19 15:21:03 2011 -0700
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java	Tue Sep 20 08:39:40 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -126,7 +126,6 @@
                 maxattempts = Math.max(maxattempts,c.getAttempts());
                 elapsed += c.getElapsedTime();
                 for (Phase phase : c.getPhases()) {
-                    out.printf("\t%s %6.4f\n", phase.getName(), phase.getElapsedTime());
                     Double v = phaseTime.get(phase.getName());
                     if (v == null) {
                         v = Double.valueOf(0.0);
@@ -138,6 +137,7 @@
                         v2 = Integer.valueOf(0);
                     }
                     phaseNodes.put(phase.getName(), Integer.valueOf(v2.intValue() + phase.getNodes()));
+                    out.printf("\t%s %6.4f %d %d\n", phase.getName(), phase.getElapsedTime(), phase.getStartNodes(), phase.getNodes());
                 }
             } else if (e instanceof MakeNotEntrantEvent) {
                 MakeNotEntrantEvent mne = (MakeNotEntrantEvent) e;
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Mon Sep 19 15:21:03 2011 -0700
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Tue Sep 20 08:39:40 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -365,7 +365,7 @@
             if (currentTrap != null) {
                 currentTrap.addJVMS(atts.getValue("method"), Integer.parseInt(atts.getValue("bci")));
             } else {
-                System.err.println("Missing uncommon_trap for jvms");
+                // Ignore <eliminate_allocation type='667'> and <eliminate_lock lock='1'>
             }
         } else if (qname.equals("nmethod")) {
             String id = makeId(atts);
@@ -391,6 +391,11 @@
                     throw new InternalError("call site and parse don't match");
                 }
             }
+        } else if (qname.equals("parse_done")) {
+            CallSite call = scopes.pop();
+            call.setEndNodes(Integer.parseInt(search(atts, "nodes")));
+            call.setTimeStamp(Double.parseDouble(search(atts, "stamp")));
+            scopes.push(call);
         }
     }
 
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Phase.java	Mon Sep 19 15:21:03 2011 -0700
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Phase.java	Tue Sep 20 08:39:40 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
     }
 
     int getNodes() {
-        return getStartNodes();
+        return getEndNodes() - getStartNodes();
     }
 
     void setEndNodes(int n) {
--- a/hotspot/src/share/vm/opto/phaseX.cpp	Mon Sep 19 15:21:03 2011 -0700
+++ b/hotspot/src/share/vm/opto/phaseX.cpp	Tue Sep 20 08:39:40 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -864,6 +864,10 @@
   // Pull from worklist; transform node;
   // If node has changed: update edge info and put uses on worklist.
   while( _worklist.size() ) {
+    if (C->check_node_count(NodeLimitFudgeFactor * 2,
+                            "out of nodes optimizing method")) {
+      return;
+    }
     Node *n  = _worklist.pop();
     if (++loop_count >= K * C->unique()) {
       debug_only(n->dump(4);)