NodeValueMap.java revision 12651:6ef01bd40ce2
1100364Smarkm/* 212099Sjoerg * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 312099Sjoerg * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 412099Sjoerg * 512099Sjoerg * This code is free software; you can redistribute it and/or modify it 612099Sjoerg * under the terms of the GNU General Public License version 2 only, as 712099Sjoerg * published by the Free Software Foundation. 812099Sjoerg * 912099Sjoerg * This code is distributed in the hope that it will be useful, but WITHOUT 1012099Sjoerg * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1112099Sjoerg * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1212099Sjoerg * version 2 for more details (a copy is included in the LICENSE file that 1312099Sjoerg * accompanied this code). 1412099Sjoerg * 1512099Sjoerg * You should have received a copy of the GNU General Public License version 1612099Sjoerg * 2 along with this work; if not, write to the Free Software Foundation, 1712099Sjoerg * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1812099Sjoerg * 1912099Sjoerg * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2012099Sjoerg * or visit www.oracle.com if you need additional information or have any 2112099Sjoerg * questions. 2212099Sjoerg */ 2312099Sjoerg 2412099Sjoergpackage org.graalvm.compiler.nodes.spi; 2512099Sjoerg 2612099Sjoergimport org.graalvm.compiler.graph.Node; 2712099Sjoergimport org.graalvm.compiler.nodes.ValueNode; 2812099Sjoerg 2912099Sjoergimport jdk.vm.ci.meta.Value; 3012099Sjoerg 3112099Sjoergpublic interface NodeValueMap { 3212099Sjoerg 3312099Sjoerg /** 3491592Smarkm * Returns the operand that has been previously initialized by 3591592Smarkm * {@link #setResult(ValueNode, Value)} with the result of an instruction. It's a code 36100364Smarkm * generation error to ask for the operand of ValueNode that doesn't have one yet. 3712099Sjoerg * 3891592Smarkm * @param node A node that produces a result value. 3912099Sjoerg */ 4091592Smarkm Value operand(Node node); 4191592Smarkm 4291592Smarkm /** 4391592Smarkm * @return {@code true} if there is an {@link Value operand} associated with the {@code node} in 4491592Smarkm * the current block. 4591592Smarkm */ 4612099Sjoerg boolean hasOperand(Node node); 4712099Sjoerg 4812099Sjoerg /** 4912099Sjoerg * Associates {@code operand} with the {@code node} in the current block. 5012099Sjoerg * 5112099Sjoerg * @return {@code operand} 5212099Sjoerg */ 53100364Smarkm Value setResult(ValueNode node, Value operand); 5491592Smarkm 5591592Smarkm /** 5612099Sjoerg * Gets the the {@link ValueNode} that produced a {@code value}. If the {@code value} is not 5712099Sjoerg * associated with a {@link ValueNode} {@code null} is returned. 5812099Sjoerg * 5912099Sjoerg * This method is intended for debugging purposes only. 6012099Sjoerg */ 6112099Sjoerg ValueNode valueForOperand(Value value); 6212099Sjoerg} 6312099Sjoerg