Mercurial > hg > truffle
annotate graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InsertStateAfterPlaceholderPhase.java @ 5130:ab038e0d6b43
Merge
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Wed, 21 Mar 2012 11:28:22 +0100 |
parents | e808627bd16f |
children | d42425beb1d1 |
rev | line source |
---|---|
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:
diff
changeset
|
1 /* |
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:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
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:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
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:
diff
changeset
|
4 * |
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:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
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:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
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:
diff
changeset
|
7 * published by the Free Software Foundation. |
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:
diff
changeset
|
8 * |
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:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
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:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
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:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
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:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
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:
diff
changeset
|
13 * accompanied this code). |
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:
diff
changeset
|
14 * |
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:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
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:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
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:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
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:
diff
changeset
|
18 * |
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:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
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:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
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:
diff
changeset
|
21 * questions. |
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:
diff
changeset
|
22 */ |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
23 package com.oracle.graal.compiler.phases; |
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:
diff
changeset
|
24 |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
25 import com.oracle.graal.graph.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
26 import com.oracle.graal.nodes.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
27 import com.oracle.graal.nodes.spi.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
28 import com.oracle.graal.nodes.type.*; |
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:
diff
changeset
|
29 |
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:
diff
changeset
|
30 public class InsertStateAfterPlaceholderPhase extends Phase { |
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:
diff
changeset
|
31 |
5026
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
32 private static class PlaceholderNode extends AbstractStateSplit implements Node.IterableNodeType, LIRLowerable { |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
33 public PlaceholderNode() { |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
34 super(StampFactory.illegal()); |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
35 } |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
36 |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
37 @Override |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
38 public void generate(LIRGeneratorTool gen) { |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
39 // nothing to do |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
40 } |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
41 } |
b11561111585
Remove FrameStateAccess: Make FrameState immutable and move all modification logic into FrameStateBuilder
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4678
diff
changeset
|
42 |
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:
diff
changeset
|
43 @Override |
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:
diff
changeset
|
44 protected void run(StructuredGraph graph) { |
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:
diff
changeset
|
45 for (ReturnNode ret : graph.getNodes(ReturnNode.class)) { |
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:
diff
changeset
|
46 PlaceholderNode p = graph.add(new PlaceholderNode()); |
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:
4421
diff
changeset
|
47 p.setStateAfter(graph.add(new FrameState(null, FrameState.AFTER_BCI, 0, 0, false, false))); |
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:
diff
changeset
|
48 graph.addBeforeFixed(ret, p); |
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:
diff
changeset
|
49 } |
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:
diff
changeset
|
50 } |
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:
diff
changeset
|
51 |
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:
diff
changeset
|
52 } |