# HG changeset patch # User kvn # Date 1316533180 25200 # Node ID 075ea0ed9e7c792f0ca2e55f45d3aadd0d8107d8 # Parent 5cceda753a4abfd4dd744c5a3e1fc32671629988 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded Summary: Add missing node limit check in IGVN optimizer Reviewed-by: iveresov, never diff -r 5cceda753a4a -r 075ea0ed9e7c make/linux/build.sh --- a/make/linux/build.sh Mon Sep 19 15:21:03 2011 -0700 +++ b/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 diff -r 5cceda753a4a -r 075ea0ed9e7c src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java --- a/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java Mon Sep 19 15:21:03 2011 -0700 +++ b/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 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; + } + } diff -r 5cceda753a4a -r 075ea0ed9e7c src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java --- a/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java Mon Sep 19 15:21:03 2011 -0700 +++ b/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; diff -r 5cceda753a4a -r 075ea0ed9e7c src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java --- a/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java Mon Sep 19 15:21:03 2011 -0700 +++ b/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 and } } 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); } } diff -r 5cceda753a4a -r 075ea0ed9e7c src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Phase.java --- a/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Phase.java Mon Sep 19 15:21:03 2011 -0700 +++ b/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) { diff -r 5cceda753a4a -r 075ea0ed9e7c src/share/vm/opto/phaseX.cpp --- a/src/share/vm/opto/phaseX.cpp Mon Sep 19 15:21:03 2011 -0700 +++ b/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);)