changeset 4497:b995eee36970

Remove server compiler project. Create new lookup utility.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 04 Feb 2012 21:41:02 +0100
parents de4e6eb7265b
children f721895e62e8
files src/share/tools/IdealGraphVisualizer/Outline/src/com/oracle/graal/visualizer/outline/OutlineTopComponent.java src/share/tools/IdealGraphVisualizer/ServerCompiler/build.xml src/share/tools/IdealGraphVisualizer/ServerCompiler/manifest.mf src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/build-impl.xml src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/genfiles.properties src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/platform.properties src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.properties src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.xml src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/suite.properties src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.data.services.Scheduler src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/Bundle.properties src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/color.filter src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/difference.filter src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/matchingFlags.filter src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/onlyControlFlow.filter src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/register.filter src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/remove.filter src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/structural.filter src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/layer.xml src/share/tools/IdealGraphVisualizer/Snapshots/manifest.mf src/share/tools/IdealGraphVisualizer/Snapshots/src/com/oracle/graal/visualizer/snapshots/Bundle.properties src/share/tools/IdealGraphVisualizer/Snapshots/src/com/oracle/graal/visualizer/snapshots/SnapshotTopComponent.form src/share/tools/IdealGraphVisualizer/Snapshots/src/com/oracle/graal/visualizer/snapshots/SnapshotTopComponent.java src/share/tools/IdealGraphVisualizer/Util/nbproject/project.xml src/share/tools/IdealGraphVisualizer/Util/src/com/oracle/graal/visualizer/util/LookupUtils.java src/share/tools/IdealGraphVisualizer/nbproject/project.properties
diffstat 27 files changed, 268 insertions(+), 899 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/tools/IdealGraphVisualizer/Outline/src/com/oracle/graal/visualizer/outline/OutlineTopComponent.java	Sat Feb 04 21:12:50 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Outline/src/com/oracle/graal/visualizer/outline/OutlineTopComponent.java	Sat Feb 04 21:41:02 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -50,10 +50,6 @@
 import org.openide.windows.TopComponent;
 import org.openide.windows.WindowManager;
 
