annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/DirectStoreNode.java @ 5400:028c9ce0fc0f

added support for -G:+CheckcastCounters in checkcast snippets
author Doug Simon <doug.simon@oracle.com>
date Tue, 15 May 2012 10:03:33 +0200
parents
children 141817e206d4
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 */
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.hotspot.snippets;
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 import com.oracle.graal.nodes.*;
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26 import com.oracle.graal.nodes.extended.*;
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 import com.oracle.max.cri.ci.*;
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 /**
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
32 * A special purpose store node that differs from {@link UnsafeStoreNode} in that
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
33 * it is not a {@link StateSplit} and takes a computed address instead of an object.
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
34 */
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 class DirectStoreNode extends FixedWithNextNode implements LIRLowerable {
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36 @Input private ValueNode address;
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37 @Input private ValueNode value;
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 DirectStoreNode(ValueNode address, ValueNode value) {
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
40 super(StampFactory.illegal());
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
41 this.address = address;
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42 this.value = value;
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
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45 @SuppressWarnings("unused")
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46 @NodeIntrinsic
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
47 public static void store(long address, long value) {
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
48 throw new UnsupportedOperationException();
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
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
51 @SuppressWarnings("unused")
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
52 @NodeIntrinsic
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
53 public static void store(long address, boolean value) {
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
54 throw new UnsupportedOperationException();
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
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
57 @Override
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 public void generate(LIRGeneratorTool gen) {
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
59 CiValue v = gen.operand(value);
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
60 gen.emitStore(new CiAddress(v.kind, gen.operand(address)), v, false);
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
61 }
028c9ce0fc0f added support for -G:+CheckcastCounters in checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
62 }