changeset 2657:4a6518c4d17d

Removed need for base instruction. Cleanup.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 11 May 2011 16:10:49 +0200
parents 37f067e76c6f
children 63633fb05914
files graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java graal/GraalCompiler/src/com/sun/c1x/ir/AccessIndexed.java graal/GraalCompiler/src/com/sun/c1x/ir/ArrayLength.java graal/GraalCompiler/src/com/sun/c1x/ir/Base.java graal/GraalCompiler/src/com/sun/c1x/ir/BlockClosure.java graal/GraalCompiler/src/com/sun/c1x/ir/BlockList.java graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java graal/GraalCompiler/src/com/sun/c1x/ir/Constant.java graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionHandler.java graal/GraalCompiler/src/com/sun/c1x/ir/NegateOp.java graal/GraalCompiler/src/com/sun/c1x/ir/package-info.java
diffstat 11 files changed, 7 insertions(+), 108 deletions(-) [+]
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Wed May 11 16:10:49 2011 +0200
@@ -210,10 +210,9 @@
 
     private void finishStartBlock(BlockBegin startBlock, BlockBegin stdEntry) {
         assert curBlock == startBlock;
-        Base base = new Base(stdEntry, graph);
+        FrameState stateAfter = frameState.create(bci());
+        Goto base = new Goto(stdEntry, stateAfter, false, graph);
         appendWithoutOptimization(base, 0);
-        FrameState stateAfter = frameState.create(bci());
-        base.setStateAfter(stateAfter);
         startBlock.setEnd(base);
         assert stdEntry.stateBefore() == null;
         stdEntry.mergeOrClone(stateAfter, method());
@@ -325,7 +324,7 @@
         return handler.isCatchAll();
     }
 
