Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.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 | 9bee93f61522 |
children | bbb2619857d4 |
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 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
35 * The {@code FrameState} class encapsulates the frame state (i.e. local variables and operand |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
36 * stack) at a particular point in the abstract interpretation. |
3733
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 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
41 protected final int localsSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
42 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 protected final int stackSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
44 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
45 private boolean rethrowException; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
46 |
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
|
47 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
|
48 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
49 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
50 * 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
|
51 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 public static final int UNKNOWN_BCI = -4; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
53 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
55 * When a node whose frame state has this BCI value is inlined, its frame state will be replaced |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
56 * with the frame state before the inlined invoke node. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
57 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
58 public static final int BEFORE_BCI = -1; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
59 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
60 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
61 * When a node whose frame state has this BCI value is inlined, its frame state will be replaced |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
62 * with the frame state {@linkplain Invoke#stateAfter() after} the inlined invoke node. |
3733
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 public static final int AFTER_BCI = -2; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
65 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
66 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
67 * When a node whose frame state has this BCI value is inlined, its frame state will be replaced |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
68 * with the frame state at the exception edge of the inlined invoke node. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 public static final int AFTER_EXCEPTION_BCI = -3; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
71 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
72 @Input private FrameState outerFrameState; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
73 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
74 @Input private final NodeInputList<ValueNode> values; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
75 |
6286
67a357e3e42a
infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
5814
diff
changeset
|
76 @Input private final NodeInputList<EscapeObjectState> virtualObjectMappings; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
77 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
78 /** |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
79 * 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
|
80 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 public final int bci; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
82 |
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
|
83 private final ResolvedJavaMethod method; |
3733
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 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
86 * Creates a {@code FrameState} for the given scope and maximum number of stack and local |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
87 * variables. |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
88 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
89 * @param method the method for this frame state |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
90 * @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
|
91 * @param stackSize size of the stack |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
92 * @param rethrowException if true the VM should re-throw the exception on top of the stack when |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
93 * deopt'ing using this framestate |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
94 */ |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
95 public FrameState(ResolvedJavaMethod method, int bci, List<ValueNode> values, int localsSize, int stackSize, boolean rethrowException, boolean duringCall, |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
96 List<EscapeObjectState> virtualObjectMappings) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
97 assert stackSize >= 0; |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
98 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
|
99 this.method = method; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
100 this.bci = bci; |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
101 this.localsSize = localsSize; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
102 this.stackSize = stackSize; |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
103 this.values = new NodeInputList<>(this, values); |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
104 this.virtualObjectMappings = new NodeInputList<>(this, virtualObjectMappings); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
105 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
|
106 this.duringCall = duringCall; |
4170
6fe63e57244e
Remove unnecessary method
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4142
diff
changeset
|
107 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
|
108 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
109 |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
110 /** |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
111 * Simple constructor used to create marker FrameStates. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
112 * |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
113 * @param bci marker bci, needs to be < 0 |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
114 */ |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
115 public FrameState(int bci) { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
116 this(null, bci, Collections.<ValueNode> emptyList(), 0, 0, false, false, Collections.<EscapeObjectState> emptyList()); |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
117 } |
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
118 |
6673
a52320a6bbda
remove InliningIdentifier
Lukas Stadler <lukas.stadler@jku.at>
parents:
6576
diff
changeset
|
119 public FrameState(ResolvedJavaMethod method, int bci, ValueNode[] locals, List<ValueNode> stack, ValueNode[] locks, boolean rethrowException, boolean duringCall) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
120 this.method = method; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
121 this.bci = bci; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
122 this.localsSize = locals.length; |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
123 this.stackSize = stack.size(); |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
124 final ValueNode[] newValues = new ValueNode[locals.length + stack.size() + locks.length]; |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
125 int pos = 0; |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
126 for (ValueNode value : locals) { |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
127 newValues[pos++] = value; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 } |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
129 for (ValueNode value : stack) { |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
130 newValues[pos++] = value; |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
131 } |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
132 for (ValueNode value : locks) { |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
133 newValues[pos++] = value; |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
134 } |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
135 for (ValueNode value : newValues) { |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
136 assert value == null || value.isAlive(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
137 } |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
138 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
|
139 this.virtualObjectMappings = new NodeInputList<>(this); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
140 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
|
141 this.duringCall = duringCall; |
4170
6fe63e57244e
Remove unnecessary method
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4142
diff
changeset
|
142 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
|
143 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
144 |
6673
a52320a6bbda
remove InliningIdentifier
Lukas Stadler <lukas.stadler@jku.at>
parents:
6576
diff
changeset
|
145 public NodeInputList<ValueNode> 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
|
146 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
|
147 } |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
148 |
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
|
149 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
|
150 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
|
151 } |
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
|
152 |
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
|
153 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
|
154 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
|
155 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
|
156 } |
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
|
157 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
158 public boolean rethrowException() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
159 return rethrowException; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
160 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
161 |
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
|
162 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
|
163 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
|
164 } |
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
|
165 |
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
|
166 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
|
167 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
|
168 } |
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
|
169 |
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
|
170 public ResolvedJavaMethod method() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
171 return method; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
172 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
173 |
6286
67a357e3e42a
infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
5814
diff
changeset
|
174 public void addVirtualObjectMapping(EscapeObjectState virtualObject) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
175 virtualObjectMappings.add(virtualObject); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
176 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
177 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
178 public int virtualObjectMappingCount() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
179 return virtualObjectMappings.size(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
180 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
181 |
6399
6ad5bf2efb5e
cleanups, merge EscapeRecord and VirtualObjectNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
6384
diff
changeset
|
182 public EscapeObjectState virtualObjectMappingAt(int i) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
183 return virtualObjectMappings.get(i); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
184 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
185 |
6286
67a357e3e42a
infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
5814
diff
changeset
|
186 public NodeInputList<EscapeObjectState> virtualObjectMappings() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
187 return virtualObjectMappings; |
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 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
190 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
191 * Gets a copy of this frame state. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
192 */ |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
193 public FrameState duplicate(int newBci) { |
6673
a52320a6bbda
remove InliningIdentifier
Lukas Stadler <lukas.stadler@jku.at>
parents:
6576
diff
changeset
|
194 FrameState other = graph().add(new FrameState(method, newBci, values, localsSize, stackSize, rethrowException, duringCall, virtualObjectMappings)); |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
195 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
|
196 return other; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
197 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
198 |
5214 | 199 /** |
200 * Gets a copy of this frame state. | |
201 */ | |
202 public FrameState duplicate() { | |
203 return duplicate(bci); | |
204 } | |
205 | |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
206 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
207 * Duplicates a FrameState, along with a deep copy of all connected VirtualState (outer |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
208 * FrameStates, VirtualObjectStates, ...). |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
209 */ |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
210 @Override |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
211 public FrameState duplicateWithVirtualState() { |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
212 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
|
213 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
|
214 newOuterFrameState = newOuterFrameState.duplicateWithVirtualState(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
215 } |
6286
67a357e3e42a
infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
5814
diff
changeset
|
216 ArrayList<EscapeObjectState> newVirtualMappings = new ArrayList<>(virtualObjectMappings.size()); |
67a357e3e42a
infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
5814
diff
changeset
|
217 for (EscapeObjectState state : virtualObjectMappings) { |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
218 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
|
219 } |
6673
a52320a6bbda
remove InliningIdentifier
Lukas Stadler <lukas.stadler@jku.at>
parents:
6576
diff
changeset
|
220 FrameState other = graph().add(new FrameState(method, bci, values, localsSize, stackSize, rethrowException, duringCall, newVirtualMappings)); |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
221 other.setOuterFrameState(newOuterFrameState); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
222 return other; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
223 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
224 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
225 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
226 * Creates a copy of this frame state with one stack element of type popKind popped from the |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
227 * stack and the values in pushedValues pushed on the stack. The pushedValues are expected to be |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
228 * in slot encoding: a long or double is followed by a null slot. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
229 */ |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
230 public FrameState duplicateModified(int newBci, boolean newRethrowException, Kind popKind, ValueNode... pushedValues) { |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
231 ArrayList<ValueNode> copy = new ArrayList<>(values.subList(0, localsSize + stackSize)); |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
232 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
|
233 if (stackAt(stackSize() - 1) == null) { |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
234 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
|
235 } |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
236 ValueNode lastSlot = copy.get(copy.size() - 1); |
7098
e23980f4a890
Cleanup of Kind class: remove isXxx methods
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6673
diff
changeset
|
237 assert lastSlot.kind().getStackKind() == popKind.getStackKind() || (lastSlot instanceof BoxedVirtualObjectNode && popKind == Kind.Object); |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
238 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
|
239 } |
5598
a9b615da0cba
removed delta-encoding of VirtualObjectState
Lukas Stadler <lukas.stadler@jku.at>
parents:
5580
diff
changeset
|
240 Collections.addAll(copy, pushedValues); |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
241 int newStackSize = copy.size() - localsSize; |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
242 copy.addAll(values.subList(localsSize + stackSize, values.size())); |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
243 |
6673
a52320a6bbda
remove InliningIdentifier
Lukas Stadler <lukas.stadler@jku.at>
parents:
6576
diff
changeset
|
244 FrameState other = graph().add(new FrameState(method, newBci, copy, localsSize, newStackSize, newRethrowException, false, virtualObjectMappings)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
245 other.setOuterFrameState(outerFrameState()); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
246 return other; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
247 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
248 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
249 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
250 * Gets the size of the local variables. |
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 public int localsSize() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
253 return localsSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
254 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
255 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
256 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
257 * Gets the current size (height) of the stack. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
258 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
259 public int stackSize() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
260 return stackSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
261 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
262 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
263 /** |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
264 * Gets the number of locked monitors in this frame state. |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
265 */ |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
266 public int locksSize() { |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
267 return values.size() - localsSize - stackSize; |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
268 } |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
269 |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
270 /** |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
271 * Gets the value in the local variables at the specified index. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
272 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
273 * @param i the index into the locals |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
274 * @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
|
275 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
276 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
|
277 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
|
278 return values.get(i); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
279 } |
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 * Get the value on the stack at the specified stack index. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
283 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
284 * @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
|
285 * @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
|
286 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
287 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
|
288 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
|
289 return values.get(localsSize + i); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
290 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
291 |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
292 /** |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
293 * Get the monitor owner at the specified index. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
294 * |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
295 * @param i the index into the list of locked monitors. |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
296 * @return the lock owner at the given index. |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
297 */ |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
298 public ValueNode lockAt(int i) { |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
299 assert i >= 0 && i < locksSize(); |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
300 return values.get(localsSize + stackSize + i); |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
301 } |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
302 |
4411
cd2b68ef8e23
cleanup around filter and predicates :
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4310
diff
changeset
|
303 public NodeIterable<FrameState> innerFrameStates() { |
cd2b68ef8e23
cleanup around filter and predicates :
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4310
diff
changeset
|
304 return usages().filter(FrameState.class); |
3733
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 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
307 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
308 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
|
309 // 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
|
310 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
311 |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
312 private static String toString(FrameState frameState) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
313 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
|
314 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
|
315 FrameState fs = frameState; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
316 while (fs != null) { |
5719
429accae15aa
moved some methods from CodeUtil to MetaUtil
Doug Simon <doug.simon@oracle.com>
parents:
5711
diff
changeset
|
317 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
|
318 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
|
319 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
|
320 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
|
321 } |
6576
a63e3305c0ac
fixed formatting in FrameState.toString()
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
322 sb.append("]").append(nl).append("stack: ["); |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
323 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
|
324 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
|
325 } |
6576
a63e3305c0ac
fixed formatting in FrameState.toString()
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
326 sb.append("]").append(nl).append("locks: ["); |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
327 for (int i = 0; i < fs.locksSize(); i++) { |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
328 sb.append(i == 0 ? "" : ", ").append(fs.lockAt(i) == null ? "_" : fs.lockAt(i).toString(Verbosity.Id)); |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
329 } |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
330 sb.append(']').append(nl); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
331 fs = fs.outerFrameState(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
332 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
333 return sb.toString(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
334 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
335 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
336 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
337 public String toString(Verbosity verbosity) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
338 if (verbosity == Verbosity.Debugger) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
339 return toString(this); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
340 } else if (verbosity == Verbosity.Name) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
341 return super.toString(Verbosity.Name) + "@" + bci; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
342 } else { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
343 return super.toString(verbosity); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
344 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
345 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
346 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
347 @Override |
5813
3b8bc07f8d17
Add ability to give an existing to getDebugProperties
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5727
diff
changeset
|
348 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
|
349 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
|
350 if (method != null) { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
351 // properties.put("method", MetaUtil.format("%H.%n(%p):%r", method)); |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6436
diff
changeset
|
352 StackTraceElement ste = method.asStackTraceElement(bci); |
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
|
353 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
|
354 properties.put("sourceFile", ste.getFileName()); |
d241f8b2e6f9
Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5813
diff
changeset
|
355 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
|
356 } |
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
|
357 } |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6399
diff
changeset
|
358 properties.put("locksSize", values.size() - stackSize - localsSize); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
359 return properties; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
360 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
361 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
362 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
363 public boolean verify() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
364 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
|
365 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
|
366 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
|
367 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
368 return super.verify(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
369 } |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
370 |
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
371 @Override |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7258
diff
changeset
|
372 public void applyToNonVirtual(NodeClosure<? super ValueNode> closure) { |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
373 for (ValueNode value : values.nonNull()) { |
5671
a65b2a11bf34
Fix for peeling and VirtualStateNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5645
diff
changeset
|
374 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
|
375 } |
6286
67a357e3e42a
infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
5814
diff
changeset
|
376 for (EscapeObjectState state : virtualObjectMappings) { |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
377 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
|
378 } |
5671
a65b2a11bf34
Fix for peeling and VirtualStateNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5645
diff
changeset
|
379 if (outerFrameState() != null) { |
a65b2a11bf34
Fix for peeling and VirtualStateNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5645
diff
changeset
|
380 outerFrameState().applyToNonVirtual(closure); |
a65b2a11bf34
Fix for peeling and VirtualStateNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5645
diff
changeset
|
381 } |
5645
f53a347eae93
add inliningIdentifier to FrameState (fixes problem with duplicated FrameStates and locking)
Lukas Stadler <lukas.stadler@jku.at>
parents:
5598
diff
changeset
|
382 } |
5713
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
383 |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
384 @Override |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
385 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
|
386 closure.apply(this); |
6286
67a357e3e42a
infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
5814
diff
changeset
|
387 for (EscapeObjectState state : virtualObjectMappings) { |
5713
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
388 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
|
389 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
390 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
|
391 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
|
392 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
393 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
394 |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
395 @Override |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
396 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
|
397 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
|
398 return true; |
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 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
|
401 return true; |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
402 } |
6286
67a357e3e42a
infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
5814
diff
changeset
|
403 for (EscapeObjectState objectState : virtualObjectMappings) { |
5713
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
404 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
|
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 } |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
408 return false; |
8c478272fb34
Cleanup and fixes in handling of VirtualStates around loop exits merging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5671
diff
changeset
|
409 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
410 } |