annotate src/share/vm/opto/multnode.cpp @ 6972:bd7a7ce2e264

6830717: replay of compilations would help with debugging Summary: When java process crashed in compiler thread, repeat the compilation process will help finding root cause. This is done with using SA dump application class data and replay data from core dump, then use debug version of jvm to recompile the problematic java method. Reviewed-by: kvn, twisti, sspitsyn Contributed-by: yumin.qi@oracle.com
author minqi
date Mon, 12 Nov 2012 14:03:53 -0800
parents da91efe96a93
children 6f3fd5150b67
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
2 * Copyright (c) 1997, 2012, 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"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #include "opto/matcher.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "opto/multnode.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "opto/opcodes.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "opto/phaseX.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "opto/regmask.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "opto/type.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
34 //------------------------------MultiNode--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
35 const RegMask &MultiNode::out_RegMask() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
36 return RegMask::Empty;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 }
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 //------------------------------proj_out---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // Get a named projection
a61af66fc99e Initial load
duke
parents:
diff changeset
43 ProjNode* MultiNode::proj_out(uint which_proj) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
44 assert(Opcode() != Op_If || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0");
a61af66fc99e Initial load
duke
parents:
diff changeset
45 assert(Opcode() != Op_If || outcnt() == 2, "bad if #1");
a61af66fc99e Initial load
duke
parents:
diff changeset
46 for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
47 Node *p = fast_out(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
48 if( !p->is_Proj() ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
49 assert(p == this && this->is_Start(), "else must be proj");
a61af66fc99e Initial load
duke
parents:
diff changeset
50 continue;
a61af66fc99e Initial load
duke
parents:
diff changeset
51 }
a61af66fc99e Initial load
duke
parents:
diff changeset
52 ProjNode *proj = p->as_Proj();
a61af66fc99e Initial load
duke
parents:
diff changeset
53 if( proj->_con == which_proj ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
54 assert(Opcode() != Op_If || proj->Opcode() == (which_proj?Op_IfTrue:Op_IfFalse), "bad if #2");
a61af66fc99e Initial load
duke
parents:
diff changeset
55 return proj;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 }
a61af66fc99e Initial load
duke
parents:
diff changeset
57 }
a61af66fc99e Initial load
duke
parents:
diff changeset
58 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 }
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
62 //------------------------------ProjNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
63 uint ProjNode::hash() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
64 // only one input
a61af66fc99e Initial load
duke
parents:
diff changeset
65 return (uintptr_t)in(TypeFunc::Control) + (_con << 1) + (_is_io_use ? 1 : 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
66 }
a61af66fc99e Initial load
duke
parents:
diff changeset
67 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
68 uint ProjNode::size_of() const { return sizeof(ProjNode); }
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // Test if we propagate interesting control along this projection
a61af66fc99e Initial load
duke
parents:
diff changeset
71 bool ProjNode::is_CFG() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
72 Node *def = in(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
73 return (_con == TypeFunc::Control && def->is_CFG());
a61af66fc99e Initial load
duke
parents:
diff changeset
74 }
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 const Type *ProjNode::bottom_type() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
77 if (in(0) == NULL) return Type::TOP;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 const Type *tb = in(0)->bottom_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
79 if( tb == Type::TOP ) return Type::TOP;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 if( tb == Type::BOTTOM ) return Type::BOTTOM;
a61af66fc99e Initial load
duke
parents:
diff changeset
81 const TypeTuple *t = tb->is_tuple();
a61af66fc99e Initial load
duke
parents:
diff changeset
82 return t->field_at(_con);
a61af66fc99e Initial load
duke
parents:
diff changeset
83 }
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 const TypePtr *ProjNode::adr_type() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
86 if (bottom_type() == Type::MEMORY) {
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // in(0) might be a narrow MemBar; otherwise we will report TypePtr::BOTTOM
a61af66fc99e Initial load
duke
parents:
diff changeset
88 const TypePtr* adr_type = in(0)->adr_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
89 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
90 if (!is_error_reported() && !Node::in_dump())
a61af66fc99e Initial load
duke
parents:
diff changeset
91 assert(adr_type != NULL, "source must have adr_type");
a61af66fc99e Initial load
duke
parents:
diff changeset
92 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
93 return adr_type;
a61af66fc99e Initial load
duke
parents:
diff changeset
94 }
a61af66fc99e Initial load
duke
parents:
diff changeset
95 assert(bottom_type()->base() != Type::Memory, "no other memories?");
a61af66fc99e Initial load
duke
parents:
diff changeset
96 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
97 }
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99 bool ProjNode::pinned() const { return in(0)->pinned(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
100 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
101 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
102 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 //----------------------------check_con----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
105 void ProjNode::check_con() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
106 Node* n = in(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
107 if (n == NULL) return; // should be assert, but NodeHash makes bogons
a61af66fc99e Initial load
duke
parents:
diff changeset
108 if (n->is_Mach()) return; // mach. projs. are not type-safe
a61af66fc99e Initial load
duke
parents:
diff changeset
109 if (n->is_Start()) return; // alas, starts can have mach. projs. also
a61af66fc99e Initial load
duke
parents:
diff changeset
110 if (_con == SCMemProjNode::SCMEMPROJCON ) return;
a61af66fc99e Initial load
duke
parents:
diff changeset
111 const Type* t = n->bottom_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
112 if (t == Type::TOP) return; // multi is dead
a61af66fc99e Initial load
duke
parents:
diff changeset
113 assert(_con < t->is_tuple()->cnt(), "ProjNode::_con must be in range");
a61af66fc99e Initial load
duke
parents:
diff changeset
114 }
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 //------------------------------Value------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
117 const Type *ProjNode::Value( PhaseTransform *phase ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
118 if( !in(0) ) return Type::TOP;
a61af66fc99e Initial load
duke
parents:
diff changeset
119 const Type *t = phase->type(in(0));
a61af66fc99e Initial load
duke
parents:
diff changeset
120 if( t == Type::TOP ) return t;
a61af66fc99e Initial load
duke
parents:
diff changeset
121 if( t == Type::BOTTOM ) return t;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 return t->is_tuple()->field_at(_con);
a61af66fc99e Initial load
duke
parents:
diff changeset
123 }
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 //------------------------------out_RegMask------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
126 // Pass the buck uphill
a61af66fc99e Initial load
duke
parents:
diff changeset
127 const RegMask &ProjNode::out_RegMask() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
128 return RegMask::Empty;
a61af66fc99e Initial load
duke
parents:
diff changeset
129 }
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 //------------------------------ideal_reg--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
132 uint ProjNode::ideal_reg() const {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
133 return bottom_type()->ideal_reg();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
134 }