-    void genLoadConstant(int cpi) {
+    private void genLoadConstant(int cpi) {
         Object con = constantPool().lookupConstant(cpi);
 
         if (con instanceof RiType) {
@@ -939,11 +938,7 @@
         assert x.next() == null : "instruction should not have been appended yet";
         assert lastInstr.next() == null : "cannot append instruction to instruction which isn't end (" + lastInstr + "->" + lastInstr.next() + ")";
 
-        if (lastInstr instanceof Base) {
-            assert false : "may only happen when inlining intrinsics";
-        } else {
-            lastInstr = lastInstr.appendNext(x, bci);
-        }
+        lastInstr = lastInstr.appendNext(x, bci);
         if (++stats.nodeCount >= C1XOptions.MaximumInstructionCount) {
             // bailout if we've exceeded the maximum inlining size
             throw new CiBailout("Method and/or inlining is too large");
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/AccessIndexed.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/AccessIndexed.java	Wed May 11 16:10:49 2011 +0200
@@ -28,8 +28,6 @@
 /**
  * The {@code AccessIndexed} class is the base class of instructions that read or write
  * elements of an array.
- *
- * @author Ben L. Titzer
  */
 public abstract class AccessIndexed extends AccessArray {
 
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/ArrayLength.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ArrayLength.java	Wed May 11 16:10:49 2011 +0200
@@ -30,8 +30,6 @@
 
 /**
  * The {@code ArrayLength} instruction gets the length of an array.
- *
- * @author Ben L. Titzer
  */
 public final class ArrayLength extends AccessArray {
 
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Base.java	Wed May 11 15:23:07 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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.c1x.ir;
-
-import com.oracle.graal.graph.*;
-import com.sun.c1x.debug.*;
-import com.sun.cri.ci.*;
-
-/**
- * The {@code Base} instruction represents the end of the entry block of the procedure that has
- * both the standard entry and the OSR entry as successors.
- */
-public final class Base extends BlockEnd {
-
-    private static final int INPUT_COUNT = 0;
-    private static final int SUCCESSOR_COUNT = 0;
-
-    /**
-     * Constructs a new Base instruction.
-     * @param standardEntry the standard entrypoint block
-     * @param graph
-     */
-    public Base(BlockBegin standardEntry, Graph graph) {
-        super(CiKind.Illegal, null, false, 1, INPUT_COUNT, SUCCESSOR_COUNT, graph);
-        setBlockSuccessor(0, standardEntry);
-    }
-
-    /**
-     * Gets the standard entrypoint block.
-     * @return the standard entrypoint block
-     */
-    public BlockBegin standardEntry() {
-        return defaultSuccessor();
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitBase(this);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print("std entry B").print(standardEntry().blockID);
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockClosure.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockClosure.java	Wed May 11 16:10:49 2011 +0200
@@ -24,8 +24,6 @@
 
 /**
  * The {@code BlockClosure} interface represents a closure for iterating over blocks.
- *
- * @author Ben L. Titzer
  */
 public interface BlockClosure {
     void apply(BlockBegin block);
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockList.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockList.java	Wed May 11 16:10:49 2011 +0200
@@ -27,8 +27,6 @@
 /**
  * The {@code BlockList} class implements a specialized list data structure for representing
  * the predecessor and successor lists of basic blocks.
- *
- * @author Ben L. Titzer
  */
 public class BlockList implements Iterable<BlockBegin> {
 
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java	Wed May 11 16:10:49 2011 +0200
@@ -30,10 +30,6 @@
 import com.sun.c1x.util.*;
 import com.sun.cri.ci.*;
 
-/**
- * @author Thomas Wuerthinger
- *
- */
 public final class ComputeLinearScanOrder {
 
     private final int maxBlockId; // the highest blockId of a block
@@ -498,18 +494,12 @@
 
         // the start block is always the first block in the linear scan order
         linearScanOrder = new ArrayList<BlockBegin>(numBlocks);
-        appendBlock(startBlock);
-
-        assert startBlock.end() instanceof Base : "start block must end with Base-instruction";
-        BlockBegin stdEntry = ((Base) startBlock.end()).standardEntry();
-
-        computeDominator(stdEntry, startBlock);
 
         // start processing with standard entry block
         assert workList.isEmpty() : "list must be empty before processing";
 
-        if (readyForProcessing(stdEntry)) {
-            sortIntoWorkList(stdEntry);
+        if (readyForProcessing(startBlock)) {
+            sortIntoWorkList(startBlock);
         } else {
             throw new CiBailout("the stdEntry must be ready for processing (otherwise, the method has no start block)");
         }
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Constant.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Constant.java	Wed May 11 16:10:49 2011 +0200
@@ -32,8 +32,6 @@
 /**
  * The {@code Constant} instruction represents a constant such as an integer value,
  * long, float, object reference, address, etc.
- *
- * @author Ben L. Titzer
  */
 public final class Constant extends Instruction {
 
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionHandler.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionHandler.java	Wed May 11 16:10:49 2011 +0200
@@ -35,8 +35,6 @@
  * execution of the instruction. The latter is used to generate exception adapter blocks
  * (see section 3.4 of the paper <a href="http://www.usenix.org/events/vee05/full_papers/p132-wimmer.pdf">
  * Optimized Interval Splitting in a Linear Scan Register Allocator</a>) where necessary.
- *
- * @author Ben L. Titzer
  */
 public final class ExceptionHandler {
 
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/NegateOp.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/NegateOp.java	Wed May 11 16:10:49 2011 +0200
@@ -29,8 +29,6 @@
 
 /**
  * The {@code NegateOp} instruction negates its operand.
- *
- * @author Ben L. Titzer
  */
 public final class NegateOp extends Instruction {
 
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/package-info.java	Wed May 11 15:23:07 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/package-info.java	Wed May 11 16:10:49 2011 +0200
@@ -22,13 +22,6 @@
  */
 
 /**
- * @author Ben Titzer
- *
- *         Classes that define the (High-level) Intermediate Representation (HIR) if the C1X compiler.
- *
- *         HIR instances are created by processing Java bytecodes and are Directed Acyclic Graphs (DAGs). All nodes in
- *         an HIR graph are concrete subclasses of the abstract class {@link Value}. This indicates a property of HIR,
- *         namely that everything is a value, including instructions. This allows an operand for an instruction node to
- *         refer directly to the node that generated the value, which might, for example, be another instruction.
+ * High-level intermediate representation (HIR).
  */
 package com.sun.c1x.ir;