annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java @ 5841:f84d11672a86

vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
author Doug Simon <doug.simon@oracle.com>
date Mon, 16 Jul 2012 15:20:50 +0200
parents f238fe91dc7f
children 823a2978e7ba
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) 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
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5504
diff changeset
25 import com.oracle.graal.api.meta.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
26 import com.oracle.graal.graph.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
27 import com.oracle.graal.nodes.spi.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
28 import com.oracle.graal.nodes.type.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
30 public abstract class CallTargetNode extends ValueNode implements LIRLowerable {
5598
a9b615da0cba removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents: 5541
diff changeset
31
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32 @Input protected final NodeInputList<ValueNode> arguments;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33
5841
f84d11672a86 vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
34 /**
f84d11672a86 vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
35 * The address computation for an indirect call (e.g., invokevirtual or invokeinterface).
f84d11672a86 vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
36 */
f84d11672a86 vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
37 @Input protected ValueNode computedAddress;
5798
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5598
diff changeset
38
5841
f84d11672a86 vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
39 public ValueNode computedAddress() {
f84d11672a86 vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
40 return computedAddress;
5798
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5598
diff changeset
41 }
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5598
diff changeset
42
5841
f84d11672a86 vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
43 public void setComputedAddress(ValueNode address) {
f84d11672a86 vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
44 updateUsages(this.computedAddress, address);
f84d11672a86 vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
45 this.computedAddress = address;
5798
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5598
diff changeset
46 }
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5598
diff changeset
47
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 public CallTargetNode(ValueNode[] arguments) {
5443
141817e206d4 changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents: 5061
diff changeset
49 super(StampFactory.extension());
4142
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
50 this.arguments = new NodeInputList<>(this, arguments);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
52
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 public NodeInputList<ValueNode> arguments() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 return arguments;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56
5541
b4c406861c33 More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
57 public abstract JavaType returnType();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
58
5540
a891c53a295b Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5507
diff changeset
59 public abstract Kind returnKind();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62 public void generate(LIRGeneratorTool gen) {
5598
a9b615da0cba removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents: 5541
diff changeset
63 // nop
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 }