annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MaterializeNode.java @ 7530:5e3d1a68664e

applied mx eclipseformat to all Java files
author Doug Simon <doug.simon@oracle.com>
date Wed, 23 Jan 2013 16:34:57 +0100
parents 346336325337
children 630ea5001e33
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
23 package com.oracle.graal.nodes;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6662
diff changeset
25 import static com.oracle.graal.nodes.calc.CompareNode.*;
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6662
diff changeset
26
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
27 import com.oracle.graal.graph.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
28 import com.oracle.graal.nodes.calc.*;
7278
346336325337 added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
29 import com.oracle.graal.nodes.java.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
30
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31 public final class MaterializeNode extends ConditionalNode {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32
5763
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
33 private MaterializeNode(Condition condition, ValueNode x, ValueNode y) {
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
34 this(createCompareNode(condition, x, y), ConstantNode.forInt(1, x.graph()), ConstantNode.forInt(0, x.graph()));
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
35 }
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
36
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 private MaterializeNode(BooleanNode condition, ValueNode trueValue, ValueNode falseValue) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 super(condition, trueValue, falseValue);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40
7278
346336325337 added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
41 private MaterializeNode(ValueNode type, ValueNode object) {
346336325337 added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
42 super(type.graph().add(new InstanceOfDynamicNode(type, object)), ConstantNode.forInt(1, type.graph()), ConstantNode.forInt(0, type.graph()));
346336325337 added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
43 }
346336325337 added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
44
5763
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
45 public static MaterializeNode create(BooleanNode condition, ValueNode trueValue, ValueNode falseValue) {
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
46 Graph graph = condition.graph();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 MaterializeNode result = new MaterializeNode(condition, trueValue, falseValue);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 return graph.unique(result);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51
5763
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
52 public static MaterializeNode create(BooleanNode condition) {
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
53 return create(condition, ConstantNode.forInt(1, condition.graph()), ConstantNode.forInt(0, condition.graph()));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55
5763
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
56 @NodeIntrinsic
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7278
diff changeset
57 public static native boolean materialize(@ConstantNodeParameter
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7278
diff changeset
58 Condition condition, int x, int y);
5763
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
59
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
60 @NodeIntrinsic
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7278
diff changeset
61 public static native boolean materialize(@ConstantNodeParameter
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7278
diff changeset
62 Condition condition, long x, long y);
7278
346336325337 added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
63
346336325337 added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
64 @NodeIntrinsic
346336325337 added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
65 public static native boolean isInstance(Class mirror, Object object);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
66 }