Mercurial > hg > truffle
changeset 15191:04e6706df64c
Move project com.oracle.graal.cfg to com.oracle.graal.compiler.common.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Thu, 17 Apr 2014 13:16:21 +0200 |
parents | 039d8902bdb8 |
children | 644dfe49c0f4 |
files | graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/AbstractBlock.java graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/AbstractBlockBase.java graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/AbstractControlFlowGraph.java graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/BlockMap.java graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/Loop.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/AbstractBlock.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/AbstractBlockBase.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/AbstractControlFlowGraph.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/BlockMap.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/Loop.java mx/projects |
diffstat | 11 files changed, 308 insertions(+), 308 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/AbstractBlock.java Thu Apr 17 13:17:25 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2014, 2014, 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.cfg; - -import java.util.*; - -public interface AbstractBlock<T extends AbstractBlock<T>> { - - int getId(); - - Loop<T> getLoop(); - - int getLoopDepth(); - - boolean isLoopHeader(); - - boolean isLoopEnd(); - - boolean isExceptionEntry(); - - List<T> getPredecessors(); - - int getPredecessorCount(); - - List<T> getSuccessors(); - - int getSuccessorCount(); - - int getLinearScanNumber(); - - void setLinearScanNumber(int linearScanNumber); - - boolean isAligned(); - - void setAlign(boolean align); - - T getDominator(); -}
--- a/graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/AbstractBlockBase.java Thu Apr 17 13:17:25 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2009, 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.cfg; - -import java.util.*; - -public abstract class AbstractBlockBase<T extends AbstractBlock<T>> implements AbstractBlock<T> { - - protected int id; - - protected List<T> predecessors; - protected List<T> successors; - - private T dominator; - - private boolean align; - private int linearScanNumber; - - protected AbstractBlockBase() { - this.id = AbstractControlFlowGraph.BLOCK_ID_INITIAL; - this.linearScanNumber = -1; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public List<T> getPredecessors() { - return predecessors; - } - - public void setPredecessors(List<T> predecessors) { - this.predecessors = predecessors; - } - - public List<T> getSuccessors() { - return successors; - } - - public void setSuccessors(List<T> successors) { - this.successors = successors; - } - - public T getDominator() { - return dominator; - } - - public void setDominator(T dominator) { - this.dominator = dominator; - } - - @Override - public String toString() { - return "B" + id; - } - - public int getPredecessorCount() { - return getPredecessors().size(); - } - - public int getSuccessorCount() { - return getSuccessors().size(); - } - - public int getLinearScanNumber() { - return linearScanNumber; - } - - public void setLinearScanNumber(int linearScanNumber) { - this.linearScanNumber = linearScanNumber; - } - - public boolean isAligned() { - return align; - } - - public void setAlign(boolean align) { - this.align = align; - } -}
--- a/graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/AbstractControlFlowGraph.java Thu Apr 17 13:17:25 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2014, 2014, 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.cfg; - -import java.util.*; - -public interface AbstractControlFlowGraph<T extends AbstractBlock<T>> { - - static final int BLOCK_ID_INITIAL = -1; - static final int BLOCK_ID_VISITED = -2; - - T[] getBlocks(); - - Collection<Loop<T>> getLoops(); - - T getStartBlock(); -}
--- a/graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/BlockMap.java Thu Apr 17 13:17:25 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2012, 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.cfg; - -public class BlockMap<T> { - - private final T[] data; - - @SuppressWarnings("unchecked") - public BlockMap(AbstractControlFlowGraph<?> cfg) { - data = (T[]) new Object[cfg.getBlocks().length]; - } - - public T get(AbstractBlock<?> block) { - return data[block.getId()]; - } - - public void put(AbstractBlock<?> block, T value) { - data[block.getId()] = value; - } -}
--- a/graal/com.oracle.graal.cfg/src/com/oracle/graal/cfg/Loop.java Thu Apr 17 13:17:25 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012, 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.cfg; - -import java.util.*; - -public abstract class Loop<T extends AbstractBlock<T>> { - - public final Loop<T> parent; - public final List<Loop<T>> children; - - public final int depth; - public final int index; - public final T header; - public final List<T> blocks; - public final List<T> exits; - - protected Loop(Loop<T> parent, int index, T header) { - this.parent = parent; - if (parent != null) { - this.depth = parent.depth + 1; - parent.children.add(this); - } else { - this.depth = 1; - } - this.index = index; - this.header = header; - this.blocks = new ArrayList<>(); - this.children = new ArrayList<>(); - this.exits = new ArrayList<>(); - } - - public abstract long numBackedges(); - - @Override - public String toString() { - return "loop " + index + " depth " + depth + (parent != null ? " outer " + parent.index : ""); - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/AbstractBlock.java Thu Apr 17 13:16:21 2014 +0200 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2014, 2014, 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.cfg; + +import java.util.*; + +public interface AbstractBlock<T extends AbstractBlock<T>> { + + int getId(); + + Loop<T> getLoop(); + + int getLoopDepth(); + + boolean isLoopHeader(); + + boolean isLoopEnd(); + + boolean isExceptionEntry(); + + List<T> getPredecessors(); + + int getPredecessorCount(); + + List<T> getSuccessors(); + + int getSuccessorCount(); + + int getLinearScanNumber(); + + void setLinearScanNumber(int linearScanNumber); + + boolean isAligned(); + + void setAlign(boolean align); + + T getDominator(); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/AbstractBlockBase.java Thu Apr 17 13:16:21 2014 +0200 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2009, 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.cfg; + +import java.util.*; + +public abstract class AbstractBlockBase<T extends AbstractBlock<T>> implements AbstractBlock<T> { + + protected int id; + + protected List<T> predecessors; + protected List<T> successors; + + private T dominator; + + private boolean align; + private int linearScanNumber; + + protected AbstractBlockBase() { + this.id = AbstractControlFlowGraph.BLOCK_ID_INITIAL; + this.linearScanNumber = -1; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public List<T> getPredecessors() { + return predecessors; + } + + public void setPredecessors(List<T> predecessors) { + this.predecessors = predecessors; + } + + public List<T> getSuccessors() { + return successors; + } + + public void setSuccessors(List<T> successors) { + this.successors = successors; + } + + public T getDominator() { + return dominator; + } + + public void setDominator(T dominator) { + this.dominator = dominator; + } + + @Override + public String toString() { + return "B" + id; + } + + public int getPredecessorCount() { + return getPredecessors().size(); + } + + public int getSuccessorCount() { + return getSuccessors().size(); + } + + public int getLinearScanNumber() { + return linearScanNumber; + } + + public void setLinearScanNumber(int linearScanNumber) { + this.linearScanNumber = linearScanNumber; + } + + public boolean isAligned() { + return align; + } + + public void setAlign(boolean align) { + this.align = align; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/AbstractControlFlowGraph.java Thu Apr 17 13:16:21 2014 +0200 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014, 2014, 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.cfg; + +import java.util.*; + +public interface AbstractControlFlowGraph<T extends AbstractBlock<T>> { + + static final int BLOCK_ID_INITIAL = -1; + static final int BLOCK_ID_VISITED = -2; + + T[] getBlocks(); + + Collection<Loop<T>> getLoops(); + + T getStartBlock(); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/BlockMap.java Thu Apr 17 13:16:21 2014 +0200 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2012, 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.cfg; + +public class BlockMap<T> { + + private final T[] data; + + @SuppressWarnings("unchecked") + public BlockMap(AbstractControlFlowGraph<?> cfg) { + data = (T[]) new Object[cfg.getBlocks().length]; + } + + public T get(AbstractBlock<?> block) { + return data[block.getId()]; + } + + public void put(AbstractBlock<?> block, T value) { + data[block.getId()] = value; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/cfg/Loop.java Thu Apr 17 13:16:21 2014 +0200 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2012, 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.cfg; + +import java.util.*; + +public abstract class Loop<T extends AbstractBlock<T>> { + + public final Loop<T> parent; + public final List<Loop<T>> children; + + public final int depth; + public final int index; + public final T header; + public final List<T> blocks; + public final List<T> exits; + + protected Loop(Loop<T> parent, int index, T header) { + this.parent = parent; + if (parent != null) { + this.depth = parent.depth + 1; + parent.children.add(this); + } else { + this.depth = 1; + } + this.index = index; + this.header = header; + this.blocks = new ArrayList<>(); + this.children = new ArrayList<>(); + this.exits = new ArrayList<>(); + } + + public abstract long numBackedges(); + + @Override + public String toString() { + return "loop " + index + " depth " + depth + (parent != null ? " outer " + parent.index : ""); + } +}
--- a/mx/projects Thu Apr 17 13:17:25 2014 +0200 +++ b/mx/projects Thu Apr 17 13:16:21 2014 +0200 @@ -373,7 +373,7 @@ # graal.nodes project@com.oracle.graal.nodes@subDir=graal project@com.oracle.graal.nodes@sourceDirs=src -project@com.oracle.graal.nodes@dependencies=com.oracle.graal.graph,com.oracle.graal.api.replacements,com.oracle.graal.cfg +project@com.oracle.graal.nodes@dependencies=com.oracle.graal.graph,com.oracle.graal.api.replacements,com.oracle.graal.compiler.common project@com.oracle.graal.nodes@checkstyle=com.oracle.graal.graph project@com.oracle.graal.nodes@javaCompliance=1.8 project@com.oracle.graal.nodes@annotationProcessors=com.oracle.graal.replacements.verifier @@ -499,13 +499,13 @@ project@com.oracle.graal.java@javaCompliance=1.8 project@com.oracle.graal.java@workingSets=Graal,Java -# graal.cfg -project@com.oracle.graal.cfg@subDir=graal -project@com.oracle.graal.cfg@sourceDirs=src -project@com.oracle.graal.cfg@dependencies= -project@com.oracle.graal.cfg@checkstyle=com.oracle.graal.graph -project@com.oracle.graal.cfg@javaCompliance=1.8 -project@com.oracle.graal.cfg@workingSets=Graal,Java +# graal.compiler.common +project@com.oracle.graal.compiler.common@subDir=graal +project@com.oracle.graal.compiler.common@sourceDirs=src +project@com.oracle.graal.compiler.common@dependencies= +project@com.oracle.graal.compiler.common@checkstyle=com.oracle.graal.graph +project@com.oracle.graal.compiler.common@javaCompliance=1.8 +project@com.oracle.graal.compiler.common@workingSets=Graal,Java # graal.baseline project@com.oracle.graal.baseline@subDir=graal