annotate src/share/vm/opto/multnode.cpp @ 17524:89152779163c

Merge with jdk8-b132
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 11:59:32 +0200
parents 4ca6dc0799b6
children 52b4284cb496
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
17524
89152779163c Merge with jdk8-b132
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14909
diff changeset
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #include "precompiled.hpp"
10278
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
26 #include "opto/callnode.hpp"
12956
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
27 #include "opto/cfgnode.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "opto/matcher.hpp"
12323
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 10278
diff changeset
29 #include "opto/mathexactnode.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "opto/multnode.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "opto/opcodes.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32 #include "opto/phaseX.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
33 #include "opto/regmask.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
34 #include "opto/type.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
37 //------------------------------MultiNode--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
38 const RegMask &MultiNode::out_RegMask() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
39 return RegMask::Empty;
a61af66fc99e Initial load
duke
parents:
diff changeset
40 }
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44 //------------------------------proj_out---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
45 // Get a named projection
a61af66fc99e Initial load
duke
parents:
diff changeset
46 ProjNode* MultiNode::proj_out(uint which_proj) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
47 assert(Opcode() != Op_If || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0");
a61af66fc99e Initial load
duke
parents:
diff changeset
48 assert(Opcode() != Op_If || outcnt() == 2, "bad if #1");
a61af66fc99e Initial load
duke
parents:
diff changeset
49 for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
50 Node *p = fast_out(i);
12323
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 10278
diff changeset
51 if (p->is_Proj()) {
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 10278
diff changeset
52 ProjNode *proj = p->as_Proj();
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 10278
diff changeset
53 if (proj->_con == which_proj) {
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 10278
diff changeset
54 assert(Opcode() != Op_If || proj->Opcode() == (which_proj?Op_IfTrue:Op_IfFalse), "bad if #2");
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 10278
diff changeset
55 return proj;
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 10278
diff changeset
56 }
14909
4ca6dc0799b6 Backout jdk9 merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14495
diff changeset
57 } else if (p->is_FlagsProj()) {
4ca6dc0799b6 Backout jdk9 merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14495
diff changeset
58 FlagsProjNode *proj = p->as_FlagsProj();
4ca6dc0799b6 Backout jdk9 merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14495
diff changeset
59 if (proj->_con == which_proj) {
4ca6dc0799b6 Backout jdk9 merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14495
diff changeset
60 return proj;
4ca6dc0799b6 Backout jdk9 merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14495
diff changeset
61 }
12323
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 10278
diff changeset
62 } else {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
63 assert(p == this && this->is_Start(), "else must be proj");
a61af66fc99e Initial load
duke
parents:
diff changeset
64 continue;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 }
a61af66fc99e Initial load
duke
parents:
diff changeset
66 }
a61af66fc99e Initial load
duke
parents:
diff changeset
67 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 }
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
71 //------------------------------ProjNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
72 uint ProjNode::hash() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
73 // only one input
a61af66fc99e Initial load
duke
parents:
diff changeset
74 return (uintptr_t)in(TypeFunc::Control) + (_con << 1) + (_is_io_use ? 1 : 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76 uint ProjNode::cmp( const Node &n ) const { return _con == ((ProjNode&)n)._con && ((ProjNode&)n)._is_io_use == _is_io_use; }
a61af66fc99e Initial load
duke
parents:
diff changeset
77 uint ProjNode::size_of() const { return sizeof(ProjNode); }
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // Test if we propagate interesting control along this projection
a61af66fc99e Initial load
duke
parents:
diff changeset
80 bool ProjNode::is_CFG() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
81 Node *def = in(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
82 return (_con == TypeFunc::Control && def->is_CFG());
a61af66fc99e Initial load
duke
parents:
diff changeset
83 }
a61af66fc99e Initial load
duke
parents:
diff changeset
84
10278
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
85 const Type* ProjNode::proj_type(const Type* t) const {
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
86 if (t == Type::TOP) {
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
87 return Type::TOP;
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
88 }
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
89 if (t == Type::BOTTOM) {
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
90 return Type::BOTTOM;
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
91 }
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
92 t = t->is_tuple()->field_at(_con);
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
93 Node* n = in(0);
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
94 if ((_con == TypeFunc::Parms) &&
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
95 n->is_CallStaticJava() && n->as_CallStaticJava()->is_boxing_method()) {
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
96 // The result of autoboxing is always non-null on normal path.
14909
4ca6dc0799b6 Backout jdk9 merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14495
diff changeset
97 t = t->join(TypePtr::NOTNULL);
10278
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
98 }
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
99 return t;
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
100 }
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
101
0
a61af66fc99e Initial load
duke
parents:
diff changeset
102 const Type *ProjNode::bottom_type() const {
10278
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
103 if (in(0) == NULL) return Type::TOP;
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
104 return proj_type(in(0)->bottom_type());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
105 }
a61af66fc99e Initial load
duke
parents:
diff changeset
106
a61af66fc99e Initial load
duke
parents:
diff changeset
107 const TypePtr *ProjNode::adr_type() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
108 if (bottom_type() == Type::MEMORY) {
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // in(0) might be a narrow MemBar; otherwise we will report TypePtr::BOTTOM
a61af66fc99e Initial load
duke
parents:
diff changeset
110 const TypePtr* adr_type = in(0)->adr_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
111 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
112 if (!is_error_reported() && !Node::in_dump())
a61af66fc99e Initial load
duke
parents:
diff changeset
113 assert(adr_type != NULL, "source must have adr_type");
a61af66fc99e Initial load
duke
parents:
diff changeset
114 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
115 return adr_type;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 }
a61af66fc99e Initial load
duke
parents:
diff changeset
117 assert(bottom_type()->base() != Type::Memory, "no other memories?");
a61af66fc99e Initial load
duke
parents:
diff changeset
118 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
119 }
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 bool ProjNode::pinned() const { return in(0)->pinned(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
122 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
123 void ProjNode::dump_spec(outputStream *st) const { st->print("#%d",_con); if(_is_io_use) st->print(" (i_o_use)");}
a61af66fc99e Initial load
duke
parents:
diff changeset
124 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
125
a61af66fc99e Initial load
duke
parents:
diff changeset
126 //----------------------------check_con----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
127 void ProjNode::check_con() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
128 Node* n = in(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
129 if (n == NULL) return; // should be assert, but NodeHash makes bogons
a61af66fc99e Initial load
duke
parents:
diff changeset
130 if (n->is_Mach()) return; // mach. projs. are not type-safe
a61af66fc99e Initial load
duke
parents:
diff changeset
131 if (n->is_Start()) return; // alas, starts can have mach. projs. also
a61af66fc99e Initial load
duke
parents:
diff changeset
132 if (_con == SCMemProjNode::SCMEMPROJCON ) return;
a61af66fc99e Initial load
duke
parents:
diff changeset
133 const Type* t = n->bottom_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
134 if (t == Type::TOP) return; // multi is dead
a61af66fc99e Initial load
duke
parents:
diff changeset
135 assert(_con < t->is_tuple()->cnt(), "ProjNode::_con must be in range");
a61af66fc99e Initial load
duke
parents:
diff changeset
136 }
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 //------------------------------Value------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
139 const Type *ProjNode::Value( PhaseTransform *phase ) const {
10278
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
140 if (in(0) == NULL) return Type::TOP;
6f3fd5150b67 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 6725
diff changeset
141 return proj_type(phase->type(in(0)));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
142 }
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 //------------------------------out_RegMask------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // Pass the buck uphill
a61af66fc99e Initial load
duke
parents:
diff changeset
146 const RegMask &ProjNode::out_RegMask() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 return RegMask::Empty;
a61af66fc99e Initial load
duke
parents:
diff changeset
148 }
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 //------------------------------ideal_reg--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
151 uint ProjNode::ideal_reg() const {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
152 return bottom_type()->ideal_reg();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
153 }
12956
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
154
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
155 //-------------------------------is_uncommon_trap_proj----------------------------
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
156 // Return true if proj is the form of "proj->[region->..]call_uct"
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
157 bool ProjNode::is_uncommon_trap_proj(Deoptimization::DeoptReason reason) {
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
158 int path_limit = 10;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
159 Node* out = this;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
160 for (int ct = 0; ct < path_limit; ct++) {
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
161 out = out->unique_ctrl_out();
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
162 if (out == NULL)
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
163 return false;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
164 if (out->is_CallStaticJava()) {
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
165 int req = out->as_CallStaticJava()->uncommon_trap_request();
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
166 if (req != 0) {
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
167 Deoptimization::DeoptReason trap_reason = Deoptimization::trap_request_reason(req);
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
168 if (trap_reason == reason || reason == Deoptimization::Reason_none) {
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
169 return true;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
170 }
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
171 }
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
172 return false; // don't do further after call
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
173 }
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
174 if (out->Opcode() != Op_Region)
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
175 return false;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
176 }
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
177 return false;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
178 }
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
179
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
180 //-------------------------------is_uncommon_trap_if_pattern-------------------------
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
181 // Return true for "if(test)-> proj -> ...
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
182 // |
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
183 // V
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
184 // other_proj->[region->..]call_uct"
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
185 //
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
186 // "must_reason_predicate" means the uct reason must be Reason_predicate
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
187 bool ProjNode::is_uncommon_trap_if_pattern(Deoptimization::DeoptReason reason) {
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
188 Node *in0 = in(0);
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
189 if (!in0->is_If()) return false;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
190 // Variation of a dead If node.
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
191 if (in0->outcnt() < 2) return false;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
192 IfNode* iff = in0->as_If();
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
193
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
194 // we need "If(Conv2B(Opaque1(...)))" pattern for reason_predicate
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
195 if (reason != Deoptimization::Reason_none) {
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
196 if (iff->in(1)->Opcode() != Op_Conv2B ||
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
197 iff->in(1)->in(1)->Opcode() != Op_Opaque1) {
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
198 return false;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
199 }
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
200 }
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
201
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
202 ProjNode* other_proj = iff->proj_out(1-_con)->as_Proj();
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
203 if (other_proj->is_uncommon_trap_proj(reason)) {
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
204 assert(reason == Deoptimization::Reason_none ||
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
205 Compile::current()->is_predicate_opaq(iff->in(1)->in(1)), "should be on the list");
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
206 return true;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
207 }
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
208 return false;
3213ba4d3dff 8024069: replace_in_map() should operate on parent maps
roland
parents: 12323
diff changeset
209 }