changeset 23236:4b117cc6ae9c

Remove DistinctFilteredNodeIterable.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 01 Jan 2016 18:14:07 +0100
parents fd7e0ecf89ba
children 46db8e4d2ee0
files graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctFilteredNodeIterable.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctPredicatedProxyNodeIterator.java
diffstat 2 files changed, 0 insertions(+), 104 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctFilteredNodeIterable.java	Fri Jan 01 18:12:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * 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.graph.iterators;
-
-import java.util.Iterator;
-
-import com.oracle.graal.graph.Node;
-
-public class DistinctFilteredNodeIterable<T extends Node> extends FilteredNodeIterable<T> {
-
-    public DistinctFilteredNodeIterable(NodeIterable<T> nodeIterable) {
-        super(nodeIterable);
-    }
-
-    @Override
-    public DistinctFilteredNodeIterable<T> distinct() {
-        return this;
-    }
-
-    @Override
-    public Iterator<T> iterator() {
-        return new DistinctPredicatedProxyNodeIterator<>(nodeIterable.iterator(), predicate);
-    }
-}
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctPredicatedProxyNodeIterator.java	Fri Jan 01 18:12:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * 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.graph.iterators;
-
-import java.util.Iterator;
-
-import com.oracle.graal.graph.Node;
-import com.oracle.graal.graph.NodeBitMap;
-
-public class DistinctPredicatedProxyNodeIterator<T extends Node> extends PredicatedProxyNodeIterator<T> {
-
-    private NodeBitMap visited;
-
-    public DistinctPredicatedProxyNodeIterator(Iterator<T> iterator, NodePredicate predicate) {
-        super(iterator, predicate);
-    }
-
-    @Override
-    protected void forward() {
-        if (current == null) {
-            super.forward();
-            while (!accept(current)) {
-                current = null;
-                super.forward();
-            }
-        }
-    }
-
-    private boolean accept(T n) {
-        if (n == null) {
-            return true;
-        }
-        if (visited == null) {
-            visited = n.graph().createNodeBitMap();
-        }
-        boolean accept = !visited.isMarked(n);
-        visited.mark(n);
-        return accept;
-    }
-}