# HG changeset patch # User Thomas Wuerthinger # Date 1305123049 -7200 # Node ID 4a6518c4d17dd6af9caf1d8d9be6273354852397 # Parent 37f067e76c6fbb2d842a63b93d96691fc6f2732f Removed need for base instruction. Cleanup. diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java --- 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"); diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/AccessIndexed.java --- 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 { diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/ArrayLength.java --- 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 { diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/Base.java --- 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); - } -} diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/BlockClosure.java --- 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); diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/BlockList.java --- 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 { diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java --- 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(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)"); } diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/Constant.java --- 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 { diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionHandler.java --- 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 * Optimized Interval Splitting in a Linear Scan Register Allocator) where necessary. - * - * @author Ben L. Titzer */ public final class ExceptionHandler { diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/NegateOp.java --- 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 { diff -r 37f067e76c6f -r 4a6518c4d17d graal/GraalCompiler/src/com/sun/c1x/ir/package-info.java --- 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;