001/*
002 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation.
008 *
009 * This code is distributed in the hope that it will be useful, but WITHOUT
010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
011 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
012 * version 2 for more details (a copy is included in the LICENSE file that
013 * accompanied this code).
014 *
015 * You should have received a copy of the GNU General Public License version
016 * 2 along with this work; if not, write to the Free Software Foundation,
017 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
018 *
019 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
020 * or visit www.oracle.com if you need additional information or have any
021 * questions.
022 */
023package com.oracle.graal.nodes.spi;
024
025import java.util.*;
026
027import jdk.internal.jvmci.code.*;
028import jdk.internal.jvmci.meta.*;
029
030import com.oracle.graal.compiler.common.cfg.*;
031import com.oracle.graal.compiler.common.type.*;
032import com.oracle.graal.graph.*;
033import com.oracle.graal.lir.*;
034import com.oracle.graal.lir.gen.*;
035import com.oracle.graal.nodes.*;
036import com.oracle.graal.nodes.calc.*;
037import com.oracle.graal.nodes.cfg.*;
038import com.oracle.graal.nodes.extended.*;
039
040public interface NodeLIRBuilderTool extends NodeValueMap {
041
042    // TODO (je) remove and move into the Node
043    LIRFrameState state(DeoptimizingNode deopt);
044
045    void emitIf(IfNode i);
046
047    void emitConditional(ConditionalNode i);
048
049    void emitSwitch(SwitchNode i);
050
051    void emitInvoke(Invoke i);
052
053    // Handling of block-end nodes still needs to be unified in the LIRGenerator.
054    void visitMerge(AbstractMergeNode i);
055
056    void visitEndNode(AbstractEndNode i);
057
058    void visitLoopEnd(LoopEndNode i);
059
060    // These methods define the contract a runtime specific backend must provide.
061
062    void visitSafepointNode(SafepointNode i);
063
064    void visitBreakpointNode(BreakpointNode i);
065
066    void visitFullInfopointNode(FullInfopointNode i);
067
068    void visitSimpleInfopointNode(SimpleInfopointNode i);
069
070    LIRGeneratorTool getLIRGeneratorTool();
071
072    void emitOverflowCheckBranch(AbstractBeginNode overflowSuccessor, AbstractBeginNode next, Stamp compareStamp, double probability);
073
074    Value[] visitInvokeArguments(CallingConvention cc, Collection<ValueNode> arguments);
075
076    void doBlock(Block block, StructuredGraph graph, BlockMap<List<Node>> blockMap);
077}