-/**
- *
- * @author Thomas Wuerthinger
- */
 public final class OutlineTopComponent extends TopComponent implements ExplorerManager.Provider, LookupListener {
 
     public static final String GLOBAL_ACTIONS_FOLDER = "Actions/Outline/Global";
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/build.xml	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
-<!-- for some information on what you could do (e.g. targets to override). -->
-<!-- If you delete this file and reopen the project it will be recreated. -->
-<project name="com.sun.hotspot.igv.servercompilerscheduler" default="netbeans" basedir=".">
-    <description>Builds, tests, and runs the project com.sun.hotspot.igv.servercompilerscheduler.</description>
-    <import file="nbproject/build-impl.xml"/>
-</project>
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/manifest.mf	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-OpenIDE-Module: com.sun.hotspot.igv.servercompiler
-OpenIDE-Module-Layer: com/sun/hotspot/igv/servercompiler/layer.xml
-OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/servercompiler/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.0
-
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/build-impl.xml	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*** GENERATED FROM project.xml - DO NOT EDIT  ***
-***         EDIT ../build.xml INSTEAD         ***
--->
-<project name="com.sun.hotspot.igv.servercompilerscheduler-impl" basedir="..">
-    <property file="nbproject/private/suite-private.properties"/>
-    <property file="nbproject/suite.properties"/>
-    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
-    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
-    <property file="${suite.dir}/nbproject/platform.properties"/>
-    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
-        <attribute name="name"/>
-        <attribute name="value"/>
-        <sequential>
-            <property name="@{name}" value="${@{value}}"/>
-        </sequential>
-    </macrodef>
-    <property file="${user.properties.file}"/>
-    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
-    <nbmproject2:property name="netbeans.dest.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
-    <fail message="You must define 'nbplatform.${nbplatform.active}.harness.dir'">
-        <condition>
-            <not>
-                <available file="${harness.dir}" type="dir"/>
-            </not>
-        </condition>
-    </fail>
-    <import file="${harness.dir}/build.xml"/>
-</project>
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/genfiles.properties	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-build.xml.data.CRC32=d1360a65
-build.xml.script.CRC32=a9d94ef8
-build.xml.stylesheet.CRC32=79c3b980
-# 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=d1360a65
-nbproject/build-impl.xml.script.CRC32=52847236
-nbproject/build-impl.xml.stylesheet.CRC32=deb65f65
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/platform.properties	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-# Deprecated since 5.0u1; for compatibility with 5.0:
-disabled.clusters=\
-    apisupport1,\
-    harness,\
-    ide8,\
-    java1,\
-    nb6.0,\
-    profiler2
-disabled.modules=\
-    org.netbeans.core.execution,\
-    org.netbeans.core.multiview,\
-    org.netbeans.core.output2,\
-    org.netbeans.modules.applemenu,\
-    org.netbeans.modules.autoupdate.services,\
-    org.netbeans.modules.autoupdate.ui,\
-    org.netbeans.modules.core.kit,\
-    org.netbeans.modules.favorites,\
-    org.netbeans.modules.javahelp,\
-    org.netbeans.modules.masterfs,\
-    org.netbeans.modules.options.keymap,\
-    org.netbeans.modules.sendopts,\
-    org.netbeans.modules.templates,\
-    org.openide.compat,\
-    org.openide.execution,\
-    org.openide.util.enumerations
-enabled.clusters=\
-    platform7
-nbjdk.active=JDK_1.6
-nbplatform.active=default
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.properties	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-javac.source=1.7
-javac.compilerargs=-Xlint -Xlint:-serial
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.xml	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.netbeans.org/ns/project/1">
-    <type>org.netbeans.modules.apisupport.project</type>
-    <configuration>
-        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
-            <code-name-base>com.sun.hotspot.igv.servercompiler</code-name-base>
-            <suite-component/>
-            <module-dependencies>
-                <dependency>
-                    <code-name-base>com.sun.hotspot.igv.data</code-name-base>
-                    <build-prerequisite/>
-                    <compile-dependency/>
-                    <run-dependency>
-                        <specification-version>1.0</specification-version>
-                    </run-dependency>
-                </dependency>
-                <dependency>
-                    <code-name-base>com.sun.hotspot.igv.graph</code-name-base>
-                    <build-prerequisite/>
-                    <compile-dependency/>
-                    <run-dependency>
-                        <specification-version>1.0</specification-version>
-                    </run-dependency>
-                </dependency>
-            </module-dependencies>
-            <public-packages/>
-        </data>
-    </configuration>
-</project>
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/suite.properties	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-suite.dir=${basedir}/..
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.data.services.Scheduler	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.hotspot.igv.servercompiler.ServerCompilerScheduler
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/Bundle.properties	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-OpenIDE-Module-Name=ServerCompiler
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,624 +0,0 @@
-/*
- * Copyright (c) 1998, 2007, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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.servercompiler;
-
-import com.sun.hotspot.igv.data.InputBlock;
-import com.sun.hotspot.igv.data.InputEdge;
-import com.sun.hotspot.igv.data.InputGraph;
-import com.sun.hotspot.igv.data.InputNode;
-import com.sun.hotspot.igv.data.services.Scheduler;
-import java.util.*;
-
-/**
- *
- * @author Thomas Wuerthinger
- */
-public class ServerCompilerScheduler implements Scheduler {
-
-    private static class Node {
-
-        public InputNode inputNode;
-        public Set<Node> succs = new HashSet<>();
-        public List<Node> preds = new ArrayList<>();
-        public InputBlock block;
-        public boolean isBlockProjection;
-        public boolean isBlockStart;
-    }
-    private InputGraph graph;
-    private Collection<Node> nodes;
-    private Map<InputNode, Node> inputNodeToNode;
-    private Vector<InputBlock> blocks;
-    private Map<InputBlock, InputBlock> dominatorMap;
-    private Map<InputBlock, Integer> blockIndex;
-    private InputBlock[][] commonDominator;
-    private static final Comparator<InputEdge> edgeComparator = new Comparator<InputEdge>() {
-
-        @Override
-        public int compare(InputEdge o1, InputEdge o2) {
-            return o1.getToIndex() - o2.getToIndex();
-        }
-    };
-
-    public void buildBlocks() {
-
-        blocks = new Vector<>();
-        Node root = findRoot();
-        if (root == null) {
-            return;
-        }
-        Stack<Node> stack = new Stack<>();
-        Set<Node> visited = new HashSet<>();
-        stack.add(root);
-        int blockCount = 0;
-        InputBlock rootBlock = null;
-
-
-        while (!stack.isEmpty()) {
-            Node proj = stack.pop();
-            Node parent = proj;
-            if (proj.isBlockProjection && proj.preds.size() > 0) {
-                parent = proj.preds.get(0);
-            }
-
-            if (!visited.contains(parent)) {
-                visited.add(parent);
-                InputBlock block = graph.addBlock(Integer.toString(blockCount));
-                blocks.add(block);
-                if (parent == root) {
-                    rootBlock = block;
-                }
-                blockCount++;
-                parent.block = block;
-                if (proj != parent && proj.succs.size() == 1 && proj.succs.contains(root)) {
-                    // Special treatment of Halt-nodes
-                    proj.block = block;
-                }
-
-                Node p = proj;
-                do {
-                    if (p.preds.size() == 0 || p.preds.get(0) == null) {
-                        p = parent;
-                        break;
-                    }
-
-                    p = p.preds.get(0);
-                    if (p == proj) {
-                        // Cycle, stop
-                        break;
-                    }
-
-                    if (p.block == null) {
-                        p.block = block;
-                    }
-                } while (!p.isBlockProjection && !p.isBlockStart);
-
-                if (block != rootBlock) {
-                    for (Node n : p.preds) {
-                        if (n != null && n != p) {
-                            if (n.isBlockProjection) {
-                                n = n.preds.get(0);
-                            }
-                            if (n.block != null) {
-                                graph.addBlockEdge(n.block, block);
-                            }
-                        }
-                    }
-                }
-
-                for (Node n : parent.succs) {
-                    if (n != root && n.isBlockProjection) {
-                        for (Node n2 : n.succs) {
-
-                            if (n2 != parent && n2.block != null && n2.block != rootBlock) {
-                                graph.addBlockEdge(block, n2.block);
-                            }
-                        }
-                    } else {
-                        if (n != parent && n.block != null && n.block != rootBlock) {
-                            graph.addBlockEdge(block, n.block);
-                        }
-                    }
-                }
-
-                int num_preds = p.preds.size();
-                int bottom = -1;
-                if (isRegion(p) || isPhi(p)) {
-                    bottom = 0;
-                }
-
-                int pushed = 0;
-                for (int i = num_preds - 1; i > bottom; i--) {
-                    if (p.preds.get(i) != null && p.preds.get(i) != p) {
-                        stack.push(p.preds.get(i));
-                        pushed++;
-                    }
-                }
-
-                if (pushed == 0 && p == root) {
-                    // TODO: special handling when root backedges are not built yet
-                }
-            }
-        }
-
-        for (Node n : nodes) {
-            InputBlock block = n.block;
-            if (block != null) {
-                block.addNode(n.inputNode.getId());
-            }
-        }
-
-        int z = 0;
-        blockIndex = new HashMap<>(blocks.size());
-        for (InputBlock b : blocks) {
-            blockIndex.put(b, z);
-            z++;
-        }
-    }
-
-    private String getBlockName(InputNode n) {
-        return n.getProperties().get("block");
-    }
-
-    @Override
-    public Collection<InputBlock> schedule(InputGraph graph) {
-        if (graph.getNodes().isEmpty()) {
-            return Collections.emptyList();
-        }
-
-        if (graph.getBlocks().size() > 0) {
-            Collection<InputNode> tmpNodes = new ArrayList<>(graph.getNodes());
-            for (InputNode n : tmpNodes) {
-                String block = getBlockName(n);
-                if (graph.getBlock(n) == null) {
-                    graph.getBlock(block).addNode(n.getId());
-                    assert graph.getBlock(n) != null;
-                }
-            }
-            return graph.getBlocks();
-        } else {
-            nodes = new ArrayList<>();
-            inputNodeToNode = new HashMap<>(graph.getNodes().size());
-
-            this.graph = graph;
-            buildUpGraph();
-            buildBlocks();
-            buildDominators();
-            buildCommonDominators();
-            scheduleLatest();
-
-            InputBlock noBlock = null;
-            for (InputNode n : graph.getNodes()) {
-                if (graph.getBlock(n) == null) {
-                    if (noBlock == null) {
-                        noBlock = graph.addBlock("(no block)");
-                        blocks.add(noBlock);
-                    }
-                    
-                    graph.setBlock(n, noBlock);
-                }
-                assert graph.getBlock(n) != null;
-            }
-
-            return blocks;
-        }
-    }
-
-    private void scheduleLatest() {
-        Node root = findRoot();
-        if(root == null) {
-            assert false : "No root found!";
-            return;
-        }
-
-        // Mark all nodes reachable in backward traversal from root
-        Set<Node> reachable = new HashSet<>();
-        reachable.add(root);
-        Stack<Node> stack = new Stack<>();
-        stack.push(root);
-        while (!stack.isEmpty()) {
-            Node cur = stack.pop();
-            for (Node n : cur.preds) {
-                if (!reachable.contains(n)) {
-                    reachable.add(n);
-                    stack.push(n);
-                }
-            }
-        }
-
-        Set<Node> unscheduled = new HashSet<>();
-        for (Node n : this.nodes) {
-            if (n.block == null && reachable.contains(n)) {
-                unscheduled.add(n);
-            }
-        }
-
-        while (unscheduled.size() > 0) {
-            boolean progress = false;
-
-            Set<Node> newUnscheduled = new HashSet<>();
-            for (Node n : unscheduled) {
-
-                InputBlock block = null;
-                if (this.isPhi(n) && n.preds.get(0) != null) {
-                    // Phi nodes in same block as region nodes
-                    block = n.preds.get(0).block;
-                } else {
-                    for (Node s : n.succs) {
-                        if (reachable.contains(s)) {
-                            if (s.block == null) {
-                                block = null;
-                                break;
-                            } else {
-                                if (block == null) {
-                                    block = s.block;
-                                } else {
-                                    block = commonDominator[this.blockIndex.get(block)][blockIndex.get(s.block)];
-                                }
-                            }
-                        }
-                    }
-                }
-
-                if (block != null) {
-                    n.block = block;
-                    block.addNode(n.inputNode.getId());
-                    progress = true;
-                } else {
-                    newUnscheduled.add(n);
-                }
-            }
-
-            unscheduled = newUnscheduled;
-
-            if (!progress) {
-                break;
-            }
-        }
-
-        Set<Node> curReachable = new HashSet<>(reachable);
-        for (Node n : curReachable) {
-            if (n.block != null) {
-                for (Node s : n.succs) {
-                    if (!reachable.contains(s)) {
-                        markWithBlock(s, n.block, reachable);
-                    }
-                }
-            }
-        }
-
-    }
-
-    private void markWithBlock(Node n, InputBlock b, Set<Node> reachable) {
-        assert !reachable.contains(n);
-        Stack<Node> stack = new Stack<>();
-        stack.push(n);
-        n.block = b;
-        b.addNode(n.inputNode.getId());
-        reachable.add(n);
-
-        while (!stack.isEmpty()) {
-            Node cur = stack.pop();
-            for (Node s : cur.succs) {
-                if (!reachable.contains(s)) {
-                    reachable.add(s);
-                    s.block = b;
-                    b.addNode(s.inputNode.getId());
-                    stack.push(s);
-                }
-            }
-
-            for (Node s : cur.preds) {
-                if (!reachable.contains(s)) {
-                    reachable.add(s);
-                    s.block = b;
-                    b.addNode(s.inputNode.getId());
-                    stack.push(s);
-                }
-            }
-        }
-    }
-
-    private class BlockIntermediate {
-
-        InputBlock block;
-        int index;
-        int dominator;
-        int semi;
-        int parent;
-        int label;
-        int ancestor;
-        List<Integer> pred;
-        List<Integer> bucket;
-    }
-
-    public void buildCommonDominators() {
-        commonDominator = new InputBlock[this.blocks.size()][this.blocks.size()];
-        for (int i = 0; i < blocks.size(); i++) {
-            for (int j = 0; j < blocks.size(); j++) {
-                commonDominator[i][j] = getCommonDominator(i, j);
-            }
-        }
-    }
-
-    public InputBlock getCommonDominator(int a, int b) {
-        InputBlock ba = blocks.get(a);
-        InputBlock bb = blocks.get(b);
-        if (ba == bb) {
-            return ba;
-        }
-        Set<InputBlock> visited = new HashSet<>();
-        while (ba != null) {
-            visited.add(ba);
-            ba = dominatorMap.get(ba);
-        }
-
-        while (bb != null) {
-            if (visited.contains(bb)) {
-                return bb;
-            }
-            bb = dominatorMap.get(bb);
-        }
-
-        assert false;
-        return null;
-    }
-
-    public void buildDominators() {
-        dominatorMap = new HashMap<>(graph.getBlocks().size());
-        if (blocks.size() == 0) {
-            return;
-        }
-        Vector<BlockIntermediate> intermediate = new Vector<>(graph.getBlocks().size());
-        Map<InputBlock, BlockIntermediate> map = new HashMap<>(graph.getBlocks().size());
-        int z = 0;
-        for (InputBlock b : blocks) {
-            BlockIntermediate bi = new BlockIntermediate();
-            bi.block = b;
-            bi.index = z;
-            bi.dominator = -1;
-            bi.semi = -1;
-            bi.parent = -1;
-            bi.label = z;
-            bi.ancestor = -1;
-            bi.pred = new ArrayList<>();
-            bi.bucket = new ArrayList<>();
-            intermediate.add(bi);
-            map.put(b, bi);
-            z++;
-        }
-        Stack<Integer> stack = new Stack<>();
-        stack.add(0);
-
-        Vector<BlockIntermediate> array = new Vector<>();
-        intermediate.get(0).dominator = 0;
-
-        int n = 0;
-        while (!stack.isEmpty()) {
-            int index = stack.pop();
-            BlockIntermediate ib = intermediate.get(index);
-            ib.semi = n;
-            array.add(ib);
-            n = n + 1;
-            for (InputBlock b : ib.block.getSuccessors()) {
-                BlockIntermediate succ = map.get(b);
-                if (succ.semi == -1) {
-                    succ.parent = index;
-                    stack.push(succ.index); // TODO: check if same node could be pushed twice
-                }
-                succ.pred.add(index);
-            }
-        }
-
-        for (int i = n - 1; i > 0; i--) {
-            BlockIntermediate block = array.get(i);
-            int block_index = block.index;
-            for (int predIndex : block.pred) {
-                int curIndex = eval(predIndex, intermediate);
-                BlockIntermediate curBlock = intermediate.get(curIndex);
-                if (curBlock.semi < block.semi) {
-                    block.semi = curBlock.semi;
-                }
-            }
-
-
-            int semiIndex = block.semi;
-            BlockIntermediate semiBlock = array.get(semiIndex);
-            semiBlock.bucket.add(block_index);
-
-            link(block.parent, block_index, intermediate);
-            BlockIntermediate parentBlock = intermediate.get(block.parent);
-
-            for (int j = 0; j < parentBlock.bucket.size(); j++) {
-                for (int curIndex : parentBlock.bucket) {
-                    int newIndex = eval(curIndex, intermediate);
-                    BlockIntermediate curBlock = intermediate.get(curIndex);
-                    BlockIntermediate newBlock = intermediate.get(newIndex);
-                    int dom = block.parent;
-                    if (newBlock.semi < curBlock.semi) {
-                        dom = newIndex;
-                    }
-
-                    curBlock.dominator = dom;
-                }
-            }
-
-
-            parentBlock.bucket.clear();
-        }
-
-        for (int i = 1; i < n; i++) {
-
-            BlockIntermediate block = array.get(i);
-            int block_index = block.index;
-
-            int semi_index = block.semi;
-            BlockIntermediate semi_block = array.get(semi_index);
-
-            if (block.dominator != semi_block.index) {
-                int new_dom = intermediate.get(block.dominator).dominator;
-                block.dominator = new_dom;
-            }
-        }
-
-        for (BlockIntermediate ib : intermediate) {
-            if (ib.dominator == -1) {
-                ib.dominator = 0;
-            }
-        }
-
-        for (BlockIntermediate bi : intermediate) {
-            InputBlock b = bi.block;
-            int dominator = bi.dominator;
-            InputBlock dominatorBlock = null;
-            if (dominator != -1) {
-                dominatorBlock = intermediate.get(dominator).block;
-            }
-
-            if (dominatorBlock == b) {
-                dominatorBlock = null;
-            }
-            this.dominatorMap.put(b, dominatorBlock);
-        }
-    }
-
-    private void compress(int index, Vector<BlockIntermediate> blocks) {
-        BlockIntermediate block = blocks.get(index);
-
-        int ancestor = block.ancestor;
-        assert ancestor != -1;
-
-        BlockIntermediate ancestor_block = blocks.get(ancestor);
-        if (ancestor_block.ancestor != -1) {
-            compress(ancestor, blocks);
-
-            int label = block.label;
-            BlockIntermediate label_block = blocks.get(label);
-
-            int ancestor_label = ancestor_block.label;
-            BlockIntermediate ancestor_label_block = blocks.get(label);
-            if (ancestor_label_block.semi < label_block.semi) {
-                block.label = ancestor_label;
-            }
-
-            block.ancestor = ancestor_block.ancestor;
-        }
-    }
-
-    private int eval(int index, Vector<BlockIntermediate> blocks) {
-        BlockIntermediate block = blocks.get(index);
-        if (block.ancestor == -1) {
-            return index;
-        } else {
-            compress(index, blocks);
-            return block.label;
-        }
-    }
-
-    private void link(int index1, int index2, Vector<BlockIntermediate> blocks) {
-        BlockIntermediate block2 = blocks.get(index2);
-        block2.ancestor = index1;
-    }
-
-    private boolean isRegion(Node n) {
-        return n.inputNode.getProperties().get("name").equals("Region");
-    }
-
-    private boolean isPhi(Node n) {
-        return n.inputNode.getProperties().get("name").equals("Phi");
-    }
-
-    private Node findRoot() {
-        Node minNode = null;
-        Node alternativeRoot = null;
-
-        for (Node node : nodes) {
-            InputNode inputNode = node.inputNode;
-            String s = inputNode.getProperties().get("name");
-            if (s != null && s.equals("Root")) {
-                return node;
-            }
-
-            if (alternativeRoot == null && node.preds.isEmpty()) {
-                alternativeRoot = node;
-            }
-
-            if (minNode == null || node.inputNode.getId() < minNode.inputNode.getId()) {
-                minNode = node;
-            }
-        }
-
-        if (alternativeRoot != null) {
-            return alternativeRoot;
-        } else {
-            return minNode;
-        }
-    }
-
-    public void buildUpGraph() {
-
-        for (InputNode n : graph.getNodes()) {
-            Node node = new Node();
-            node.inputNode = n;
-            nodes.add(node);
-            String p = n.getProperties().get("is_block_proj");
-            node.isBlockProjection = (p != null && p.equals("true"));
-            p = n.getProperties().get("is_block_start");
-            node.isBlockStart = (p != null && p.equals("true"));
-            inputNodeToNode.put(n, node);
-        }
-
-        Map<Integer, List<InputEdge>> edgeMap = new HashMap<>(graph.getEdges().size());
-        for (InputEdge e : graph.getEdges()) {
-
-            int to = e.getTo();
-            if (!edgeMap.containsKey(to)) {
-                edgeMap.put(to, new ArrayList<InputEdge>());
-            }
-
-
-            List<InputEdge> list = edgeMap.get(to);
-            list.add(e);
-        }
-
-
-        for (Integer i : edgeMap.keySet()) {
-
-            List<InputEdge> list = edgeMap.get(i);
-            Collections.sort(list, edgeComparator);
-
-            int to = i;
-            InputNode toInputNode = graph.getNode(to);
-            Node toNode = inputNodeToNode.get(toInputNode);
-            for (InputEdge e : list) {
-                assert to == e.getTo();
-                int from = e.getFrom();
-                InputNode fromInputNode = graph.getNode(from);
-                Node fromNode = inputNodeToNode.get(fromInputNode);
-                fromNode.succs.add(toNode);
-                toNode.preds.add(fromNode);
-            }
-        }
-    }
-}
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/color.filter	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-colorize("name", ".*", yellow);
-colorize("name", "Catch.*", blue);
-colorize("name", "Region|Loop|CountedLoop|Root", red);
-colorize("name", "CProj|IfFalse|IfTrue|JProj|CatchProj", magenta);
-colorize("name", "Con.*", orange);
-colorize("name", "Parm|Proj", lightGray);
-
-// Nodes with bci
-colorize("bci", "..*", magenta);
-
-// Line style
-var f = new ColorFilter("Line Style filter");
-f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "int:")), null, Color.BLUE, null));
-f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "control")), null, Color.RED, null));
-f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "memory")), null, Color.GREEN, null));
-f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "tuple:")), null, Color.MAGENTA, null));
-f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "bottom")), null, Color.LIGHT_GRAY, null));
-f.apply(graph);
\ No newline at end of file
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/difference.filter	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-colorize("state", "same", white);
-colorize("state", "changed", orange);
-colorize("state", "new", green);
-colorize("state", "deleted", red);
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/matchingFlags.filter	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-colorize("is_dontcare", "false", white);
-colorize("is_shared", "true", green);
-colorize("is_dontcare", "true", red);
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/onlyControlFlow.filter	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-var f = new RemoveFilter("Show only control flow");
-f.addRule(
-  new RemoveFilter.RemoveRule(
-    new InvertSelector(
-      new OrSelector(
-        new OrSelector(
-          new SuccessorSelector(
-            new MatcherSelector(
-              new Properties.StringPropertyMatcher("type", "control")
-            )
-          ),
-	  new MatcherSelector(
-            new Properties.StringPropertyMatcher("type", "control")
-          )
-        ),
-	new MatcherSelector(
-          new Properties.StringPropertyMatcher("name", "Start")
-        )
-      )
-    ), false
-  )
-);
-f.addRule(new RemoveFilter.RemoveRule(new MatcherSelector(new Properties.RegexpPropertyMatcher("name", "Phi|Store."))));
-f.apply(graph);
\ No newline at end of file
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/register.filter	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-// Register coloring
-colorize("reg", "EAX", green);
-colorize("reg", "EFLAGS", gray);
-colorize("reg", "EBP", orange);
-colorize("reg", "ECX", cyan);
\ No newline at end of file
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/remove.filter	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-remove("dump_spec", "FramePtr|ReturnAdr|I_O"); 
-removeInputs("name", "Root");
-var f = new RemoveSelfLoopsFilter("Remove Self-Loops");
-f.apply(graph);
-removeInputs("name", "SafePoint|CallStaticJava|CallDynamicJava|CallJava|CallLeaf|CallRuntime|AbstractLock|CallLeafNoFP|Call|CallStaticJavaDirect", 5);
-removeInputs("name", "Unlock|Lock", 7);
-removeInputs("name", "Allocate", 7);
-removeInputs("name", "AllocateArray", 9);
\ No newline at end of file
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/structural.filter	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-var f = new CombineFilter("Combine Filter");
-f.addRule(new CombineFilter.CombineRule(new Properties.RegexpPropertyMatcher("name", ".*"), new Properties.RegexpPropertyMatcher("name", "Proj|IfFalse|IfTrue|JProj|MachProj|JumpProj|CatchProj")));
-f.addRule(new CombineFilter.CombineRule(new Properties.RegexpPropertyMatcher("name", "Cmp.*"), new Properties.RegexpPropertyMatcher("name", "Bool")));
-f.apply(graph);
-split("name", "BoxLock");
-split("name", "(Con.*)|(loadCon.*)", "[dump_spec]");
\ No newline at end of file
--- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/layer.xml	Sat Feb 04 21:12:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
-<filesystem>
-      <folder name="Filters">
-        <file name="C2 Basic Coloring" url="filters/color.filter">
-            <attr name="enabled" boolvalue="false"/>
-        </file>
-        <file name="C2 Matcher Flags Coloring" url="filters/matchingFlags.filter">
-            <attr name="enabled" boolvalue="false"/>
-            <attr name="after" stringvalue="C2 Basic Coloring"/>
-        </file>
-        <file name="C2 Register Coloring" url="filters/register.filter">
-            <attr name="enabled" boolvalue="false"/>
-            <attr name="after" stringvalue="C2 Matcher Flags Coloring"/>
-        </file>
-        <file name="C2 Only Control Flow" url="filters/onlyControlFlow.filter">
-            <attr name="enabled" boolvalue="false"/>
-            <attr name="after" stringvalue="C2 Register Coloring"/>
-        </file>
-        <file name="C2 Remove Filter" url="filters/remove.filter">
-            <attr name="enabled" boolvalue="false"/>
-            <attr name="after" stringvalue="C2 Only Control Flow"/>
-        </file>
-        <file name="C2 Structural" url="filters/structural.filter">
-            <attr name="enabled" boolvalue="false"/>
-            <attr name="after" stringvalue="C2 Remove Filter"/>
-        </file>
-    </folder>	
-</filesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/Snapshots/manifest.mf	Sat Feb 04 21:41:02 2012 +0100
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+OpenIDE-Module: com.oracle.graal.visualizer.snapshots
+OpenIDE-Module-Localizing-Bundle: com/oracle/graal/visualizer/snapshots/Bundle.properties
+OpenIDE-Module-Requires: org.openide.windows.WindowManager
+OpenIDE-Module-Specification-Version: 1.0
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/Snapshots/src/com/oracle/graal/visualizer/snapshots/Bundle.properties	Sat Feb 04 21:41:02 2012 +0100
@@ -0,0 +1,1 @@
+OpenIDE-Module-Name=Snapshots
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/Snapshots/src/com/oracle/graal/visualizer/snapshots/SnapshotTopComponent.form	Sat Feb 04 21:41:02 2012 +0100
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <EmptySpace min="0" pref="400" max="32767" attributes="0"/>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <EmptySpace min="0" pref="300" max="32767" attributes="0"/>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+</Form>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/Snapshots/src/com/oracle/graal/visualizer/snapshots/SnapshotTopComponent.java	Sat Feb 04 21:41:02 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2012, 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.oracle.graal.visualizer.snapshots;
+
+import org.openide.awt.ActionID;
+import org.openide.awt.ActionReference;
+import org.openide.windows.TopComponent;
+
+@TopComponent.Description(preferredID = "SnapshotTopComponent",
+persistenceType = TopComponent.PERSISTENCE_NEVER)
+@TopComponent.Registration(mode = "output", openAtStartup = true)
+@ActionID(category = "Window", id = "com.oracle.graal.visualizer.snapshots.SnapshotTopComponent")
+@ActionReference(path = "Menu/Window")
+@TopComponent.OpenActionRegistration(displayName = "Snapshot", preferredID = "SnapshotTopComponent")
+public final class SnapshotTopComponent extends TopComponent {
+
+    public SnapshotTopComponent() {
+        initComponents();
+        setName("Snapshot Window");
+        setToolTipText("This is a Snapshot window");
+    }
+
+    /**
+     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
+     * regenerated by the Form Editor.
+     */
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents() {
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 400, Short.MAX_VALUE)
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 300, Short.MAX_VALUE)
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    // End of variables declaration//GEN-END:variables
+}
--- a/src/share/tools/IdealGraphVisualizer/Util/nbproject/project.xml	Sat Feb 04 21:12:50 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Util/nbproject/project.xml	Sat Feb 04 21:41:02 2012 +0100
@@ -1,55 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.netbeans.org/ns/project/1">
-    <type>org.netbeans.modules.apisupport.project</type>
-    <configuration>
-        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
-            <code-name-base>com.sun.hotspot.igv.util</code-name-base>
-            <suite-component/>
-            <module-dependencies>
-                <dependency>
-                    <code-name-base>com.sun.hotspot.igv.data</code-name-base>
-                    <build-prerequisite/>
-                    <compile-dependency/>
-                    <run-dependency>
-                        <specification-version>1.0</specification-version>
-                    </run-dependency>
-                </dependency>
-                <dependency>
-                    <code-name-base>org.netbeans.api.visual</code-name-base>
-                    <build-prerequisite/>
-                    <compile-dependency/>
-                    <run-dependency>
-                        <specification-version>2.27.1</specification-version>
-                    </run-dependency>
-                </dependency>
-                <dependency>
-                    <code-name-base>org.openide.nodes</code-name-base>
-                    <build-prerequisite/>
-                    <compile-dependency/>
-                    <run-dependency>
-                        <specification-version>7.20.1</specification-version>
-                    </run-dependency>
-                </dependency>
-                <dependency>
-                    <code-name-base>org.openide.util</code-name-base>
-                    <build-prerequisite/>
-                    <compile-dependency/>
-                    <run-dependency>
-                        <specification-version>8.14.1</specification-version>
-                    </run-dependency>
-                </dependency>
-                <dependency>
-                    <code-name-base>org.openide.util.lookup</code-name-base>
-                    <build-prerequisite/>
-                    <compile-dependency/>
-                    <run-dependency>
-                        <specification-version>8.6.1</specification-version>
-                    </run-dependency>
-                </dependency>
-            </module-dependencies>
-            <public-packages>
-                <package>com.sun.hotspot.igv.util</package>
-            </public-packages>
-        </data>
-    </configuration>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.apisupport.project</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
+            <code-name-base>com.sun.hotspot.igv.util</code-name-base>
+            <suite-component/>
+            <module-dependencies>
+                <dependency>
+                    <code-name-base>com.sun.hotspot.igv.data</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>1.0</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.api.visual</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>2.27.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.nodes</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.20.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.util</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>8.14.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.util.lookup</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>8.6.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.windows</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>6.48.1</specification-version>
+                    </run-dependency>
+                </dependency>
+            </module-dependencies>
+            <public-packages>
+                <package>com.sun.hotspot.igv.util</package>
+            </public-packages>
+        </data>
+    </configuration>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/Util/src/com/oracle/graal/visualizer/util/LookupUtils.java	Sat Feb 04 21:41:02 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2012, 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.oracle.graal.visualizer.util;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import org.openide.util.Lookup;
+import org.openide.util.Lookup.Provider;
+import org.openide.util.lookup.Lookups;
+import org.openide.windows.TopComponent;
+
+/**
+ * Utilities that build upon the Lookup API.
+ */
+public class LookupUtils {
+
+    
+    /**
+     * Creates a new lookup that will delegate to the last open window of a specified top component class. If the window is closed, the lookup will be empty.
+     * @param clazz the class identifying the top component type
+     * @return a delegating lookup
+     */
+    public static Lookup getLastActiveDelegatingLookup(Class<?> clazz) {
+        final TopComponentLookup topComponentLookupImpl = new TopComponentLookup(clazz);
+        TopComponent.getRegistry().addPropertyChangeListener(topComponentLookupImpl);
+        return topComponentLookupImpl.lookup;
+    }
+    
+    private static class TopComponentLookup implements PropertyChangeListener {
+        private final Class<?> clazz;
+        private final Lookup lookup;
+        private TopComponent lastActive;
+        
+        private final Provider lookupProvider = new Provider() {
+
+            @Override
+            public Lookup getLookup() {
+                if (lastActive == null) {
+                    return Lookup.EMPTY;
+                } else {
+                    return lastActive.getLookup();
+                }
+            }
+        };
+        
+        public TopComponentLookup(Class<?> clazz) {
+            this.clazz = clazz;
+            lookup = Lookups.proxy(lookupProvider);
+            update();
+        }
+        
+        @Override
+        public void propertyChange(PropertyChangeEvent evt) {
+            update();
+        }
+
+        private void update() {
+            TopComponent curActivated = TopComponent.getRegistry().getActivated();
+            if (curActivated != lastActive) {
+                if (clazz.isAssignableFrom(curActivated.getClass())) {
+                    // We have a new top component for our lookup.
+                    lastActive = curActivated;
+                    refreshLookup();
+                } else {
+                    // We have no new top component. Check if the old one is still opened.
+                    if (lastActive != null && !TopComponent.getRegistry().getOpened().contains(lastActive)) {
+                        // The top component was closed => Remove lookup.
+                        lastActive = null;
+                        refreshLookup();
+                    }
+                }
+            }
+        }
+
+        private void refreshLookup() {
+            lookup.lookup(Object.class);
+        }
+    };
+}
--- a/src/share/tools/IdealGraphVisualizer/nbproject/project.properties	Sat Feb 04 21:12:50 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/nbproject/project.properties	Sat Feb 04 21:41:02 2012 +0100
@@ -15,14 +15,15 @@
     ${project.com.sun.hotspot.igv.settings}:\
     ${project.com.sun.hotspot.igv.util}:\
     ${project.com.sun.hotspot.igv.svg}:\
