提交 493918a6 编写于 作者: K kvn

7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded

Summary: Add missing node limit check in IGVN optimizer
Reviewed-by: iveresov, never
上级 9a94d408
#! /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 @@ case `uname -m` in
i386|i486|i586|i686)
mach=i386
;;
x86_64)
mach=amd64
;;
*)
echo "Unsupported machine: " `uname -m`
exit 1
......
/*
* 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 @@ public class CallSite {
private int receiver_count;
private String reason;
private List<CallSite> calls;
private int endNodes;
private double timeStamp;
CallSite() {
}
......@@ -93,18 +95,22 @@ public class CallSite {
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 class CallSite {
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;
}
}
/*
* 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 @@ public class LogCompilation extends DefaultHandler implements ErrorHandler, Cons
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 @@ public class LogCompilation extends DefaultHandler implements ErrorHandler, Cons
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;
......
/*
* 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 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
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 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
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);
}
}
......
/*
* 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 @@ public class Phase extends BasicLogEvent {
}
int getNodes() {
return getStartNodes();
return getEndNodes() - getStartNodes();
}
void setEndNodes(int n) {
......
/*
* 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 @@ void PhaseIterGVN::optimize() {
// 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);)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册