comparison graal/GraalCompiler/src/com/sun/c1x/ir/UnsafeObjectOp.java @ 2509:16b9a8b5ad39

Renamings Runtime=>GraalRuntime and Compiler=>GraalCompiler
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Apr 2011 11:50:44 +0200
parents graal/Compiler/src/com/sun/c1x/ir/UnsafeObjectOp.java@9ec15d6914ca
children
comparison
equal deleted inserted replaced
2508:fea94949e0a2 2509:16b9a8b5ad39
1 /*
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package com.sun.c1x.ir;
24
25 import com.sun.cri.ci.*;
26
27 /**
28 * The {@code UnsafeObjectOp} class is the base of all unsafe object instructions.
29 *
30 * @author Ben L. Titzer
31 */
32 public abstract class UnsafeObjectOp extends UnsafeOp {
33
34 Value object;
35 Value offset;
36 final boolean isVolatile;
37
38 /**
39 * Creates a new UnsafeObjectOp instruction.
40 * @param opKind the kind of the operation
41 * @param object the instruction generating the object
42 * @param offset the instruction generating the index
43 * @param isStore {@code true} if this is a store operation
44 * @param isVolatile {@code true} if the operation is volatile
45 */
46 public UnsafeObjectOp(CiKind opKind, Value object, Value offset, boolean isStore, boolean isVolatile) {
47 super(opKind, isStore);
48 this.object = object;
49 this.offset = offset;
50 this.isVolatile = isVolatile;
51 }
52
53 /**
54 * Gets the instruction that generates the object.
55 * @return the instruction that produces the object
56 */
57 public Value object() {
58 return object;
59 }
60
61 /**
62 * Gets the instruction that generates the offset.
63 * @return the instruction generating the offset
64 */
65 public Value offset() {
66 return offset;
67 }
68
69 /**
70 * Checks whether this is a volatile operation.
71 * @return {@code true} if this operation is volatile
72 */
73 public boolean isVolatile() {
74 return isVolatile;
75 }
76
77 /**
78 * Iterates over the input values of this instruction.
79 * @param closure the closure to apply
80 */
81 @Override
82 public void inputValuesDo(ValueClosure closure) {
83 super.inputValuesDo(closure);
84 object = closure.apply(object);
85 offset = closure.apply(offset);
86 }
87 }