-    ${project.com.sun.hotspot.igv.servercompilerscheduler}:\
     ${project.com.sun.hotspot.igv.filterwindow}:\
     ${project.com.sun.hotspot.igv.graal}:\
     ${project.at.ssw.visualizer.cfg}:\
     ${project.org.eclipse.draw2d}:\
-    ${project.com.oracle.graal.visualizer.editor}
+    ${project.com.oracle.graal.visualizer.editor}:\
+    ${project.com.oracle.graal.visualizer.snapshots}
 project.at.ssw.visualizer.cfg=ControlFlowEditor
 project.com.oracle.graal.visualizer.editor=Editor
+project.com.oracle.graal.visualizer.snapshots=Snapshots
 project.com.sun.hotspot.igv.bytecodes=Bytecodes
 project.com.oracle.graal.visualizer.outline=Outline
 project.com.sun.hotspot.igv.data=Data
@@ -33,7 +34,6 @@
 project.com.sun.hotspot.igv.graph=Graph
 project.com.sun.hotspot.igv.hierarchicallayout=HierarchicalLayout
 project.com.sun.hotspot.igv.layout=Layout
-project.com.sun.hotspot.igv.servercompilerscheduler=ServerCompiler
 project.com.sun.hotspot.igv.settings=Settings
 project.com.sun.hotspot.igv.svg=BatikSVGProxy
 project.com.sun.hotspot.igv.view=View