# HG changeset patch # User Gilles Duboscq # Date 1309421269 -7200 # Node ID 9ef0777a61d5f42906d4e1ec34162612738f7dc4 # Parent d9fa4309f89e9dfc10959eb1e222259f45b801d3# Parent c49c893c3d27938961d0cfda26a4e6ef9bc32721 Merge diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java Thu Jun 30 10:07:49 2011 +0200 @@ -123,7 +123,7 @@ IdentifyBlocksPhase schedule = null; try { schedule = new IdentifyBlocksPhase(true); - schedule.apply(graph); + schedule.apply(graph, false); } catch (Throwable t) { // nothing to do here... //t.printStackTrace(); diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java Thu Jun 30 10:07:49 2011 +0200 @@ -90,7 +90,7 @@ //printGraph("After DeadCodeElimination", compilation.graph); if (GraalOptions.Inline) { - new InliningPhase(compilation, this, null, GraalOptions.TraceInlining).apply(compilation.graph); + new InliningPhase(compilation, this, null).apply(compilation.graph); } Graph graph = compilation.graph; diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ExceptionObject.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ExceptionObject.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ExceptionObject.java Thu Jun 30 10:07:49 2011 +0200 @@ -29,9 +29,10 @@ /** * The {@code ExceptionObject} instruction represents the incoming exception object to an exception handler. */ -public final class ExceptionObject extends FixedNodeWithNext { +public final class ExceptionObject extends StateSplit { private static final int INPUT_COUNT = 0; + private static final int SUCCESSOR_COUNT = 0; /** diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/NewInstance.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/NewInstance.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/NewInstance.java Thu Jun 30 10:07:49 2011 +0200 @@ -125,7 +125,7 @@ } else if (usage instanceof LoadField) { LoadField x = (LoadField) usage; assert x.object() == node; - return false; + return x.field().isResolved() == false; } else if (usage instanceof StoreField) { StoreField x = (StoreField) usage; return x.value() == node; @@ -193,8 +193,8 @@ if (current instanceof LoadField) { LoadField x = (LoadField) current; if (x.object() == node) { + assert fieldState.get(field) != null : field + ", " + ((AccessField) current).field() + ((AccessField) current).field().hashCode(); for (Node usage : new ArrayList(x.usages())) { - assert fieldState.get(field) != null; usage.inputs().replace(x, fieldState.get(field)); } assert x.usages().size() == 0; diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Phi.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Phi.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Phi.java Thu Jun 30 10:07:49 2011 +0200 @@ -143,7 +143,11 @@ } str.append(valueAt(i) == null ? "-" : valueAt(i).id()); } - return "Phi: (" + str + ")"; + if (isDead()) { + return "Phi: dead (" + str + ")"; + } else { + return "Phi: (" + str + ")"; + } } public void addInput(Node y) { diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java Thu Jun 30 10:07:49 2011 +0200 @@ -310,7 +310,8 @@ } break; } - new InliningPhase(compilation, ir, invokes, GraalOptions.TraceInlining).apply(graph); + new InliningPhase(compilation, ir, invokes).apply(graph); + new DeadCodeEliminationPhase().apply(graph); exits.clear(); invokes.clear(); } while (iterations++ < 3); diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Thu Jun 30 10:07:49 2011 +0200 @@ -436,12 +436,17 @@ p.setStateAfter(frameState.duplicateWithoutStack(bci)); Value currentExceptionObject; + ExceptionObject newObj = null; if (exceptionObject == null) { - currentExceptionObject = new ExceptionObject(graph); + newObj = new ExceptionObject(graph); + currentExceptionObject = newObj; } else { currentExceptionObject = exceptionObject; } FrameState stateWithException = frameState.duplicateWithException(bci, currentExceptionObject); + if (newObj != null) { + newObj.setStateAfter(stateWithException); + } FixedNode target = createTarget(dispatchBlock, stateWithException); if (exceptionObject == null) { ExceptionObject eObj = (ExceptionObject) currentExceptionObject; diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Thu Jun 30 10:07:49 2011 +0200 @@ -39,29 +39,18 @@ public class InliningPhase extends Phase { - public static HashMap methodCount = new HashMap(); + public static final HashMap methodCount = new HashMap(); private final GraalCompilation compilation; private final IR ir; - private final Queue invokes = new ArrayDeque(); - private final Queue methods = new ArrayDeque(); - private int inliningSize; - private final boolean trace; private final Collection hints; - public InliningPhase(GraalCompilation compilation, IR ir, Collection hints, boolean trace) { + public InliningPhase(GraalCompilation compilation, IR ir, Collection hints) { this.compilation = compilation; this.ir = ir; this.hints = hints; - this.trace = trace; - } - - private void addToQueue(Invoke invoke, RiMethod method) { - invokes.add(invoke); - methods.add(method); - inliningSize += method.codeSize(); } private Queue newInvokes = new ArrayDeque(); @@ -87,42 +76,40 @@ newInvokes = new ArrayDeque(); for (Invoke invoke : queue) { if (!invoke.isDeleted()) { - inlineInvoke(invoke, iterations, ratio); - if (inliningSize > GraalOptions.MaximumInstructionCount) { - break; + RiMethod code = inlineInvoke(invoke, iterations, ratio); + if (code != null) { + inliningSize += code.codeSize(); + if (inliningSize > GraalOptions.MaximumInstructionCount) { + break; + } + + inlineMethod(invoke, code); + if (GraalOptions.TraceInlining) { + if (methodCount.get(code) == null) { + methodCount.put(code, 1); + } else { + methodCount.put(code, methodCount.get(code) + 1); + } + } } } } - - assert invokes.size() == methods.size(); - if (invokes.isEmpty()) { - break; - } - - Invoke invoke; - while ((invoke = invokes.poll()) != null) { - RiMethod method = methods.remove(); - inlineMethod(invoke, method); - - if (methodCount.get(method) == null) { - methodCount.put(method, 1); - } else { - methodCount.put(method, methodCount.get(method) + 1); - } - } - DeadCodeEliminationPhase dce = new DeadCodeEliminationPhase(); - dce.apply(graph); - if (inliningSize > GraalOptions.MaximumInstructionCount) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("inlining stopped: MaximumInstructionCount reached"); } break; } + if (newInvokes.isEmpty()) { + break; + } + +// new DeadCodeEliminationPhase().apply(graph); + ratio *= GraalOptions.MaximumInlineRatio; } - if (trace) { + if (GraalOptions.TraceInlining) { int inlined = 0; int duplicate = 0; for (Map.Entry entry : methodCount.entrySet()) { @@ -135,55 +122,80 @@ } } - private void inlineInvoke(Invoke invoke, int iterations, float ratio) { + private RiMethod inlineInvoke(Invoke invoke, int iterations, float ratio) { RiMethod parent = invoke.stateAfter().method(); RiTypeProfile profile = parent.typeProfile(invoke.bci); if (!checkInvokeConditions(invoke)) { - return; + return null; } if (invoke.opcode() == Bytecodes.INVOKESPECIAL || invoke.target.canBeStaticallyBound()) { if (checkTargetConditions(invoke.target, iterations) && checkSizeConditions(invoke.target, invoke, profile, ratio)) { - addToQueue(invoke, invoke.target); + return invoke.target; + } + return null; + } + if (invoke.receiver().exactType() != null) { + RiType exact = invoke.receiver().exactType(); + assert exact.isSubtypeOf(invoke.target().holder()) : exact + " subtype of " + invoke.target().holder(); + RiMethod resolved = exact.resolveMethodImpl(invoke.target()); + if (checkTargetConditions(resolved, iterations) && checkSizeConditions(resolved, invoke, profile, ratio)) { + return resolved; + } + return null; + } + RiType holder = invoke.target().holder(); + + if (invoke.receiver().declaredType() != null) { + RiType declared = invoke.receiver().declaredType(); + // the invoke target might be more specific than the holder (happens after inlining: locals lose their declared type...) + // TODO (ls) fix this + if (declared.isResolved() && declared.isSubtypeOf(invoke.target().holder())) { + holder = declared; + } + } + + RiMethod concrete = holder.uniqueConcreteMethod(invoke.target); + if (concrete != null) { + if (checkTargetConditions(concrete, iterations) && checkSizeConditions(concrete, invoke, profile, ratio)) { + if (GraalOptions.TraceInlining) { + String targetName = CiUtil.format("%H.%n(%p):%r", invoke.target, false); + String concreteName = CiUtil.format("%H.%n(%p):%r", concrete, false); + TTY.println("recording concrete method assumption: %s -> %s", targetName, concreteName); + } + compilation.assumptions.recordConcreteMethod(invoke.target, concrete); + return concrete; + } + return null; + } + if (profile != null && profile.probabilities != null && profile.probabilities.length > 0 && profile.morphism == 1) { + if (GraalOptions.InlineWithTypeCheck) { + // type check and inlining... + concrete = profile.types[0].resolveMethodImpl(invoke.target); + if (concrete != null && checkTargetConditions(concrete, iterations) && checkSizeConditions(concrete, invoke, profile, ratio)) { + IsType isType = new IsType(invoke.receiver(), profile.types[0], compilation.graph); + FixedGuard guard = new FixedGuard(graph); + guard.setNode(isType); + assert invoke.predecessors().size() == 1; + invoke.predecessors().get(0).successors().replace(invoke, guard); + guard.setNext(invoke); + + if (GraalOptions.TraceInlining) { + TTY.println("inlining with type check, type probability: %5.3f", profile.probabilities[0]); + } + return concrete; + } + return null; + } else { + if (GraalOptions.TraceInlining) { + TTY.println("not inlining %s because GraalOptions.InlineWithTypeCheck == false", methodName(invoke.target, invoke)); + } + return null; } } else { - RiMethod concrete = invoke.target.holder().uniqueConcreteMethod(invoke.target); - if (concrete != null) { - if (checkTargetConditions(concrete, iterations) && checkSizeConditions(concrete, invoke, profile, ratio)) { - if (trace) { - String targetName = CiUtil.format("%H.%n(%p):%r", invoke.target, false); - String concreteName = CiUtil.format("%H.%n(%p):%r", concrete, false); - TTY.println("recording concrete method assumption: %s -> %s", targetName, concreteName); - } - compilation.assumptions.recordConcreteMethod(invoke.target, concrete); - addToQueue(invoke, concrete); - } - } else if (profile != null && profile.probabilities != null && profile.probabilities.length > 0 && profile.morphism == 1) { - if (GraalOptions.InlineWithTypeCheck) { - // type check and inlining... - concrete = profile.types[0].resolveMethodImpl(invoke.target); - if (concrete != null && checkTargetConditions(concrete, iterations) && checkSizeConditions(concrete, invoke, profile, ratio)) { - IsType isType = new IsType(invoke.receiver(), profile.types[0], compilation.graph); - FixedGuard guard = new FixedGuard(graph); - guard.setNode(isType); - assert invoke.predecessors().size() == 1; - invoke.predecessors().get(0).successors().replace(invoke, guard); - guard.setNext(invoke); - - if (trace) { - TTY.println("inlining with type check, type probability: %5.3f", profile.probabilities[0]); - } - addToQueue(invoke, concrete); - } - } else { - if (trace) { - TTY.println("not inlining %s because GraalOptions.InlineWithTypeCheck is false", methodName(invoke.target, invoke)); - } - } - } else { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because no monomorphic receiver could be found", methodName(invoke.target, invoke)); } - } + return null; } } @@ -202,31 +214,31 @@ private boolean checkInvokeConditions(Invoke invoke) { if (invoke.stateAfter() == null) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because the invoke has no after state", methodName(invoke.target, invoke)); } return false; } if (invoke.stateAfter().locksSize() > 0) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because of locks", methodName(invoke.target, invoke)); } return false; } if (!invoke.target.isResolved()) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because the invoke target is unresolved", methodName(invoke.target, invoke)); } return false; } if (invoke.predecessors().size() == 0) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because the invoke is dead code", methodName(invoke.target, invoke)); } return false; } if (invoke.stateAfter() == null) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because of missing frame state", methodName(invoke.target, invoke)); } } @@ -235,31 +247,31 @@ private boolean checkTargetConditions(RiMethod method, int iterations) { if (!method.isResolved()) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because it is unresolved", methodName(method)); } return false; } if (Modifier.isNative(method.accessFlags())) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because it is a native method", methodName(method)); } return false; } if (Modifier.isAbstract(method.accessFlags())) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because it is an abstract method", methodName(method)); } return false; } if (!method.holder().isInitialized()) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because of non-initialized class", methodName(method)); } return false; } if (method == compilation.method && iterations > GraalOptions.MaximumRecursiveInlineLevel) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because of recursive inlining limit", methodName(method)); } return false; @@ -273,7 +285,7 @@ maximumSize = GraalOptions.MaximumFreqInlineSize; } if (method.codeSize() > maximumSize) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because of code size (size: %d, max size: %d)", methodName(method, invoke), method.codeSize(), GraalOptions.MaximumInlineSize); } return false; @@ -297,12 +309,12 @@ maximumSize = GraalOptions.MaximumFreqInlineSize; } if (method.codeSize() > maximumSize) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because of code size (size: %d, max size: %d, ratio %5.3f, %s)", methodName(method, invoke), method.codeSize(), maximumSize, ratio, profile); } return false; } - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("inlining %s (size: %d, max size: %d, ratio %5.3f, %s)", methodName(method, invoke), method.codeSize(), maximumSize, ratio, profile); } return true; @@ -318,12 +330,12 @@ CompilerGraph graph; Object stored = GraphBuilderPhase.cachedGraphs.get(method); if (stored != null) { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("Reusing graph for %s, locals: %d, stack: %d", methodName(method, invoke), method.maxLocals(), method.maxStackSize()); } graph = (CompilerGraph) stored; } else { - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("Building graph for %s, locals: %d, stack: %d", methodName(method, invoke), method.maxLocals(), method.maxStackSize()); } graph = new CompilerGraph(null); @@ -369,7 +381,7 @@ } } - if (trace) { + if (GraalOptions.TraceInlining) { TTY.println("inlining %s: %d frame states, %d nodes", methodName(method), frameStates.size(), nodes.size()); } @@ -458,7 +470,7 @@ } } - if (trace) { + if (GraalOptions.TraceInlining) { ir.printGraph("After inlining " + CiUtil.format("%H.%n(%p):%r", method, false), compilation.graph); } } diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java Thu Jun 30 10:07:49 2011 +0200 @@ -48,6 +48,10 @@ } public final void apply(Graph graph) { + apply(graph, true); + } + + public final void apply(Graph graph, boolean plotOnError) { assert graph != null && (!shouldVerify || graph.verify()); int startDeletedNodeCount = graph.getDeletedNodeCount(); @@ -66,13 +70,13 @@ run(graph); } catch (AssertionError t) { GraalCompilation compilation = GraalCompilation.compilation(); - if (compilation.compiler.isObserved() && this.getClass() != IdentifyBlocksPhase.class) { + if (compilation.compiler.isObserved() && plotOnError) { compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "AssertionError in " + getName(), graph, true, false, true)); } throw t; } catch (RuntimeException t) { GraalCompilation compilation = GraalCompilation.compilation(); - if (compilation.compiler.isObserved() && this.getClass() != IdentifyBlocksPhase.class) { + if (compilation.compiler.isObserved() && plotOnError) { compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "RuntimeException in " + getName(), graph, true, false, true)); } throw t; diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/IdentifyBlocksPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/IdentifyBlocksPhase.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/IdentifyBlocksPhase.java Thu Jun 30 10:07:49 2011 +0200 @@ -125,6 +125,7 @@ break; } currentNode = currentNode.singlePredecessor(); + assert !currentNode.isDeleted(); } } } diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/value/FrameStateBuilder.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/value/FrameStateBuilder.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/value/FrameStateBuilder.java Thu Jun 30 10:07:49 2011 +0200 @@ -509,7 +509,7 @@ } public FrameState duplicateWithoutStack(int bci) { - FrameState frameState = new FrameState(method, bci, locals, new Value[0], 0, locks, true, graph); + FrameState frameState = new FrameState(method, bci, locals, new Value[0], 0, locks, false, graph); frameState.setOuterFrameState(outerFrameState()); return frameState; } diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotField.java --- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotField.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotField.java Thu Jun 30 10:07:49 2011 +0200 @@ -95,18 +95,18 @@ return holder; } - @Override - public boolean equals(Object obj) { - if (obj instanceof HotSpotField) { - HotSpotField other = (HotSpotField) obj; - return other.offset == offset && other.holder.equals(holder()); - } - return false; - } +// @Override +// public boolean equals(Object obj) { +// if (obj instanceof HotSpotField) { +// HotSpotField other = (HotSpotField) obj; +// return other.offset == offset && other.holder.equals(holder()); +// } +// return false; +// } @Override public boolean isResolved() { - return offset != -1; + return holder.isResolved(); } @Override @@ -130,7 +130,7 @@ @Override public String toString() { - return "HotSpotField<" + holder.name() + "." + name + ">"; + return "HotSpotField<" + holder.name() + "." + name + ":" + offset + ">"; } } diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotTypeResolvedImpl.java --- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotTypeResolvedImpl.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotTypeResolvedImpl.java Thu Jun 30 10:07:49 2011 +0200 @@ -48,6 +48,7 @@ private RiConstantPool pool; private RiType superType; private boolean superTypeSet; + private RiField[] fields; private HotSpotTypeResolvedImpl() { super(null); @@ -224,6 +225,9 @@ @Override public RiField[] fields() { - return compiler.getVMEntries().RiType_fields(this); + if (fields == null) { + fields = compiler.getVMEntries().RiType_fields(this); + } + return fields; } } diff -r d9fa4309f89e -r 9ef0777a61d5 graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotXirGenerator.java --- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotXirGenerator.java Thu Jun 30 10:07:35 2011 +0200 +++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotXirGenerator.java Thu Jun 30 10:07:49 2011 +0200 @@ -1043,7 +1043,6 @@ asm.pload(CiKind.Object, objHub, object, asm.i(config.hubOffset), false); // if we get an exact match: continue asm.jneq(slowPath, objHub, hub); - asm.shouldNotReachHere(); // -- out of line ------------------------------------------------------- asm.bindOutOfLine(slowPath); diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalSlotFilter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalSlotFilter.java Thu Jun 30 10:07:49 2011 +0200 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package com.sun.hotspot.igv.graal.filters; + +import com.sun.hotspot.igv.filter.AbstractFilter; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.graph.Slot; +import java.util.ArrayList; +import java.util.List; + +/** + * Filter that hides slots with no connections. + */ +public class GraalSlotFilter extends AbstractFilter { + + public GraalSlotFilter() { + } + + public String getName() { + return "Graal Slot Filter"; + } + + public void apply(Diagram d) { + List
figures = d.getFigures(); + for (Figure f : figures) { + List remove = new ArrayList(); + for (InputSlot is : f.getInputSlots()) { + if (is.getConnections().isEmpty()) { + remove.add(is); + } + } + for (OutputSlot os : f.getOutputSlots()) { + if (os.getConnections().isEmpty()) { + remove.add(os); + } + } + for (Slot s : remove) { + f.removeSlot(s); + } + } + } +} diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/slots.filter --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/slots.filter Thu Jun 30 10:07:49 2011 +0200 @@ -0,0 +1,2 @@ +var f = new com.sun.hotspot.igv.graal.filters.GraalSlotFilter(); +f.apply(graph); diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/layer.xml --- a/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/layer.xml Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/layer.xml Thu Jun 30 10:07:49 2011 +0200 @@ -9,5 +9,9 @@ + + + + diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/genfiles.properties --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/genfiles.properties Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/genfiles.properties Thu Jun 30 10:07:49 2011 +0200 @@ -1,5 +1,5 @@ # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=ac7a776e +nbproject/build-impl.xml.data.CRC32=f0880ef0 nbproject/build-impl.xml.script.CRC32=9388e04e nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45.1 diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/project.xml --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/project.xml Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/project.xml Thu Jun 30 10:07:49 2011 +0200 @@ -63,6 +63,15 @@ + org.netbeans.modules.diff + + + + 1 + 1.32.1.42.1 + + + org.openide.util diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponent.form --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponent.form Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponent.form Thu Jun 30 10:07:49 2011 +0200 @@ -1,4 +1,4 @@ - +
diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponent.java --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponent.java Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponent.java Thu Jun 30 10:07:49 2011 +0200 @@ -24,24 +24,36 @@ package com.sun.hotspot.igv.graphtexteditor; import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.data.Properties; import com.sun.hotspot.igv.texteditor.*; import com.sun.hotspot.igv.data.InputGraph; import com.sun.hotspot.igv.data.Pair; +import com.sun.hotspot.igv.data.Property; import com.sun.hotspot.igv.graph.Diagram; import com.sun.hotspot.igv.graph.services.DiagramProvider; import com.sun.hotspot.igv.graphtotext.services.GraphToTextConverter; import com.sun.hotspot.igv.selectioncoordinator.SelectionCoordinator; +import com.sun.hotspot.igv.structuredtext.MultiElement; import com.sun.hotspot.igv.structuredtext.StructuredText; import com.sun.hotspot.igv.util.LookupHistory; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.io.IOException; import java.io.Serializable; +import java.io.StringReader; import java.util.Collection; import java.util.logging.Logger; +import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSplitPane; +import javax.swing.JToolBar; +import org.netbeans.api.diff.Diff; +import org.netbeans.api.diff.DiffView; +import org.netbeans.api.diff.StreamSource; import org.openide.util.Lookup; import org.openide.util.LookupEvent; import org.openide.util.LookupListener; @@ -52,6 +64,7 @@ /** * @author Thomas Wuerthinger + * @author Peter Hofer */ final class TextTopComponent extends TopComponent implements LookupListener { @@ -65,12 +78,17 @@ private JSplitPane splitPane; private CardLayout cardLayout; private JPanel cardLayoutPanel; + private JComboBox sourceCombo; private boolean firstTimeSlider = true; + private JPanel textDiffPanel; + private static final String TWO_GRAPHS_TEXT_DIFF = "twoGraphsTextDiff"; private static final String TWO_GRAPHS = "twoGraphs"; private static final String ONE_GRAPH = "oneGraph"; private static final String NO_GRAPH = "noGraph"; + private static final String GRAPH_TEXT_REPRESENTATION = "< Graph Text Representation >"; + private DiagramProvider currentDiagramProvider; private TextTopComponent() { @@ -78,16 +96,28 @@ setName(NbBundle.getMessage(TextTopComponent.class, "CTL_TextTopComponent")); setToolTipText(NbBundle.getMessage(TextTopComponent.class, "HINT_TextTopComponent")); + setLayout(new BorderLayout()); + + // Selector for displayed data + JToolBar sourceSelectBar = new JToolBar(); + sourceSelectBar.setLayout(new BorderLayout()); + sourceSelectBar.setFloatable(false); + sourceSelectBar.add(new JLabel("Show: "), BorderLayout.WEST); + sourceCombo = new JComboBox(); + sourceCombo.addItem(GRAPH_TEXT_REPRESENTATION); + sourceCombo.addItemListener(sourceSelectionListener); + sourceSelectBar.add(sourceCombo, BorderLayout.CENTER); + add(sourceSelectBar, BorderLayout.NORTH); + // Card layout for three different views. cardLayout = new CardLayout(); cardLayoutPanel = new JPanel(cardLayout); - this.setLayout(new BorderLayout()); - this.add(cardLayoutPanel, BorderLayout.CENTER); + add(cardLayoutPanel, BorderLayout.CENTER); // No graph selected. - JLabel noGraphLabel = new JLabel("No graph opened"); - noGraphLabel.setBackground(Color.red); - //noGraphPanel.add(noGraphLabel); + JLabel noGraphLabel = new JLabel("No graph open.", JLabel.CENTER); + noGraphLabel.setOpaque(true); + noGraphLabel.setBackground(Color.WHITE); cardLayoutPanel.add(noGraphLabel, NO_GRAPH); // Single graph selected. @@ -101,6 +131,11 @@ rightEditor = new TextEditor(); splitPane.setRightComponent(rightEditor.getComponent()); cardLayoutPanel.add(splitPane, TWO_GRAPHS); + + // Text difference => NetBeans diff view + // Diff component is created and added on demand + textDiffPanel = new JPanel(new BorderLayout()); + cardLayoutPanel.add(textDiffPanel, TWO_GRAPHS_TEXT_DIFF); } @@ -129,15 +164,100 @@ return text; } - private void updateDiagram(Diagram diagram) { + private StructuredText createStructuredPlainText(String name, String text) { + StructuredText structured = new StructuredText(name); + MultiElement multi = new MultiElement(); + multi.print(text); + structured.addChild(multi); + return structured; + } + private ItemListener sourceSelectionListener = new ItemListener() { + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + if (e.getItem() == GRAPH_TEXT_REPRESENTATION) { + displayDiagram(lastDiagram); + } else { + displayGroupProperty(lastDiagram, (String) e.getItem()); + } + } + } + }; + + private void setDiagram(Diagram diagram) { if (diagram == lastDiagram) { // No change => return. return; } - lastDiagram = diagram; + // Rebuild combobox choices + Object selection = sourceCombo.getSelectedItem(); + sourceCombo.removeAllItems(); + sourceCombo.addItem(GRAPH_TEXT_REPRESENTATION); + if (diagram != null) { + if (diagram.getGraph().getSourceGraphs() != null) { + // Diff graph with source graphs with possibly different groups: + // show properties from both graphs + Pair sourceGraphs = diagram.getGraph().getSourceGraphs(); + Properties props = new Properties(sourceGraphs.getLeft().getGroup().getProperties()); + if (sourceGraphs.getLeft().getGroup() != sourceGraphs.getRight().getGroup()) { + props.add(sourceGraphs.getRight().getGroup().getProperties()); + } + for (Property p : props) { + sourceCombo.addItem(p.getName()); + } + } else { + // Single graph + for (Property p : diagram.getGraph().getGroup().getProperties()) { + sourceCombo.addItem(p.getName()); + } + } + } + // NOTE: The following triggers a display update. + sourceCombo.setSelectedItem(selection); + if (sourceCombo.getSelectedItem() == null) { + // previously selected property doesn't exist in new graph's group: + // default to show graph representation + sourceCombo.setSelectedItem(GRAPH_TEXT_REPRESENTATION); + } + } + + private void displayGroupProperty(Diagram diagram, String property) { + if (diagram == null) { + showCard(NO_GRAPH); + } else if (diagram.getGraph().getSourceGraphs() != null) { + showCard(TWO_GRAPHS_TEXT_DIFF); + textDiffPanel.removeAll(); + try { + Pair sourceGraphs = diagram.getGraph().getSourceGraphs(); + + String ltext = sourceGraphs.getLeft().getGroup().getProperties().get(property); + if (ltext == null) { + ltext = ""; + } + StreamSource leftsrc = StreamSource.createSource("left", sourceGraphs.getLeft().getName(), "text/plain", new StringReader(ltext)); + + String rtext = sourceGraphs.getRight().getGroup().getProperties().get(property); + if (rtext == null) { + rtext = ""; + } + StreamSource rightsrc = StreamSource.createSource("right", sourceGraphs.getRight().getName(), "text/plain", new StringReader(rtext)); + + DiffView view = Diff.getDefault().createDiff(leftsrc, rightsrc); + textDiffPanel.add(view.getComponent(), BorderLayout.CENTER); + } catch (IOException e) { + throw new RuntimeException(e); + } + textDiffPanel.revalidate(); // required when card was visible before + } else { + showCard(ONE_GRAPH); + String text = diagram.getGraph().getGroup().getProperties().get(property); + singleEditor.setStructuredText(createStructuredPlainText(diagram.getGraph().getName(), text)); + } + } + + private void displayDiagram(Diagram diagram) { if (diagram == null) { showCard(NO_GRAPH); } else if (diagram.getGraph().getSourceGraphs() != null) { @@ -161,11 +281,11 @@ SelectionCoordinator.getInstance().getHighlightedChangedEvent().fire(); } } - + private ChangedListener diagramChangedListener = new ChangedListener() { public void changed(DiagramProvider source) { - updateDiagram(source.getDiagram()); + setDiagram(source.getDiagram()); } }; @@ -184,9 +304,9 @@ if (currentDiagramProvider != null) { currentDiagramProvider.getChangedEvent().addListener(diagramChangedListener); - updateDiagram(currentDiagramProvider.getDiagram()); + setDiagram(currentDiagramProvider.getDiagram()); } else { - updateDiagram(null); + setDiagram(null); } } diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java --- a/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java Thu Jun 30 10:07:49 2011 +0200 @@ -530,9 +530,11 @@ } }; private static final Comparator nodeProcessingDownComparator = new Comparator() { - public int compare(LayoutNode n1, LayoutNode n2) { if (n1.vertex == null) { + if (n2.vertex == null) { + return 0; + } return -1; } if (n2.vertex == null) { @@ -545,6 +547,9 @@ public int compare(LayoutNode n1, LayoutNode n2) { if (n1.vertex == null) { + if (n2.vertex == null) { + return 0; + } return -1; } if (n2.vertex == null) { diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/Text Editor/build/classes/at/ssw/visualizer/texteditor/Bundle.properties --- a/src/share/tools/IdealGraphVisualizer/Text Editor/build/classes/at/ssw/visualizer/texteditor/Bundle.properties Thu Jun 30 10:07:35 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -OpenIDE-Module-Name=Text Editor diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/Text Editor/build/classes/at/ssw/visualizer/texteditor/layer.xml --- a/src/share/tools/IdealGraphVisualizer/Text Editor/build/classes/at/ssw/visualizer/texteditor/layer.xml Thu Jun 30 10:07:35 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/Text Editor/build/classes/at/ssw/visualizer/texteditor/preferences.xml --- a/src/share/tools/IdealGraphVisualizer/Text Editor/build/classes/at/ssw/visualizer/texteditor/preferences.xml Thu Jun 30 10:07:35 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/Text Editor/build/depcache/dependencies.txt --- a/src/share/tools/IdealGraphVisualizer/Text Editor/build/depcache/dependencies.txt Thu Jun 30 10:07:35 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,282 +0,0 @@ -||:at.ssw.visualizer.texteditor.Editor -at.ssw.visualizer.core.selection.SelectionManager -at.ssw.visualizer.core.selection.SelectionProvider -org.openide.text.CloneableEditor -javax.swing.JEditorPane -at.ssw.visualizer.texteditor.Editor$2 -at.ssw.visualizer.texteditor.Editor$1 -at.ssw.visualizer.core.selection.Selection -at.ssw.visualizer.texteditor.Editor -at.ssw.visualizer.texteditor.EditorSupport -||:at.ssw.visualizer.texteditor.EditorSupport -java.lang.StringBuilder -java.lang.UnsupportedOperationException -org.openide.windows.CloneableOpenSupport$Env -org.openide.text.CloneableEditorSupport -at.ssw.visualizer.texteditor.EditorSupport$Env -javax.swing.text.StyledDocument -org.openide.windows.CloneableOpenSupport -at.ssw.visualizer.texteditor.model.Text -org.openide.cookies.EditorCookie$Observable -com.sun.hotspot.igv.data.InputGraph -org.openide.cookies.EditCookie -org.openide.cookies.EditorCookie -org.openide.text.CloneableEditorSupport$Env -at.ssw.visualizer.texteditor.EditorSupport -com.sun.hotspot.igv.data.Group -||:at.ssw.visualizer.texteditor.fold.FoldManager$SideBarFactory -java.lang.Object -at.ssw.visualizer.texteditor.fold.FoldManager$SideBarFactory -org.netbeans.editor.SideBarFactory -at.ssw.visualizer.texteditor.fold.FoldManager -org.netbeans.editor.CodeFoldingSideBar -||:at.ssw.visualizer.texteditor.model.FoldingRegion -at.ssw.visualizer.texteditor.model.FoldingRegion -at.ssw.visualizer.texteditor.model.TextRegion -||:at.ssw.visualizer.texteditor.tooltip.StyledToolTip -java.awt.Color -javax.swing.border.LineBorder -java.awt.BorderLayout -java.lang.StringBuilder -java.awt.Dimension -at.ssw.visualizer.texteditor.tooltip.StyledToolTip -javax.swing.JEditorPane -javax.swing.JPanel -||:at.ssw.visualizer.texteditor.model.TextRegion -java.lang.Object -at.ssw.visualizer.texteditor.model.TextRegion -||:at.ssw.visualizer.texteditor.view.AbstractTextViewTopComponent$1 -java.lang.Object -at.ssw.visualizer.texteditor.view.AbstractTextViewTopComponent -at.ssw.visualizer.texteditor.view.AbstractTextViewTopComponent$1 -javax.swing.event.ChangeListener -||:at.ssw.visualizer.texteditor.model.TextBuilder -java.lang.StringBuilder -com.sun.hotspot.igv.data.InputBlock -java.util.HashSet -java.util.Set -java.util.List -java.util.ArrayList -at.ssw.visualizer.texteditor.model.Text -at.ssw.visualizer.texteditor.model.TextBuilder -java.util.Iterator -java.util.HashMap -java.util.Map -[Lat.ssw.visualizer.texteditor.model.FoldingRegion; -at.ssw.visualizer.texteditor.model.FoldingRegion -java.lang.Object -java.lang.String -||:at.ssw.visualizer.texteditor.view.AbstractTextViewTopComponent -at.ssw.visualizer.texteditor.view.AbstractTextViewTopComponent -javax.swing.JScrollPane -at.ssw.visualizer.core.selection.SelectionManager -javax.swing.JEditorPane -javax.swing.BorderFactory -java.awt.BorderLayout -com.sun.hotspot.igv.data.InputGraph -[Lcom.sun.hotspot.igv.data.InputBlock; -at.ssw.visualizer.core.selection.Selection -org.openide.windows.TopComponent -at.ssw.visualizer.texteditor.view.AbstractTextViewTopComponent$1 -java.util.Arrays -||:at.ssw.visualizer.texteditor.tooltip.ToolTipAction -at.ssw.visualizer.texteditor.model.Scanner -org.netbeans.editor.PopupManager -org.netbeans.editor.Utilities -org.netbeans.editor.TokenID -org.netbeans.editor.PopupManager$HorizontalBounds -org.netbeans.modules.editor.NbEditorKit$NbBuildToolTipAction -org.netbeans.editor.BaseDocument -org.netbeans.editor.EditorUI -at.ssw.visualizer.texteditor.model.Text -javax.swing.plaf.TextUI -java.awt.event.MouseEvent -org.netbeans.modules.editor.NbEditorKit -org.netbeans.editor.ext.ToolTipSupport -at.ssw.visualizer.texteditor.tooltip.ToolTipAction -javax.swing.text.JTextComponent -at.ssw.visualizer.texteditor.tooltip.StyledToolTip -org.netbeans.editor.PopupManager$Placement -||:at.ssw.visualizer.texteditor.fold.FoldManager$FoldManagerFactory -java.lang.Object -org.netbeans.spi.editor.fold.FoldManagerFactory -at.ssw.visualizer.texteditor.fold.FoldManager$FoldManagerFactory -at.ssw.visualizer.texteditor.fold.FoldManager -||:at.ssw.visualizer.core.selection.Selection -[Ljavax.swing.event.ChangeListener; -at.ssw.visualizer.core.selection.Selection$1 -javax.swing.event.ChangeListener -java.util.List -java.util.ArrayList -at.ssw.visualizer.core.selection.SelectionManager -java.lang.Class -java.util.HashMap -java.util.Map -javax.swing.event.ChangeEvent -at.ssw.visualizer.core.selection.Selection -java.lang.Object -javax.swing.Timer -||:at.ssw.visualizer.texteditor.model.BlockRegion -at.ssw.visualizer.texteditor.model.BlockRegion -at.ssw.visualizer.texteditor.model.TextRegion -||:at.ssw.visualizer.texteditor.highlight.HighlightsContainer$HighlightsLayerFactory -at.ssw.visualizer.texteditor.highlight.HighlightsContainer -at.ssw.visualizer.texteditor.model.Text -org.netbeans.spi.editor.highlighting.HighlightsLayerFactory -org.netbeans.spi.editor.highlighting.HighlightsLayer -java.lang.Object -javax.swing.text.Document -org.netbeans.spi.editor.highlighting.ZOrder -org.netbeans.spi.editor.highlighting.HighlightsLayerFactory$Context -at.ssw.visualizer.texteditor.highlight.HighlightsContainer$HighlightsLayerFactory -||:at.ssw.visualizer.texteditor.highlight.HighlightsContainer -javax.swing.text.JTextComponent -org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer -org.netbeans.api.editor.mimelookup.MimeLookup -org.openide.util.WeakListeners -org.netbeans.api.editor.mimelookup.MimePath -javax.swing.text.SimpleAttributeSet -at.ssw.visualizer.texteditor.highlight.HighlightsContainer$HighlightsLayerFactory -org.openide.util.Lookup -javax.swing.event.CaretListener -at.ssw.visualizer.texteditor.highlight.HighlightsContainer -at.ssw.visualizer.texteditor.model.Text -at.ssw.visualizer.texteditor.model.Scanner -org.netbeans.api.editor.settings.FontColorSettings -at.ssw.visualizer.texteditor.highlight.HighlightsContainer$1 -javax.swing.text.Caret -org.netbeans.editor.TokenID -at.ssw.visualizer.texteditor.highlight.HighlightsContainer$RegionSequence -javax.swing.text.Document -||:at.ssw.visualizer.core.selection.Selection$1 -java.lang.Object -at.ssw.visualizer.core.selection.Selection -at.ssw.visualizer.core.selection.Selection$1 -java.awt.event.ActionListener -||:at.ssw.visualizer.texteditor.model.HoverParser -java.lang.Object -java.util.Iterator -java.lang.String -java.lang.StringBuilder -java.lang.UnsupportedOperationException -at.ssw.visualizer.texteditor.model.HoverParser -||:at.ssw.visualizer.texteditor.Editor$2 -at.ssw.visualizer.texteditor.Editor -java.util.ArrayList -javax.swing.event.CaretEvent -java.util.List -[Lcom.sun.hotspot.igv.data.InputBlock; -com.sun.hotspot.igv.data.InputBlock -java.util.Map -java.util.Collection -at.ssw.visualizer.core.selection.Selection -at.ssw.visualizer.texteditor.model.BlockRegion -java.util.Iterator -javax.swing.event.CaretListener -at.ssw.visualizer.texteditor.Editor$2 -at.ssw.visualizer.texteditor.model.Text -java.lang.Math -java.lang.Object -javax.swing.JEditorPane -javax.swing.text.Document -||:at.ssw.visualizer.texteditor.EditorSupport$Env -java.lang.UnsupportedOperationException -org.openide.text.CloneableEditorSupport -at.ssw.visualizer.texteditor.EditorSupport$Env -java.beans.VetoableChangeSupport -at.ssw.visualizer.texteditor.model.Text -java.io.ByteArrayInputStream -java.io.IOException -java.lang.Object -at.ssw.visualizer.texteditor.EditorSupport -org.openide.text.CloneableEditorSupport$Env -java.beans.PropertyChangeSupport -java.lang.String -||:at.ssw.visualizer.texteditor.Editor$1 -java.lang.Math -at.ssw.visualizer.texteditor.model.BlockRegion -javax.swing.event.ChangeListener -at.ssw.visualizer.texteditor.model.Text -javax.swing.JEditorPane -java.util.Map -[Lcom.sun.hotspot.igv.data.InputBlock; -at.ssw.visualizer.texteditor.Editor$1 -at.ssw.visualizer.core.selection.Selection -java.lang.Object -javax.swing.text.Document -at.ssw.visualizer.texteditor.Editor -java.util.Arrays -||:at.ssw.visualizer.texteditor.model.Text -java.lang.String -[Lat.ssw.visualizer.texteditor.model.TextRegion; -java.lang.Object -java.util.Iterator -java.util.Map -java.util.Set -at.ssw.visualizer.texteditor.model.Text -at.ssw.visualizer.texteditor.model.TextRegion -||:at.ssw.visualizer.core.selection.SelectionProvider -java.lang.Object -at.ssw.visualizer.core.selection.SelectionProvider -||:at.ssw.visualizer.texteditor.EditorKit -javax.swing.Action -at.ssw.visualizer.texteditor.tooltip.ToolTipAction -at.ssw.visualizer.texteditor.EditorKit -org.netbeans.modules.editor.NbEditorKit -javax.swing.text.TextAction -||:at.ssw.visualizer.core.selection.SelectionManager -at.ssw.visualizer.core.selection.Selection -java.lang.Object -at.ssw.visualizer.core.selection.SelectionManager -||:at.ssw.visualizer.texteditor.model.Scanner -at.ssw.visualizer.texteditor.model.Scanner -javax.swing.text.BadLocationException -java.lang.Math -java.util.Set -java.util.BitSet -java.lang.Class -java.util.logging.Level -java.util.logging.Logger -javax.swing.text.Document -java.lang.String -org.netbeans.editor.Syntax -||:at.ssw.visualizer.texteditor.fold.FoldManager -at.ssw.visualizer.texteditor.fold.FoldManager$FoldManagerFactory -javax.swing.text.BadLocationException -at.ssw.visualizer.texteditor.fold.FoldManager -org.netbeans.api.editor.fold.FoldType -at.ssw.visualizer.texteditor.fold.FoldManager$SideBarFactory -org.netbeans.spi.editor.fold.FoldManager -at.ssw.visualizer.texteditor.model.Text -java.lang.Class -java.util.logging.Level -java.util.logging.Logger -at.ssw.visualizer.texteditor.model.FoldingRegion -java.lang.Object -org.netbeans.api.editor.fold.FoldHierarchy -javax.swing.text.Document -javax.swing.text.JTextComponent -org.netbeans.spi.editor.fold.FoldOperation -||:at.ssw.visualizer.texteditor.highlight.HighlightsContainer$1 -java.lang.Object -javax.swing.event.CaretListener -at.ssw.visualizer.texteditor.highlight.HighlightsContainer -at.ssw.visualizer.texteditor.highlight.HighlightsContainer$1 -javax.swing.text.Document -||:at.ssw.visualizer.texteditor.hyperlink.HyperlinkProvider -at.ssw.visualizer.texteditor.model.Scanner -org.netbeans.editor.Utilities -at.ssw.visualizer.texteditor.hyperlink.HyperlinkProvider -org.netbeans.editor.TokenID -org.netbeans.lib.editor.hyperlink.spi.HyperlinkProvider -at.ssw.visualizer.texteditor.model.Text -java.lang.Object -javax.swing.text.Document -at.ssw.visualizer.texteditor.model.TextRegion -javax.swing.text.JTextComponent -||:at.ssw.visualizer.texteditor.highlight.HighlightsContainer$RegionSequence -java.lang.Object -org.netbeans.spi.editor.highlighting.HighlightsSequence -at.ssw.visualizer.texteditor.highlight.HighlightsContainer -at.ssw.visualizer.texteditor.highlight.HighlightsContainer$RegionSequence -at.ssw.visualizer.texteditor.model.TextRegion diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/Text Editor/build/no-license.txt --- a/src/share/tools/IdealGraphVisualizer/Text Editor/build/no-license.txt Thu Jun 30 10:07:35 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -[NO LICENSE SPECIFIED] \ No newline at end of file diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandPredecessorsAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandPredecessorsAction.java Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandPredecessorsAction.java Thu Jun 30 10:07:49 2011 +0200 @@ -41,7 +41,7 @@ } public String getName() { - return "Expand Predecessors"; + return "Expand Above"; } @Override diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandSuccessorsAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandSuccessorsAction.java Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandSuccessorsAction.java Thu Jun 30 10:07:49 2011 +0200 @@ -41,7 +41,7 @@ } public String getName() { - return "Expand Successors"; + return "Expand Below"; } @Override diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/FigureWidget.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/FigureWidget.java Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/FigureWidget.java Thu Jun 30 10:07:49 2011 +0200 @@ -271,10 +271,10 @@ public JPopupMenu getPopupMenu(Widget widget, Point point) { JPopupMenu m = diagramScene.createPopupMenu(); - JMenu predecessors = new JMenu("Predecessors"); + JMenu predecessors = new JMenu("Nodes Above"); addFigureToSubMenu(predecessors, getFigure(), false, DEPTH); - JMenu successors = new JMenu("Successors"); + JMenu successors = new JMenu("Nodes Below"); addFigureToSubMenu(successors, getFigure(), true, DEPTH); m.addSeparator(); @@ -308,14 +308,13 @@ } public void addFigureToMenu(JMenu m, final Figure f, boolean successor, int depth) { - Action a = diagramScene.createGotoAction(f); m.add(a); if (depth > 0) { - String name = "Predecessors"; + String name = "Nodes Above"; if (successor) { - name = "Successors"; + name = "Nodes Below"; } JMenu subMenu = new JMenu(name); diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/tools/IdealGraphVisualizer/nbproject/platform.properties --- a/src/share/tools/IdealGraphVisualizer/nbproject/platform.properties Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/nbproject/platform.properties Thu Jun 30 10:07:49 2011 +0200 @@ -56,21 +56,16 @@ org.netbeans.modules.dbapi,\ org.netbeans.modules.defaults,\ org.netbeans.modules.derby,\ - org.netbeans.modules.diff,\ org.netbeans.modules.dlight.nativeexecution,\ org.netbeans.modules.dlight.terminal,\ org.netbeans.modules.editor.bookmarks,\ org.netbeans.modules.editor.bracesmatching,\ org.netbeans.modules.editor.codetemplates,\ org.netbeans.modules.editor.completion,\ - org.netbeans.modules.editor.errorstripe,\ - org.netbeans.modules.editor.errorstripe.api,\ org.netbeans.modules.editor.guards,\ org.netbeans.modules.editor.indent.project,\ org.netbeans.modules.editor.kit,\ org.netbeans.modules.editor.macros,\ - org.netbeans.modules.editor.plain,\ - org.netbeans.modules.editor.plain.lib,\ org.netbeans.modules.editor.structure,\ org.netbeans.modules.extbrowser,\ org.netbeans.modules.extexecution,\ @@ -105,13 +100,11 @@ org.netbeans.modules.lexer.nbbridge,\ org.netbeans.modules.localhistory,\ org.netbeans.modules.mercurial,\ - org.netbeans.modules.options.editor,\ org.netbeans.modules.parsing.api,\ org.netbeans.modules.parsing.lucene,\ org.netbeans.modules.print.editor,\ org.netbeans.modules.project.ant,\ org.netbeans.modules.project.libraries,\ - org.netbeans.modules.projectapi,\ org.netbeans.modules.projectui,\ org.netbeans.modules.projectui.buildmenu,\ org.netbeans.modules.projectuiapi,\ diff -r d9fa4309f89e -r 9ef0777a61d5 src/share/vm/graal/graalVMEntries.cpp --- a/src/share/vm/graal/graalVMEntries.cpp Thu Jun 30 10:07:35 2011 +0200 +++ b/src/share/vm/graal/graalVMEntries.cpp Thu Jun 30 10:07:49 2011 +0200 @@ -636,14 +636,14 @@ TRACE_graal_3("VMEntries::RiType_fields"); KlassHandle klass_handle; ciInstanceKlass* instance_klass; + objArrayHandle fieldsArray; + HandleMark hm; { VM_ENTRY_MARK; klass_handle = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)); - instance_klass = (ciInstanceKlass*) CURRENT_ENV->get_object(klass_handle()); + instance_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(klass_handle()); } GrowableArray* fields = instance_klass->non_static_fields(); - - objArrayHandle fieldsArray; { VM_ENTRY_MARK; fieldsArray = oopFactory::new_objArray(SystemDictionary::RiField_klass(), fields->length(), CHECK_NULL);