annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/GetObjectAddressNode.java @ 6390:1e1c85d9ca7e

moved Node classes into com.oracle.graal.hotspot.nodes package
author Doug Simon <doug.simon@oracle.com>
date Fri, 14 Sep 2012 13:32:04 +0200
parents graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/GetObjectAddressNode.java@a891c53a295b
children fb66841a0994
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5400
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
6390
1e1c85d9ca7e moved Node classes into com.oracle.graal.hotspot.nodes package
Doug Simon <doug.simon@oracle.com>
parents: 5540
diff changeset
23 package com.oracle.graal.hotspot.nodes;
5400
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5506
diff changeset
25 import com.oracle.graal.api.meta.*;
5400
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26 import com.oracle.graal.nodes.*;
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27 import com.oracle.graal.nodes.spi.*;
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28 import com.oracle.graal.nodes.type.*;
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
29
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 /**
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 * Intrinsification for getting the address of an object.
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
32 * The code path(s) between a call to {@link #get(Object)} and all uses
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
33 * of the returned value must be atomic. The only exception to this is
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
34 * if the usage is not an attempt to dereference the value.
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 */
6390
1e1c85d9ca7e moved Node classes into com.oracle.graal.hotspot.nodes package
Doug Simon <doug.simon@oracle.com>
parents: 5540
diff changeset
36 public class GetObjectAddressNode extends FixedWithNextNode implements LIRLowerable {
5400
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37 @Input private ValueNode object;
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
38
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39 public GetObjectAddressNode(ValueNode obj) {
5540
a891c53a295b Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5539
diff changeset
40 super(StampFactory.forKind(Kind.Long));
5400
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
41 this.object = obj;
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42 }
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
43
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
44 @SuppressWarnings("unused")
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45 @NodeIntrinsic
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46 public static long get(Object array) {
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
47 throw new UnsupportedOperationException();
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
48 }
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
49
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
50 @Override
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
51 public void generate(LIRGeneratorTool gen) {
5539
bc647d8b0080 Renaming RiValue => Value.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5507
diff changeset
52 Value obj = gen.newVariable(gen.target().wordKind);
5400
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
53 gen.emitMove(gen.operand(object), obj);
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
54 gen.setResult(this, obj);
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
55 }
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
56 }