Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java @ 5814:d241f8b2e6f9
Adapt the coloring filter for binary dumped graphs
Update no framestate filter to also remove virtual nodes
Improve binary serialization of fields and methods
Made sure xml serialzer still works for dumping arrays in properties
Added some nameTemplates
Improved Name templates to optionaly use a short version of the elements
Factored away elementType between NewPrimitiveArrayNode and NewObjectArrayNode into NewArrayNode
restored Begin/End nodes shortNames
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 11 Jul 2012 14:13:38 +0200 |
parents | 3b8bc07f8d17 |
children | 67a357e3e42a |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
4233
fa53d5e4aa35
Remove lock information from frame states, and compute it instead when LIR is generated.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4199
diff
changeset
|
2 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. |
3733
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 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 import java.util.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
26 |
5510
426c605c9d3c
Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
27 import com.oracle.graal.api.code.*; |
5507
dc71b06d09f8
Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5503
diff
changeset
|
28 import com.oracle.graal.api.meta.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
29 import com.oracle.graal.graph.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
30 import com.oracle.graal.graph.iterators.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
31 import com.oracle.graal.nodes.spi.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
32 import com.oracle.graal.nodes.virtual.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
33 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
35 * The {@code FrameState} class encapsulates the frame state (i.e. local variables and |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
36 * operand stack) at a particular point in the abstract interpretation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 */ |
5814
d241f8b2e6f9
Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5813
diff
changeset
|
38 @NodeInfo(nameTemplate = "FrameState@{p#method/s}:{p#bci}") |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
39 public final class FrameState extends VirtualState implements Node.IterableNodeType, LIRLowerable { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
40 |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
41 /** |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
42 * An instance of this class is an identifier for all nodes that were generated by one specific inlining operation. |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
43 * It is used to generate the correct debug information for nested locks. |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
44 */ |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
45 public static final class InliningIdentifier { |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
46 private final ResolvedJavaMethod method; |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
47 private final String context; |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
48 |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
49 public InliningIdentifier(ResolvedJavaMethod method, String context) { |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
50 this.method = method; |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
51 this.context = context; |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
52 } |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
53 |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
54 @Override |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
55 public String toString() { |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
56 return method + "@" + context; |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
57 } |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
58 } |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
59 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
60 protected final int localsSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
61 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
62 protected final int stackSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
63 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
64 private boolean rethrowException; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
65 |
4678
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
66 private boolean duringCall; |
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
67 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
68 /** |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
69 * This object identifies the concrete inlining operation that produced this frame state. |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
70 * It is set during inlining, therefore for the outermost frame states of a graph this field is null. |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
71 */ |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
72 private InliningIdentifier inliningIdentifier; |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
73 |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
74 /** |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
75 * This BCI should be used for frame states that are built for code with no meaningful BCI. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
76 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
77 public static final int UNKNOWN_BCI = -4; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
78 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
79 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
80 * When a node whose frame state has this BCI value is inlined, its frame state |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 * will be replaced with the frame state before the inlined invoke node. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
82 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
83 public static final int BEFORE_BCI = -1; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
84 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
85 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
86 * When a node whose frame state has this BCI value is inlined, its frame state |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
87 * will be replaced with the frame state {@linkplain Invoke#stateAfter() after} |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
88 * the inlined invoke node. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
89 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
90 public static final int AFTER_BCI = -2; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
91 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
92 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
93 * When a node whose frame state has this BCI value is inlined, its frame state |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
94 * will be replaced with the frame state at the exception edge of the inlined |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
95 * invoke node. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
96 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
97 public static final int AFTER_EXCEPTION_BCI = -3; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
98 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
99 @Input private FrameState outerFrameState; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
100 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
101 @Input private final NodeInputList<ValueNode> values; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
102 |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
103 @Input private final NodeInputList<VirtualObjectState> virtualObjectMappings; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
104 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
105 /** |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
106 * The bytecode index to which this frame state applies. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
107 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
108 public final int bci; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
109 |
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
|
110 private final ResolvedJavaMethod method; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
111 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
112 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
113 * Creates a {@code FrameState} for the given scope and maximum number of stack and local variables. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
114 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
115 * @param method the method for this frame state |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
116 * @param bci the bytecode index of the frame state |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
117 * @param stackSize size of the stack |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
118 * @param rethrowException if true the VM should re-throw the exception on top of the stack when deopt'ing using this framestate |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
119 */ |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
120 public FrameState(ResolvedJavaMethod method, int bci, List<ValueNode> values, int stackSize, boolean rethrowException, boolean duringCall, InliningIdentifier inliningIdentifier, List<VirtualObjectState> virtualObjectMappings) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
121 assert stackSize >= 0; |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
122 assert (bci >= 0 && method != null) || (bci < 0 && method == null && values.isEmpty()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
123 this.method = method; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
124 this.bci = bci; |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
125 this.localsSize = values.size() - stackSize; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
126 this.stackSize = stackSize; |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
127 this.values = new NodeInputList<>(this, values); |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
128 this.virtualObjectMappings = new NodeInputList<>(this, virtualObjectMappings); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
129 this.rethrowException = rethrowException; |
4678
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
130 this.duringCall = duringCall; |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
131 this.inliningIdentifier = inliningIdentifier; |
4170
6fe63e57244e
Remove unnecessary method
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4142
diff
changeset
|
132 assert !rethrowException || stackSize == 1 : "must have exception on top of the stack"; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
133 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
134 |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
135 /** |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
136 * Simple constructor used to create marker FrameStates. |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
137 * @param bci marker bci, needs to be < 0 |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
138 */ |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
139 public FrameState(int bci) { |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
140 this(null, bci, Collections.<ValueNode>emptyList(), 0, false, false, null, Collections.<VirtualObjectState>emptyList()); |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
141 } |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
142 |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
143 public FrameState(ResolvedJavaMethod method, int bci, ValueNode[] locals, ValueNode[] stack, int stackSize, boolean rethrowException, boolean duringCall, InliningIdentifier inliningIdentifier) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
144 this.method = method; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 this.bci = bci; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
146 this.localsSize = locals.length; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
147 this.stackSize = stackSize; |
4233
fa53d5e4aa35
Remove lock information from frame states, and compute it instead when LIR is generated.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4199
diff
changeset
|
148 final ValueNode[] newValues = new ValueNode[locals.length + stackSize]; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
149 for (int i = 0; i < locals.length; i++) { |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
150 assert locals[i] == null || !locals[i].isDeleted(); |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
151 newValues[i] = locals[i]; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
152 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
153 for (int i = 0; i < stackSize; i++) { |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
154 assert stack[i] == null || !stack[i].isDeleted(); |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
155 newValues[localsSize + i] = stack[i]; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
156 } |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
157 this.values = new NodeInputList<>(this, newValues); |
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
158 this.virtualObjectMappings = new NodeInputList<>(this); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
159 this.rethrowException = rethrowException; |
4678
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
160 this.duringCall = duringCall; |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
161 this.inliningIdentifier = inliningIdentifier; |
4170
6fe63e57244e
Remove unnecessary method
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4142
diff
changeset
|
162 assert !rethrowException || stackSize == 1 : "must have exception on top of the stack"; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
163 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
164 |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
165 public NodeIterable<ValueNode> values() { |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
166 return values; |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
167 } |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
168 |
4421
168dd8970b96
Remove RemovePlaceholderPhase, Add InsertStateAfterPlaceholderPhase for snippets so that a method can not deopt from after a snippet invoke into the inlined snippet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4411
diff
changeset
|
169 public FrameState outerFrameState() { |
168dd8970b96
Remove RemovePlaceholderPhase, Add InsertStateAfterPlaceholderPhase for snippets so that a method can not deopt from after a snippet invoke into the inlined snippet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4411
diff
changeset
|
170 return outerFrameState; |
168dd8970b96
Remove RemovePlaceholderPhase, Add InsertStateAfterPlaceholderPhase for snippets so that a method can not deopt from after a snippet invoke into the inlined snippet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4411
diff
changeset
|
171 } |
168dd8970b96
Remove RemovePlaceholderPhase, Add InsertStateAfterPlaceholderPhase for snippets so that a method can not deopt from after a snippet invoke into the inlined snippet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4411
diff
changeset
|
172 |
168dd8970b96
Remove RemovePlaceholderPhase, Add InsertStateAfterPlaceholderPhase for snippets so that a method can not deopt from after a snippet invoke into the inlined snippet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4411
diff
changeset
|
173 public void setOuterFrameState(FrameState x) { |
168dd8970b96
Remove RemovePlaceholderPhase, Add InsertStateAfterPlaceholderPhase for snippets so that a method can not deopt from after a snippet invoke into the inlined snippet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4411
diff
changeset
|
174 updateUsages(this.outerFrameState, x); |
168dd8970b96
Remove RemovePlaceholderPhase, Add InsertStateAfterPlaceholderPhase for snippets so that a method can not deopt from after a snippet invoke into the inlined snippet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4411
diff
changeset
|
175 this.outerFrameState = x; |
168dd8970b96
Remove RemovePlaceholderPhase, Add InsertStateAfterPlaceholderPhase for snippets so that a method can not deopt from after a snippet invoke into the inlined snippet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4411
diff
changeset
|
176 } |
168dd8970b96
Remove RemovePlaceholderPhase, Add InsertStateAfterPlaceholderPhase for snippets so that a method can not deopt from after a snippet invoke into the inlined snippet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4411
diff
changeset
|
177 |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
178 public InliningIdentifier inliningIdentifier() { |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
179 return inliningIdentifier; |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
180 } |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
181 |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
182 public void setInliningIdentifier(InliningIdentifier inliningIdentifier) { |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
183 this.inliningIdentifier = inliningIdentifier; |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
184 } |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
185 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
186 public boolean rethrowException() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
187 return rethrowException; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
188 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
189 |
4678
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
190 public boolean duringCall() { |
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
191 return duringCall; |
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
192 } |
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
193 |
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
194 public void setDuringCall(boolean b) { |
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
195 this.duringCall = b; |
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
196 } |
a03f3fd16b22
Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4614
diff
changeset
|
197 |
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
|
198 public ResolvedJavaMethod method() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
199 return method; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
200 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
201 |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
202 public void addVirtualObjectMapping(VirtualObjectState virtualObject) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
203 virtualObjectMappings.add(virtualObject); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
204 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
205 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
206 public int virtualObjectMappingCount() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
207 return virtualObjectMappings.size(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
208 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
209 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
210 public Node virtualObjectMappingAt(int i) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
211 return virtualObjectMappings.get(i); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
212 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
213 |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
214 public NodeInputList<VirtualObjectState> virtualObjectMappings() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
215 return virtualObjectMappings; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
216 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
217 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
218 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
219 * Gets a copy of this frame state. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
220 */ |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
221 public FrameState duplicate(int newBci) { |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
222 FrameState other = graph().add(new FrameState(method, newBci, values, stackSize, rethrowException, duringCall, inliningIdentifier, virtualObjectMappings)); |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
223 other.setOuterFrameState(outerFrameState()); |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
224 return other; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
225 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
226 |
5214 | 227 /** |
228 * Gets a copy of this frame state. | |
229 */ | |
230 public FrameState duplicate() { | |
231 return duplicate(bci); | |
232 } | |
233 | |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
234 /** |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
235 * Duplicates a FrameState, along with a deep copy of all connected VirtualState (outer FrameStates, |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
236 * VirtualObjectStates, ...). |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
237 */ |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
238 @Override |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
239 public FrameState duplicateWithVirtualState() { |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
240 FrameState newOuterFrameState = outerFrameState(); |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
241 if (newOuterFrameState != null) { |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
242 newOuterFrameState = newOuterFrameState.duplicateWithVirtualState(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
243 } |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
244 ArrayList<VirtualObjectState> newVirtualMappings = new ArrayList<>(virtualObjectMappings.size()); |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
245 for (VirtualObjectState state : virtualObjectMappings) { |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
246 newVirtualMappings.add(state.duplicateWithVirtualState()); |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
247 } |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
248 FrameState other = graph().add(new FrameState(method, bci, values, stackSize, rethrowException, duringCall, inliningIdentifier, newVirtualMappings)); |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
249 other.setOuterFrameState(newOuterFrameState); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
250 return other; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
251 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
252 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
253 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
254 * Creates a copy of this frame state with one stack element of type popKind popped from the stack and the |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
255 * values in pushedValues pushed on the stack. The pushedValues are expected to be in slot encoding: a long |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
256 * or double is followed by a null slot. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
257 */ |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
258 public FrameState duplicateModified(int newBci, boolean newRethrowException, Kind popKind, ValueNode... pushedValues) { |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
259 ArrayList<ValueNode> copy = new ArrayList<>(values); |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
260 if (popKind != Kind.Void) { |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
261 if (stackAt(stackSize() - 1) == null) { |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
262 copy.remove(copy.size() - 1); |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
263 } |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
264 ValueNode lastSlot = copy.get(copy.size() - 1); |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
265 assert lastSlot.kind().stackKind() == popKind.stackKind() || (lastSlot instanceof BoxedVirtualObjectNode && popKind.isObject()); |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
266 copy.remove(copy.size() - 1); |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
267 } |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
268 Collections.addAll(copy, pushedValues); |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
269 |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
270 FrameState other = graph().add(new FrameState(method, newBci, copy, copy.size() - localsSize, newRethrowException, false, inliningIdentifier, virtualObjectMappings)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
271 other.setOuterFrameState(outerFrameState()); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
272 return other; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
273 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
274 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
275 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
276 * Gets the size of the local variables. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
277 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
278 public int localsSize() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
279 return localsSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
280 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
281 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
282 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
283 * Gets the current size (height) of the stack. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
284 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
285 public int stackSize() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
286 return stackSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
287 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
288 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
289 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
290 * Gets the value in the local variables at the specified index. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
291 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
292 * @param i the index into the locals |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
293 * @return the instruction that produced the value for the specified local |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
294 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
295 public ValueNode localAt(int i) { |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
296 assert i >= 0 && i < localsSize : "local variable index out of range: " + i; |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
297 return values.get(i); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
298 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
299 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
300 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
301 * Get the value on the stack at the specified stack index. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
302 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
303 * @param i the index into the stack, with {@code 0} being the bottom of the stack |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
304 * @return the instruction at the specified position in the stack |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
305 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
306 public ValueNode stackAt(int i) { |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
307 assert i >= 0 && i < stackSize; |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
308 return values.get(localsSize + i); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
309 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
310 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
311 public MergeNode block() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
312 return usages().filter(MergeNode.class).first(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
313 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
314 |
4411
cd2b68ef8e23
cleanup around filter and predicates :
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4310
diff
changeset
|
315 public NodeIterable<FrameState> innerFrameStates() { |
cd2b68ef8e23
cleanup around filter and predicates :
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4310
diff
changeset
|
316 return usages().filter(FrameState.class); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
317 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
318 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
319 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
320 public void generate(LIRGeneratorTool gen) { |
5362
d42425beb1d1
pulled AbstractStateSplit into FixedWithNextNode and made it no longer implement StateSplit. StateSplit is now implemented only by nodes that really have side effects.
Doug Simon <doug.simon@oracle.com>
parents:
5214
diff
changeset
|
321 // Nothing to do, frame states are processed as part of the handling of StateSplit nodes. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
322 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
323 |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
324 private static String toString(FrameState frameState) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
325 StringBuilder sb = new StringBuilder(); |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
326 String nl = CodeUtil.NEW_LINE; |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
327 FrameState fs = frameState; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
328 while (fs != null) { |
5719
429accae15aa
moved some methods from CodeUtil to MetaUtil
Doug Simon <doug.simon@oracle.com>
parents:
5711
diff
changeset
|
329 MetaUtil.appendLocation(sb, fs.method, fs.bci).append(nl); |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
330 sb.append("locals: ["); |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
331 for (int i = 0; i < fs.localsSize(); i++) { |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
332 sb.append(i == 0 ? "" : ", ").append(fs.localAt(i) == null ? "_" : fs.localAt(i).toString(Verbosity.Id)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
333 } |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
334 sb.append("]").append(nl).append("stack: "); |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
335 for (int i = 0; i < fs.stackSize(); i++) { |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
336 sb.append(i == 0 ? "" : ", ").append(fs.stackAt(i) == null ? "_" : fs.stackAt(i).toString(Verbosity.Id)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
337 } |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
338 sb.append(nl); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
339 fs = fs.outerFrameState(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
340 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
341 return sb.toString(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
342 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
343 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
344 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
345 public String toString(Verbosity verbosity) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
346 if (verbosity == Verbosity.Debugger) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
347 return toString(this); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
348 } else if (verbosity == Verbosity.Name) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
349 return super.toString(Verbosity.Name) + "@" + bci; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
350 } else { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
351 return super.toString(verbosity); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
352 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
353 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
354 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
355 @Override |
5813
3b8bc07f8d17
Add ability to give an existing to getDebugProperties
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5727
diff
changeset
|
356 public Map<Object, Object> getDebugProperties(Map<Object, Object> map) { |
3b8bc07f8d17
Add ability to give an existing to getDebugProperties
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5727
diff
changeset
|
357 Map<Object, Object> properties = super.getDebugProperties(map); |
4547
a3cdfa2be94e
Allow to intrinsify an invoke with a deoptimize node. Make debug output more relaxed wrt to null in FrameMap.method
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4421
diff
changeset
|
358 if (method != null) { |
5814
d241f8b2e6f9
Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5813
diff
changeset
|
359 //properties.put("method", MetaUtil.format("%H.%n(%p):%r", method)); |
5560
12dc45f4fc14
added "source" debug property for FrameState to show the source code line number if available
Doug Simon <doug.simon@oracle.com>
parents:
5547
diff
changeset
|
360 StackTraceElement ste = method.toStackTraceElement(bci); |
12dc45f4fc14
added "source" debug property for FrameState to show the source code line number if available
Doug Simon <doug.simon@oracle.com>
parents:
5547
diff
changeset
|
361 if (ste.getFileName() != null && ste.getLineNumber() >= 0) { |
5814
d241f8b2e6f9
Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5813
diff
changeset
|
362 properties.put("sourceFile", ste.getFileName()); |
d241f8b2e6f9
Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5813
diff
changeset
|
363 properties.put("sourceLine", ste.getLineNumber()); |
5560
12dc45f4fc14
added "source" debug property for FrameState to show the source code line number if available
Doug Simon <doug.simon@oracle.com>
parents:
5547
diff
changeset
|
364 } |
4547
a3cdfa2be94e
Allow to intrinsify an invoke with a deoptimize node. Make debug output more relaxed wrt to null in FrameMap.method
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4421
diff
changeset
|
365 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
366 return properties; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
367 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
368 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
369 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
370 public boolean verify() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
371 for (ValueNode value : values) { |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
372 assert assertTrue(value == null || !value.isDeleted(), "frame state must not contain deleted nodes"); |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
373 assert assertTrue(value == null || value instanceof VirtualObjectNode || (value.kind() != Kind.Void && value.kind() != Kind.Illegal), "unexpected value: %s", value); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
374 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
375 return super.verify(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
376 } |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
377 |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
378 @Override |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
379 public void applyToNonVirtual(NodeClosure< ? super ValueNode> closure) { |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
380 for (ValueNode value : values.nonNull()) { |
5671
a65b2a11bf34
Fix for peeling and VirtualStateNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5645
diff
changeset
|
381 closure.apply(this, value); |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
382 } |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
383 for (VirtualObjectState state : virtualObjectMappings) { |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
384 state.applyToNonVirtual(closure); |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
385 } |
5671
a65b2a11bf34
Fix for peeling and VirtualStateNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5645
diff
changeset
|
386 if (outerFrameState() != null) { |
a65b2a11bf34
Fix for peeling and VirtualStateNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5645
diff
changeset
|
387 outerFrameState().applyToNonVirtual(closure); |
a65b2a11bf34
Fix for peeling and VirtualStateNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5645
diff
changeset
|
388 } |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
389 } |
5713
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
390 |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
391 @Override |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
392 public void applyToVirtual(VirtualClosure closure) { |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
393 closure.apply(this); |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
394 for (VirtualObjectState state : virtualObjectMappings) { |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
395 state.applyToVirtual(closure); |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
396 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
397 if (outerFrameState() != null) { |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
398 outerFrameState().applyToVirtual(closure); |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
399 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
400 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
401 |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
402 @Override |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
403 public boolean isPartOfThisState(VirtualState state) { |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
404 if (state == this) { |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
405 return true; |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
406 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
407 if (outerFrameState() != null && outerFrameState().isPartOfThisState(state)) { |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
408 return true; |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
409 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
410 for (VirtualObjectState objectState : virtualObjectMappings) { |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
411 if (objectState.isPartOfThisState(state)) { |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
412 return true; |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
413 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
414 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
415 return false; |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
416 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
417 } |