Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/InitializeObjectNode.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 | 0b62a9d44c21 |
children | 96a337d307bd |
rev | line source |
---|---|
5663
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via 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 |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via 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 |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.nodes; |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 import com.oracle.graal.api.meta.*; |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 import com.oracle.graal.nodes.*; |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
27 import com.oracle.graal.nodes.spi.*; |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
28 import com.oracle.graal.nodes.type.*; |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6511
diff
changeset
|
31 * Initializes the header and body of an uninitialized object cell. This node calls out to a stub to |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6511
diff
changeset
|
32 * do both the allocation and formatting if the memory address it is given is zero/null (e.g. due to |
5663
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
33 * {@linkplain TLABAllocateNode TLAB allocation} failing). |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 */ |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5720
diff
changeset
|
35 public final class InitializeObjectNode extends FixedWithNextNode implements Lowerable { |
5663
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
36 |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 @Input private final ValueNode memory; |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
38 private final ResolvedJavaType type; |
6355
892d3c82febe
add support for fillConents to NewObjectSnippets
Lukas Stadler <lukas.stadler@jku.at>
parents:
5760
diff
changeset
|
39 private final boolean fillContents; |
6511
0b62a9d44c21
add infrastructure for creating locked objects
Lukas Stadler <lukas.stadler@jku.at>
parents:
6355
diff
changeset
|
40 private final boolean locked; |
5663
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 |
6511
0b62a9d44c21
add infrastructure for creating locked objects
Lukas Stadler <lukas.stadler@jku.at>
parents:
6355
diff
changeset
|
42 public InitializeObjectNode(ValueNode memory, ResolvedJavaType type, boolean fillContents, boolean locked) { |
5663
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
43 super(StampFactory.exactNonNull(type)); |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
44 this.memory = memory; |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
45 this.type = type; |
6355
892d3c82febe
add support for fillConents to NewObjectSnippets
Lukas Stadler <lukas.stadler@jku.at>
parents:
5760
diff
changeset
|
46 this.fillContents = fillContents; |
6511
0b62a9d44c21
add infrastructure for creating locked objects
Lukas Stadler <lukas.stadler@jku.at>
parents:
6355
diff
changeset
|
47 this.locked = locked; |
5663
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
48 } |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
49 |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
50 public ValueNode memory() { |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
51 return memory; |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
52 } |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
53 |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 public ResolvedJavaType type() { |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
55 return type; |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
56 } |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
57 |
6355
892d3c82febe
add support for fillConents to NewObjectSnippets
Lukas Stadler <lukas.stadler@jku.at>
parents:
5760
diff
changeset
|
58 public boolean fillContents() { |
892d3c82febe
add support for fillConents to NewObjectSnippets
Lukas Stadler <lukas.stadler@jku.at>
parents:
5760
diff
changeset
|
59 return fillContents; |
892d3c82febe
add support for fillConents to NewObjectSnippets
Lukas Stadler <lukas.stadler@jku.at>
parents:
5760
diff
changeset
|
60 } |
892d3c82febe
add support for fillConents to NewObjectSnippets
Lukas Stadler <lukas.stadler@jku.at>
parents:
5760
diff
changeset
|
61 |
6511
0b62a9d44c21
add infrastructure for creating locked objects
Lukas Stadler <lukas.stadler@jku.at>
parents:
6355
diff
changeset
|
62 public boolean locked() { |
0b62a9d44c21
add infrastructure for creating locked objects
Lukas Stadler <lukas.stadler@jku.at>
parents:
6355
diff
changeset
|
63 return locked; |
0b62a9d44c21
add infrastructure for creating locked objects
Lukas Stadler <lukas.stadler@jku.at>
parents:
6355
diff
changeset
|
64 } |
0b62a9d44c21
add infrastructure for creating locked objects
Lukas Stadler <lukas.stadler@jku.at>
parents:
6355
diff
changeset
|
65 |
5663
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
66 @Override |
5718
10341299528c
renamings: ExtendedRiRuntime -> GraalCodeCacheProvider, CiLoweringTool -> LoweringTool, RiGraphCache -> GraphCache
Doug Simon <doug.simon@oracle.com>
parents:
5663
diff
changeset
|
67 public void lower(LoweringTool tool) { |
5663
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
68 tool.getRuntime().lower(this, tool); |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
69 } |
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
70 } |