annotate src/share/vm/opto/machnode.cpp @ 4710:41406797186b

7113012: G1: rename not-fully-young GCs as "mixed" Summary: Renamed partially-young GCs as mixed and fully-young GCs as young. Change all external output that includes those terms (GC log and GC ergo log) as well as any comments, fields, methods, etc. The changeset also includes very minor code tidying up (added some curly brackets). Reviewed-by: johnc, brutisso
author tonyp
date Fri, 16 Dec 2011 02:14:27 -0500
parents 6729bbc1fcd6
children 8c92982cbbc4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 1997, 2010, 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: 1137
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1137
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: 1137
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 "gc_interface/collectedHeap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "opto/machnode.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "opto/regalloc.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // Return the value requested
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // result register lookup, corresponding to int_format
a61af66fc99e Initial load
duke
parents:
diff changeset
33 int MachOper::reg(PhaseRegAlloc *ra_, const Node *node) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
34 return (int)ra_->get_encode(node);
a61af66fc99e Initial load
duke
parents:
diff changeset
35 }
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // input register lookup, corresponding to ext_format
a61af66fc99e Initial load
duke
parents:
diff changeset
37 int MachOper::reg(PhaseRegAlloc *ra_, const Node *node, int idx) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 return (int)(ra_->get_encode(node->in(idx)));
a61af66fc99e Initial load
duke
parents:
diff changeset
39 }
a61af66fc99e Initial load
duke
parents:
diff changeset
40 intptr_t MachOper::constant() const { return 0x00; }
a61af66fc99e Initial load
duke
parents:
diff changeset
41 bool MachOper::constant_is_oop() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
42 jdouble MachOper::constantD() const { ShouldNotReachHere(); return 0.0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
43 jfloat MachOper::constantF() const { ShouldNotReachHere(); return 0.0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
44 jlong MachOper::constantL() const { ShouldNotReachHere(); return CONST64(0) ; }
a61af66fc99e Initial load
duke
parents:
diff changeset
45 TypeOopPtr *MachOper::oop() const { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
46 int MachOper::ccode() const { return 0x00; }
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // A zero, default, indicates this value is not needed.
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // May need to lookup the base register, as done in int_ and ext_format
a61af66fc99e Initial load
duke
parents:
diff changeset
49 int MachOper::base (PhaseRegAlloc *ra_, const Node *node, int idx) const { return 0x00; }
a61af66fc99e Initial load
duke
parents:
diff changeset
50 int MachOper::index(PhaseRegAlloc *ra_, const Node *node, int idx) const { return 0x00; }
a61af66fc99e Initial load
duke
parents:
diff changeset
51 int MachOper::scale() const { return 0x00; }
a61af66fc99e Initial load
duke
parents:
diff changeset
52 int MachOper::disp (PhaseRegAlloc *ra_, const Node *node, int idx) const { return 0x00; }
a61af66fc99e Initial load
duke
parents:
diff changeset
53 int MachOper::constant_disp() const { return 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
54 int MachOper::base_position() const { return -1; } // no base input
a61af66fc99e Initial load
duke
parents:
diff changeset
55 int MachOper::index_position() const { return -1; } // no index input
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // Check for PC-Relative displacement
a61af66fc99e Initial load
duke
parents:
diff changeset
57 bool MachOper::disp_is_oop() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // Return the label
a61af66fc99e Initial load
duke
parents:
diff changeset
59 Label* MachOper::label() const { ShouldNotReachHere(); return 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
60 intptr_t MachOper::method() const { ShouldNotReachHere(); return 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 //------------------------------negate-----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
64 // Negate conditional branches. Error for non-branch operands
a61af66fc99e Initial load
duke
parents:
diff changeset
65 void MachOper::negate() {
a61af66fc99e Initial load
duke
parents:
diff changeset
66 ShouldNotCallThis();
a61af66fc99e Initial load
duke
parents:
diff changeset
67 }
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 //-----------------------------type--------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
70 const Type *MachOper::type() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
71 return Type::BOTTOM;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 }
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 //------------------------------in_RegMask-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
75 const RegMask *MachOper::in_RegMask(int index) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
76 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
77 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 }
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 //------------------------------dump_spec--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // Print any per-operand special info
a61af66fc99e Initial load
duke
parents:
diff changeset
82 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
83 void MachOper::dump_spec(outputStream *st) const { }
a61af66fc99e Initial load
duke
parents:
diff changeset
84 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 //------------------------------hash-------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // Print any per-operand special info
a61af66fc99e Initial load
duke
parents:
diff changeset
88 uint MachOper::hash() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
89 ShouldNotCallThis();
a61af66fc99e Initial load
duke
parents:
diff changeset
90 return 5;
a61af66fc99e Initial load
duke
parents:
diff changeset
91 }
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 //------------------------------cmp--------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // Print any per-operand special info
a61af66fc99e Initial load
duke
parents:
diff changeset
95 uint MachOper::cmp( const MachOper &oper ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
96 ShouldNotCallThis();
a61af66fc99e Initial load
duke
parents:
diff changeset
97 return opcode() == oper.opcode();
a61af66fc99e Initial load
duke
parents:
diff changeset
98 }
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 //------------------------------hash-------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // Print any per-operand special info
a61af66fc99e Initial load
duke
parents:
diff changeset
102 uint labelOper::hash() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
103 return _block_num;
a61af66fc99e Initial load
duke
parents:
diff changeset
104 }
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 //------------------------------cmp--------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
107 // Print any per-operand special info
a61af66fc99e Initial load
duke
parents:
diff changeset
108 uint labelOper::cmp( const MachOper &oper ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
109 return (opcode() == oper.opcode()) && (_label == oper.label());
a61af66fc99e Initial load
duke
parents:
diff changeset
110 }
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 //------------------------------hash-------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
113 // Print any per-operand special info
a61af66fc99e Initial load
duke
parents:
diff changeset
114 uint methodOper::hash() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
115 return (uint)_method;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 }
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 //------------------------------cmp--------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
119 // Print any per-operand special info
a61af66fc99e Initial load
duke
parents:
diff changeset
120 uint methodOper::cmp( const MachOper &oper ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 return (opcode() == oper.opcode()) && (_method == oper.method());
a61af66fc99e Initial load
duke
parents:
diff changeset
122 }
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
126 //------------------------------MachNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 //------------------------------emit-------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
129 void MachNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
130 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
131 tty->print("missing MachNode emit function: ");
a61af66fc99e Initial load
duke
parents:
diff changeset
132 dump();
a61af66fc99e Initial load
duke
parents:
diff changeset
133 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
134 ShouldNotCallThis();
a61af66fc99e Initial load
duke
parents:
diff changeset
135 }
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 //------------------------------size-------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
138 // Size of instruction in bytes
a61af66fc99e Initial load
duke
parents:
diff changeset
139 uint MachNode::size(PhaseRegAlloc *ra_) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
140 // If a virtual was not defined for this specific instruction,
605
98cb887364d3 6810672: Comment typos
twisti
parents: 235
diff changeset
141 // Call the helper which finds the size by emitting the bits.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
142 return MachNode::emit_size(ra_);
a61af66fc99e Initial load
duke
parents:
diff changeset
143 }
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 //------------------------------size-------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
146 // Helper function that computes size by emitting code
a61af66fc99e Initial load
duke
parents:
diff changeset
147 uint MachNode::emit_size(PhaseRegAlloc *ra_) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
148 // Emit into a trash buffer and count bytes emitted.
a61af66fc99e Initial load
duke
parents:
diff changeset
149 assert(ra_ == ra_->C->regalloc(), "sanity");
a61af66fc99e Initial load
duke
parents:
diff changeset
150 return ra_->C->scratch_emit_size(this);
a61af66fc99e Initial load
duke
parents:
diff changeset
151 }
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 //------------------------------hash-------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
156 uint MachNode::hash() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
157 uint no = num_opnds();
a61af66fc99e Initial load
duke
parents:
diff changeset
158 uint sum = rule();
a61af66fc99e Initial load
duke
parents:
diff changeset
159 for( uint i=0; i<no; i++ )
a61af66fc99e Initial load
duke
parents:
diff changeset
160 sum += _opnds[i]->hash();
a61af66fc99e Initial load
duke
parents:
diff changeset
161 return sum+Node::hash();
a61af66fc99e Initial load
duke
parents:
diff changeset
162 }
a61af66fc99e Initial load
duke
parents:
diff changeset
163
a61af66fc99e Initial load
duke
parents:
diff changeset
164 //-----------------------------cmp---------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
165 uint MachNode::cmp( const Node &node ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
166 MachNode& n = *((Node&)node).as_Mach();
a61af66fc99e Initial load
duke
parents:
diff changeset
167 uint no = num_opnds();
a61af66fc99e Initial load
duke
parents:
diff changeset
168 if( no != n.num_opnds() ) return 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
169 if( rule() != n.rule() ) return 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
170 for( uint i=0; i<no; i++ ) // All operands must match
a61af66fc99e Initial load
duke
parents:
diff changeset
171 if( !_opnds[i]->cmp( *n._opnds[i] ) )
a61af66fc99e Initial load
duke
parents:
diff changeset
172 return 0; // mis-matched operands
a61af66fc99e Initial load
duke
parents:
diff changeset
173 return 1; // match
a61af66fc99e Initial load
duke
parents:
diff changeset
174 }
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 // Return an equivalent instruction using memory for cisc_operand position
a61af66fc99e Initial load
duke
parents:
diff changeset
177 MachNode *MachNode::cisc_version(int offset, Compile* C) {
a61af66fc99e Initial load
duke
parents:
diff changeset
178 ShouldNotCallThis();
a61af66fc99e Initial load
duke
parents:
diff changeset
179 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
180 }
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 void MachNode::use_cisc_RegMask() {
a61af66fc99e Initial load
duke
parents:
diff changeset
183 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
184 }
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 //-----------------------------in_RegMask--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
188 const RegMask &MachNode::in_RegMask( uint idx ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
189 uint numopnds = num_opnds(); // Virtual call for number of operands
a61af66fc99e Initial load
duke
parents:
diff changeset
190 uint skipped = oper_input_base(); // Sum of leaves skipped so far
a61af66fc99e Initial load
duke
parents:
diff changeset
191 if( idx < skipped ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
192 assert( ideal_Opcode() == Op_AddP, "expected base ptr here" );
a61af66fc99e Initial load
duke
parents:
diff changeset
193 assert( idx == 1, "expected base ptr here" );
a61af66fc99e Initial load
duke
parents:
diff changeset
194 // debug info can be anywhere
a61af66fc99e Initial load
duke
parents:
diff changeset
195 return *Compile::current()->matcher()->idealreg2spillmask[Op_RegP];
a61af66fc99e Initial load
duke
parents:
diff changeset
196 }
a61af66fc99e Initial load
duke
parents:
diff changeset
197 uint opcnt = 1; // First operand
a61af66fc99e Initial load
duke
parents:
diff changeset
198 uint num_edges = _opnds[1]->num_edges(); // leaves for first operand
a61af66fc99e Initial load
duke
parents:
diff changeset
199 while( idx >= skipped+num_edges ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 skipped += num_edges;
a61af66fc99e Initial load
duke
parents:
diff changeset
201 opcnt++; // Bump operand count
a61af66fc99e Initial load
duke
parents:
diff changeset
202 assert( opcnt < numopnds, "Accessing non-existent operand" );
a61af66fc99e Initial load
duke
parents:
diff changeset
203 num_edges = _opnds[opcnt]->num_edges(); // leaves for next operand
a61af66fc99e Initial load
duke
parents:
diff changeset
204 }
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 const RegMask *rm = cisc_RegMask();
a61af66fc99e Initial load
duke
parents:
diff changeset
207 if( rm == NULL || (int)opcnt != cisc_operand() ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
208 rm = _opnds[opcnt]->in_RegMask(idx-skipped);
a61af66fc99e Initial load
duke
parents:
diff changeset
209 }
a61af66fc99e Initial load
duke
parents:
diff changeset
210 return *rm;
a61af66fc99e Initial load
duke
parents:
diff changeset
211 }
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 //-----------------------------memory_inputs--------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
214 const MachOper* MachNode::memory_inputs(Node* &base, Node* &index) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
215 const MachOper* oper = memory_operand();
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217 if (oper == (MachOper*)-1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
218 base = NodeSentinel;
a61af66fc99e Initial load
duke
parents:
diff changeset
219 index = NodeSentinel;
a61af66fc99e Initial load
duke
parents:
diff changeset
220 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
221 base = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
222 index = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
223 if (oper != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
224 // It has a unique memory operand. Find its index.
a61af66fc99e Initial load
duke
parents:
diff changeset
225 int oper_idx = num_opnds();
a61af66fc99e Initial load
duke
parents:
diff changeset
226 while (--oper_idx >= 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
227 if (_opnds[oper_idx] == oper) break;
a61af66fc99e Initial load
duke
parents:
diff changeset
228 }
a61af66fc99e Initial load
duke
parents:
diff changeset
229 int oper_pos = operand_index(oper_idx);
a61af66fc99e Initial load
duke
parents:
diff changeset
230 int base_pos = oper->base_position();
a61af66fc99e Initial load
duke
parents:
diff changeset
231 if (base_pos >= 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
232 base = _in[oper_pos+base_pos];
a61af66fc99e Initial load
duke
parents:
diff changeset
233 }
a61af66fc99e Initial load
duke
parents:
diff changeset
234 int index_pos = oper->index_position();
a61af66fc99e Initial load
duke
parents:
diff changeset
235 if (index_pos >= 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
236 index = _in[oper_pos+index_pos];
a61af66fc99e Initial load
duke
parents:
diff changeset
237 }
a61af66fc99e Initial load
duke
parents:
diff changeset
238 }
a61af66fc99e Initial load
duke
parents:
diff changeset
239 }
a61af66fc99e Initial load
duke
parents:
diff changeset
240
a61af66fc99e Initial load
duke
parents:
diff changeset
241 return oper;
a61af66fc99e Initial load
duke
parents:
diff changeset
242 }
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 //-----------------------------get_base_and_disp----------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
245 const Node* MachNode::get_base_and_disp(intptr_t &offset, const TypePtr* &adr_type) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 // Find the memory inputs using our helper function
a61af66fc99e Initial load
duke
parents:
diff changeset
248 Node* base;
a61af66fc99e Initial load
duke
parents:
diff changeset
249 Node* index;
a61af66fc99e Initial load
duke
parents:
diff changeset
250 const MachOper* oper = memory_inputs(base, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 if (oper == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
253 // Base has been set to NULL
a61af66fc99e Initial load
duke
parents:
diff changeset
254 offset = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
255 } else if (oper == (MachOper*)-1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
256 // Base has been set to NodeSentinel
a61af66fc99e Initial load
duke
parents:
diff changeset
257 // There is not a unique memory use here. We will fall to AliasIdxBot.
a61af66fc99e Initial load
duke
parents:
diff changeset
258 offset = Type::OffsetBot;
a61af66fc99e Initial load
duke
parents:
diff changeset
259 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
260 // Base may be NULL, even if offset turns out to be != 0
a61af66fc99e Initial load
duke
parents:
diff changeset
261
a61af66fc99e Initial load
duke
parents:
diff changeset
262 intptr_t disp = oper->constant_disp();
a61af66fc99e Initial load
duke
parents:
diff changeset
263 int scale = oper->scale();
a61af66fc99e Initial load
duke
parents:
diff changeset
264 // Now we have collected every part of the ADLC MEMORY_INTER.
a61af66fc99e Initial load
duke
parents:
diff changeset
265 // See if it adds up to a base + offset.
a61af66fc99e Initial load
duke
parents:
diff changeset
266 if (index != NULL) {
221
1e026f8da827 6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents: 216
diff changeset
267 const Type* t_index = index->bottom_type();
1e026f8da827 6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents: 216
diff changeset
268 if (t_index->isa_narrowoop()) { // EncodeN, LoadN, LoadConN, LoadNKlass.
216
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 113
diff changeset
269 // Memory references through narrow oops have a
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 113
diff changeset
270 // funny base so grab the type from the index:
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 113
diff changeset
271 // [R12 + narrow_oop_reg<<3 + offset]
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 113
diff changeset
272 assert(base == NULL, "Memory references through narrow oops have no base");
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 113
diff changeset
273 offset = disp;
221
1e026f8da827 6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents: 216
diff changeset
274 adr_type = t_index->make_ptr()->add_offset(offset);
216
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 113
diff changeset
275 return NULL;
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 113
diff changeset
276 } else if (!index->is_Con()) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
277 disp = Type::OffsetBot;
a61af66fc99e Initial load
duke
parents:
diff changeset
278 } else if (disp != Type::OffsetBot) {
221
1e026f8da827 6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents: 216
diff changeset
279 const TypeX* ti = t_index->isa_intptr_t();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
280 if (ti == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
281 disp = Type::OffsetBot; // a random constant??
a61af66fc99e Initial load
duke
parents:
diff changeset
282 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
283 disp += ti->get_con() << scale;
a61af66fc99e Initial load
duke
parents:
diff changeset
284 }
a61af66fc99e Initial load
duke
parents:
diff changeset
285 }
a61af66fc99e Initial load
duke
parents:
diff changeset
286 }
a61af66fc99e Initial load
duke
parents:
diff changeset
287 offset = disp;
a61af66fc99e Initial load
duke
parents:
diff changeset
288
a61af66fc99e Initial load
duke
parents:
diff changeset
289 // In i486.ad, indOffset32X uses base==RegI and disp==RegP,
a61af66fc99e Initial load
duke
parents:
diff changeset
290 // this will prevent alias analysis without the following support:
a61af66fc99e Initial load
duke
parents:
diff changeset
291 // Lookup the TypePtr used by indOffset32X, a compile-time constant oop,
a61af66fc99e Initial load
duke
parents:
diff changeset
292 // Add the offset determined by the "base", or use Type::OffsetBot.
a61af66fc99e Initial load
duke
parents:
diff changeset
293 if( adr_type == TYPE_PTR_SENTINAL ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
294 const TypePtr *t_disp = oper->disp_as_type(); // only !NULL for indOffset32X
a61af66fc99e Initial load
duke
parents:
diff changeset
295 if (t_disp != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
296 offset = Type::OffsetBot;
a61af66fc99e Initial load
duke
parents:
diff changeset
297 const Type* t_base = base->bottom_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
298 if (t_base->isa_intptr_t()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
299 const TypeX *t_offset = t_base->is_intptr_t();
a61af66fc99e Initial load
duke
parents:
diff changeset
300 if( t_offset->is_con() ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
301 offset = t_offset->get_con();
a61af66fc99e Initial load
duke
parents:
diff changeset
302 }
a61af66fc99e Initial load
duke
parents:
diff changeset
303 }
a61af66fc99e Initial load
duke
parents:
diff changeset
304 adr_type = t_disp->add_offset(offset);
851
fc4be448891f 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 673
diff changeset
305 } else if( base == NULL && offset != 0 && offset != Type::OffsetBot ) {
fc4be448891f 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 673
diff changeset
306 // Use ideal type if it is oop ptr.
fc4be448891f 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 673
diff changeset
307 const TypePtr *tp = oper->type()->isa_ptr();
fc4be448891f 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 673
diff changeset
308 if( tp != NULL) {
fc4be448891f 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 673
diff changeset
309 adr_type = tp;
fc4be448891f 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 673
diff changeset
310 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
311 }
a61af66fc99e Initial load
duke
parents:
diff changeset
312 }
a61af66fc99e Initial load
duke
parents:
diff changeset
313
a61af66fc99e Initial load
duke
parents:
diff changeset
314 }
a61af66fc99e Initial load
duke
parents:
diff changeset
315 return base;
a61af66fc99e Initial load
duke
parents:
diff changeset
316 }
a61af66fc99e Initial load
duke
parents:
diff changeset
317
a61af66fc99e Initial load
duke
parents:
diff changeset
318
a61af66fc99e Initial load
duke
parents:
diff changeset
319 //---------------------------------adr_type---------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
320 const class TypePtr *MachNode::adr_type() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
321 intptr_t offset = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
322 const TypePtr *adr_type = TYPE_PTR_SENTINAL; // attempt computing adr_type
a61af66fc99e Initial load
duke
parents:
diff changeset
323 const Node *base = get_base_and_disp(offset, adr_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
324 if( adr_type != TYPE_PTR_SENTINAL ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
325 return adr_type; // get_base_and_disp has the answer
a61af66fc99e Initial load
duke
parents:
diff changeset
326 }
a61af66fc99e Initial load
duke
parents:
diff changeset
327
a61af66fc99e Initial load
duke
parents:
diff changeset
328 // Direct addressing modes have no base node, simply an indirect
a61af66fc99e Initial load
duke
parents:
diff changeset
329 // offset, which is always to raw memory.
a61af66fc99e Initial load
duke
parents:
diff changeset
330 // %%%%% Someday we'd like to allow constant oop offsets which
a61af66fc99e Initial load
duke
parents:
diff changeset
331 // would let Intel load from static globals in 1 instruction.
a61af66fc99e Initial load
duke
parents:
diff changeset
332 // Currently Intel requires 2 instructions and a register temp.
a61af66fc99e Initial load
duke
parents:
diff changeset
333 if (base == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
334 // NULL base, zero offset means no memory at all (a null pointer!)
a61af66fc99e Initial load
duke
parents:
diff changeset
335 if (offset == 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
336 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
337 }
a61af66fc99e Initial load
duke
parents:
diff changeset
338 // NULL base, any offset means any pointer whatever
a61af66fc99e Initial load
duke
parents:
diff changeset
339 if (offset == Type::OffsetBot) {
a61af66fc99e Initial load
duke
parents:
diff changeset
340 return TypePtr::BOTTOM;
a61af66fc99e Initial load
duke
parents:
diff changeset
341 }
a61af66fc99e Initial load
duke
parents:
diff changeset
342 // %%% make offset be intptr_t
a61af66fc99e Initial load
duke
parents:
diff changeset
343 assert(!Universe::heap()->is_in_reserved((oop)offset), "must be a raw ptr");
a61af66fc99e Initial load
duke
parents:
diff changeset
344 return TypeRawPtr::BOTTOM;
a61af66fc99e Initial load
duke
parents:
diff changeset
345 }
a61af66fc99e Initial load
duke
parents:
diff changeset
346
a61af66fc99e Initial load
duke
parents:
diff changeset
347 // base of -1 with no particular offset means all of memory
a61af66fc99e Initial load
duke
parents:
diff changeset
348 if (base == NodeSentinel) return TypePtr::BOTTOM;
a61af66fc99e Initial load
duke
parents:
diff changeset
349
a61af66fc99e Initial load
duke
parents:
diff changeset
350 const Type* t = base->bottom_type();
673
fbc12e71c476 6810845: Performance regression in mpegaudio on x64
kvn
parents: 605
diff changeset
351 if (UseCompressedOops && Universe::narrow_oop_shift() == 0) {
fbc12e71c476 6810845: Performance regression in mpegaudio on x64
kvn
parents: 605
diff changeset
352 // 32-bit unscaled narrow oop can be the base of any address expression
fbc12e71c476 6810845: Performance regression in mpegaudio on x64
kvn
parents: 605
diff changeset
353 t = t->make_ptr();
fbc12e71c476 6810845: Performance regression in mpegaudio on x64
kvn
parents: 605
diff changeset
354 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
355 if (t->isa_intptr_t() && offset != 0 && offset != Type::OffsetBot) {
a61af66fc99e Initial load
duke
parents:
diff changeset
356 // We cannot assert that the offset does not look oop-ish here.
a61af66fc99e Initial load
duke
parents:
diff changeset
357 // Depending on the heap layout the cardmark base could land
a61af66fc99e Initial load
duke
parents:
diff changeset
358 // inside some oopish region. It definitely does for Win2K.
a61af66fc99e Initial load
duke
parents:
diff changeset
359 // The sum of cardmark-base plus shift-by-9-oop lands outside
a61af66fc99e Initial load
duke
parents:
diff changeset
360 // the oop-ish area but we can't assert for that statically.
a61af66fc99e Initial load
duke
parents:
diff changeset
361 return TypeRawPtr::BOTTOM;
a61af66fc99e Initial load
duke
parents:
diff changeset
362 }
a61af66fc99e Initial load
duke
parents:
diff changeset
363
a61af66fc99e Initial load
duke
parents:
diff changeset
364 const TypePtr *tp = t->isa_ptr();
a61af66fc99e Initial load
duke
parents:
diff changeset
365
a61af66fc99e Initial load
duke
parents:
diff changeset
366 // be conservative if we do not recognize the type
a61af66fc99e Initial load
duke
parents:
diff changeset
367 if (tp == NULL) {
673
fbc12e71c476 6810845: Performance regression in mpegaudio on x64
kvn
parents: 605
diff changeset
368 assert(false, "this path may produce not optimal code");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
369 return TypePtr::BOTTOM;
a61af66fc99e Initial load
duke
parents:
diff changeset
370 }
a61af66fc99e Initial load
duke
parents:
diff changeset
371 assert(tp->base() != Type::AnyPtr, "not a bare pointer");
a61af66fc99e Initial load
duke
parents:
diff changeset
372
a61af66fc99e Initial load
duke
parents:
diff changeset
373 return tp->add_offset(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
374 }
a61af66fc99e Initial load
duke
parents:
diff changeset
375
a61af66fc99e Initial load
duke
parents:
diff changeset
376
a61af66fc99e Initial load
duke
parents:
diff changeset
377 //-----------------------------operand_index---------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
378 int MachNode::operand_index( uint operand ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
379 if( operand < 1 ) return -1;
a61af66fc99e Initial load
duke
parents:
diff changeset
380 assert(operand < num_opnds(), "oob");
a61af66fc99e Initial load
duke
parents:
diff changeset
381 if( _opnds[operand]->num_edges() == 0 ) return -1;
a61af66fc99e Initial load
duke
parents:
diff changeset
382
a61af66fc99e Initial load
duke
parents:
diff changeset
383 uint skipped = oper_input_base(); // Sum of leaves skipped so far
a61af66fc99e Initial load
duke
parents:
diff changeset
384 for (uint opcnt = 1; opcnt < operand; opcnt++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
385 uint num_edges = _opnds[opcnt]->num_edges(); // leaves for operand
a61af66fc99e Initial load
duke
parents:
diff changeset
386 skipped += num_edges;
a61af66fc99e Initial load
duke
parents:
diff changeset
387 }
a61af66fc99e Initial load
duke
parents:
diff changeset
388 return skipped;
a61af66fc99e Initial load
duke
parents:
diff changeset
389 }
a61af66fc99e Initial load
duke
parents:
diff changeset
390
a61af66fc99e Initial load
duke
parents:
diff changeset
391
a61af66fc99e Initial load
duke
parents:
diff changeset
392 //------------------------------peephole---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
393 // Apply peephole rule(s) to this instruction
a61af66fc99e Initial load
duke
parents:
diff changeset
394 MachNode *MachNode::peephole( Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted, Compile* C ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
395 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
396 }
a61af66fc99e Initial load
duke
parents:
diff changeset
397
a61af66fc99e Initial load
duke
parents:
diff changeset
398 //------------------------------add_case_label---------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
399 // Adds the label for the case
a61af66fc99e Initial load
duke
parents:
diff changeset
400 void MachNode::add_case_label( int index_num, Label* blockLabel) {
a61af66fc99e Initial load
duke
parents:
diff changeset
401 ShouldNotCallThis();
a61af66fc99e Initial load
duke
parents:
diff changeset
402 }
a61af66fc99e Initial load
duke
parents:
diff changeset
403
a61af66fc99e Initial load
duke
parents:
diff changeset
404 //------------------------------method_set-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
405 // Set the absolute address of a method
a61af66fc99e Initial load
duke
parents:
diff changeset
406 void MachNode::method_set( intptr_t addr ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
407 ShouldNotCallThis();
a61af66fc99e Initial load
duke
parents:
diff changeset
408 }
a61af66fc99e Initial load
duke
parents:
diff changeset
409
a61af66fc99e Initial load
duke
parents:
diff changeset
410 //------------------------------rematerialize----------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
411 bool MachNode::rematerialize() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
412 // Temps are always rematerializable
a61af66fc99e Initial load
duke
parents:
diff changeset
413 if (is_MachTemp()) return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
414
a61af66fc99e Initial load
duke
parents:
diff changeset
415 uint r = rule(); // Match rule
a61af66fc99e Initial load
duke
parents:
diff changeset
416 if( r < Matcher::_begin_rematerialize ||
a61af66fc99e Initial load
duke
parents:
diff changeset
417 r >= Matcher::_end_rematerialize )
a61af66fc99e Initial load
duke
parents:
diff changeset
418 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
419
a61af66fc99e Initial load
duke
parents:
diff changeset
420 // For 2-address instructions, the input live range is also the output
a61af66fc99e Initial load
duke
parents:
diff changeset
421 // live range. Remateralizing does not make progress on the that live range.
a61af66fc99e Initial load
duke
parents:
diff changeset
422 if( two_adr() ) return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
423
a61af66fc99e Initial load
duke
parents:
diff changeset
424 // Check for rematerializing float constants, or not
a61af66fc99e Initial load
duke
parents:
diff changeset
425 if( !Matcher::rematerialize_float_constants ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
426 int op = ideal_Opcode();
a61af66fc99e Initial load
duke
parents:
diff changeset
427 if( op == Op_ConF || op == Op_ConD )
a61af66fc99e Initial load
duke
parents:
diff changeset
428 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
429 }
a61af66fc99e Initial load
duke
parents:
diff changeset
430
a61af66fc99e Initial load
duke
parents:
diff changeset
431 // Defining flags - can't spill these! Must remateralize.
a61af66fc99e Initial load
duke
parents:
diff changeset
432 if( ideal_reg() == Op_RegFlags )
a61af66fc99e Initial load
duke
parents:
diff changeset
433 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
434
a61af66fc99e Initial load
duke
parents:
diff changeset
435 // Stretching lots of inputs - don't do it.
a61af66fc99e Initial load
duke
parents:
diff changeset
436 if( req() > 2 )
a61af66fc99e Initial load
duke
parents:
diff changeset
437 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
438
a61af66fc99e Initial load
duke
parents:
diff changeset
439 // Don't remateralize somebody with bound inputs - it stretches a
a61af66fc99e Initial load
duke
parents:
diff changeset
440 // fixed register lifetime.
a61af66fc99e Initial load
duke
parents:
diff changeset
441 uint idx = oper_input_base();
a61af66fc99e Initial load
duke
parents:
diff changeset
442 if( req() > idx ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
443 const RegMask &rm = in_RegMask(idx);
a61af66fc99e Initial load
duke
parents:
diff changeset
444 if( rm.is_bound1() || rm.is_bound2() )
a61af66fc99e Initial load
duke
parents:
diff changeset
445 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
446 }
a61af66fc99e Initial load
duke
parents:
diff changeset
447
a61af66fc99e Initial load
duke
parents:
diff changeset
448 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
449 }
a61af66fc99e Initial load
duke
parents:
diff changeset
450
a61af66fc99e Initial load
duke
parents:
diff changeset
451 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
452 //------------------------------dump_spec--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
453 // Print any per-operand special info
a61af66fc99e Initial load
duke
parents:
diff changeset
454 void MachNode::dump_spec(outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
455 uint cnt = num_opnds();
a61af66fc99e Initial load
duke
parents:
diff changeset
456 for( uint i=0; i<cnt; i++ )
a61af66fc99e Initial load
duke
parents:
diff changeset
457 _opnds[i]->dump_spec(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
458 const TypePtr *t = adr_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
459 if( t ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
460 Compile* C = Compile::current();
a61af66fc99e Initial load
duke
parents:
diff changeset
461 if( C->alias_type(t)->is_volatile() )
a61af66fc99e Initial load
duke
parents:
diff changeset
462 st->print(" Volatile!");
a61af66fc99e Initial load
duke
parents:
diff changeset
463 }
a61af66fc99e Initial load
duke
parents:
diff changeset
464 }
a61af66fc99e Initial load
duke
parents:
diff changeset
465
a61af66fc99e Initial load
duke
parents:
diff changeset
466 //------------------------------dump_format------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
467 // access to virtual
a61af66fc99e Initial load
duke
parents:
diff changeset
468 void MachNode::dump_format(PhaseRegAlloc *ra, outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
469 format(ra, st); // access to virtual
a61af66fc99e Initial load
duke
parents:
diff changeset
470 }
a61af66fc99e Initial load
duke
parents:
diff changeset
471 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
472
a61af66fc99e Initial load
duke
parents:
diff changeset
473 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
474 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
475 void MachTypeNode::dump_spec(outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
476 _bottom_type->dump_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
477 }
a61af66fc99e Initial load
duke
parents:
diff changeset
478 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
479
2008
2f644f85485d 6961690: load oops from constant table on SPARC
twisti
parents: 1972
diff changeset
480
2f644f85485d 6961690: load oops from constant table on SPARC
twisti
parents: 1972
diff changeset
481 //=============================================================================
2f644f85485d 6961690: load oops from constant table on SPARC
twisti
parents: 1972
diff changeset
482 int MachConstantNode::constant_offset() {
2f644f85485d 6961690: load oops from constant table on SPARC
twisti
parents: 1972
diff changeset
483 // Bind the offset lazily.
4114
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
484 if (_constant.offset() == -1) {
2008
2f644f85485d 6961690: load oops from constant table on SPARC
twisti
parents: 1972
diff changeset
485 Compile::ConstantTable& constant_table = Compile::current()->constant_table();
4114
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
486 int offset = constant_table.find_offset(_constant);
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
487 // If called from Compile::scratch_emit_size return the
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
488 // pre-calculated offset.
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
489 // NOTE: If the AD file does some table base offset optimizations
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
490 // later the AD file needs to take care of this fact.
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
491 if (Compile::current()->in_scratch_emit_size()) {
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
492 return constant_table.calculate_table_base_offset() + offset;
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
493 }
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
494 _constant.set_offset(constant_table.table_base_offset() + offset);
2008
2f644f85485d 6961690: load oops from constant table on SPARC
twisti
parents: 1972
diff changeset
495 }
4114
6729bbc1fcd6 7003454: order constants in constant table by number of references in code
twisti
parents: 4053
diff changeset
496 return _constant.offset();
2008
2f644f85485d 6961690: load oops from constant table on SPARC
twisti
parents: 1972
diff changeset
497 }
2f644f85485d 6961690: load oops from constant table on SPARC
twisti
parents: 1972
diff changeset
498
2f644f85485d 6961690: load oops from constant table on SPARC
twisti
parents: 1972
diff changeset
499
0
a61af66fc99e Initial load
duke
parents:
diff changeset
500 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
501 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
502 void MachNullCheckNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
503 int reg = ra_->get_reg_first(in(1)->in(_vidx));
a61af66fc99e Initial load
duke
parents:
diff changeset
504 tty->print("%s %s", Name(), Matcher::regName[reg]);
a61af66fc99e Initial load
duke
parents:
diff changeset
505 }
a61af66fc99e Initial load
duke
parents:
diff changeset
506 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
507
a61af66fc99e Initial load
duke
parents:
diff changeset
508 void MachNullCheckNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
509 // only emits entries in the null-pointer exception handler table
a61af66fc99e Initial load
duke
parents:
diff changeset
510 }
3839
3d42f82cd811 7063628: Use cbcond on T4
kvn
parents: 2008
diff changeset
511 void MachNullCheckNode::label_set(Label* label, uint block_num) {
3d42f82cd811 7063628: Use cbcond on T4
kvn
parents: 2008
diff changeset
512 // Nothing to emit
3d42f82cd811 7063628: Use cbcond on T4
kvn
parents: 2008
diff changeset
513 }
3853
11211f7cb5a0 7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents: 3839
diff changeset
514 void MachNullCheckNode::save_label( Label** label, uint* block_num ) {
11211f7cb5a0 7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents: 3839
diff changeset
515 // Nothing to emit
11211f7cb5a0 7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents: 3839
diff changeset
516 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
517
a61af66fc99e Initial load
duke
parents:
diff changeset
518 const RegMask &MachNullCheckNode::in_RegMask( uint idx ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
519 if( idx == 0 ) return RegMask::Empty;
a61af66fc99e Initial load
duke
parents:
diff changeset
520 else return in(1)->as_Mach()->out_RegMask();
a61af66fc99e Initial load
duke
parents:
diff changeset
521 }
a61af66fc99e Initial load
duke
parents:
diff changeset
522
a61af66fc99e Initial load
duke
parents:
diff changeset
523 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
524 const Type *MachProjNode::bottom_type() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
525 if( _ideal_reg == fat_proj ) return Type::BOTTOM;
a61af66fc99e Initial load
duke
parents:
diff changeset
526 // Try the normal mechanism first
a61af66fc99e Initial load
duke
parents:
diff changeset
527 const Type *t = in(0)->bottom_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
528 if( t->base() == Type::Tuple ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
529 const TypeTuple *tt = t->is_tuple();
a61af66fc99e Initial load
duke
parents:
diff changeset
530 if (_con < tt->cnt())
a61af66fc99e Initial load
duke
parents:
diff changeset
531 return tt->field_at(_con);
a61af66fc99e Initial load
duke
parents:
diff changeset
532 }
a61af66fc99e Initial load
duke
parents:
diff changeset
533 // Else use generic type from ideal register set
a61af66fc99e Initial load
duke
parents:
diff changeset
534 assert((uint)_ideal_reg < (uint)_last_machine_leaf && Type::mreg2type[_ideal_reg], "in bounds");
a61af66fc99e Initial load
duke
parents:
diff changeset
535 return Type::mreg2type[_ideal_reg];
a61af66fc99e Initial load
duke
parents:
diff changeset
536 }
a61af66fc99e Initial load
duke
parents:
diff changeset
537
a61af66fc99e Initial load
duke
parents:
diff changeset
538 const TypePtr *MachProjNode::adr_type() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
539 if (bottom_type() == Type::MEMORY) {
a61af66fc99e Initial load
duke
parents:
diff changeset
540 // in(0) might be a narrow MemBar; otherwise we will report TypePtr::BOTTOM
a61af66fc99e Initial load
duke
parents:
diff changeset
541 const TypePtr* adr_type = in(0)->adr_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
542 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
543 if (!is_error_reported() && !Node::in_dump())
a61af66fc99e Initial load
duke
parents:
diff changeset
544 assert(adr_type != NULL, "source must have adr_type");
a61af66fc99e Initial load
duke
parents:
diff changeset
545 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
546 return adr_type;
a61af66fc99e Initial load
duke
parents:
diff changeset
547 }
a61af66fc99e Initial load
duke
parents:
diff changeset
548 assert(bottom_type()->base() != Type::Memory, "no other memories?");
a61af66fc99e Initial load
duke
parents:
diff changeset
549 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
550 }
a61af66fc99e Initial load
duke
parents:
diff changeset
551
a61af66fc99e Initial load
duke
parents:
diff changeset
552 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
553 void MachProjNode::dump_spec(outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
554 ProjNode::dump_spec(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
555 switch (_ideal_reg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
556 case unmatched_proj: st->print("/unmatched"); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
557 case fat_proj: st->print("/fat"); if (WizardMode) _rout.dump(); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
558 }
a61af66fc99e Initial load
duke
parents:
diff changeset
559 }
a61af66fc99e Initial load
duke
parents:
diff changeset
560 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
561
a61af66fc99e Initial load
duke
parents:
diff changeset
562 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
563 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
564 void MachIfNode::dump_spec(outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
565 st->print("P=%f, C=%f",_prob, _fcnt);
a61af66fc99e Initial load
duke
parents:
diff changeset
566 }
a61af66fc99e Initial load
duke
parents:
diff changeset
567 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
568
a61af66fc99e Initial load
duke
parents:
diff changeset
569 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
570 uint MachReturnNode::size_of() const { return sizeof(*this); }
a61af66fc99e Initial load
duke
parents:
diff changeset
571
a61af66fc99e Initial load
duke
parents:
diff changeset
572 //------------------------------Registers--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
573 const RegMask &MachReturnNode::in_RegMask( uint idx ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
574 return _in_rms[idx];
a61af66fc99e Initial load
duke
parents:
diff changeset
575 }
a61af66fc99e Initial load
duke
parents:
diff changeset
576
a61af66fc99e Initial load
duke
parents:
diff changeset
577 const TypePtr *MachReturnNode::adr_type() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
578 // most returns and calls are assumed to consume & modify all of memory
a61af66fc99e Initial load
duke
parents:
diff changeset
579 // the matcher will copy non-wide adr_types from ideal originals
a61af66fc99e Initial load
duke
parents:
diff changeset
580 return _adr_type;
a61af66fc99e Initial load
duke
parents:
diff changeset
581 }
a61af66fc99e Initial load
duke
parents:
diff changeset
582
a61af66fc99e Initial load
duke
parents:
diff changeset
583 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
584 const Type *MachSafePointNode::bottom_type() const { return TypeTuple::MEMBAR; }
a61af66fc99e Initial load
duke
parents:
diff changeset
585
a61af66fc99e Initial load
duke
parents:
diff changeset
586 //------------------------------Registers--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
587 const RegMask &MachSafePointNode::in_RegMask( uint idx ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
588 // Values in the domain use the users calling convention, embodied in the
a61af66fc99e Initial load
duke
parents:
diff changeset
589 // _in_rms array of RegMasks.
a61af66fc99e Initial load
duke
parents:
diff changeset
590 if( idx < TypeFunc::Parms ) return _in_rms[idx];
a61af66fc99e Initial load
duke
parents:
diff changeset
591
a61af66fc99e Initial load
duke
parents:
diff changeset
592 if (SafePointNode::needs_polling_address_input() &&
a61af66fc99e Initial load
duke
parents:
diff changeset
593 idx == TypeFunc::Parms &&
a61af66fc99e Initial load
duke
parents:
diff changeset
594 ideal_Opcode() == Op_SafePoint) {
a61af66fc99e Initial load
duke
parents:
diff changeset
595 return MachNode::in_RegMask(idx);
a61af66fc99e Initial load
duke
parents:
diff changeset
596 }
a61af66fc99e Initial load
duke
parents:
diff changeset
597
a61af66fc99e Initial load
duke
parents:
diff changeset
598 // Values outside the domain represent debug info
a61af66fc99e Initial load
duke
parents:
diff changeset
599 return *Compile::current()->matcher()->idealreg2spillmask[in(idx)->ideal_reg()];
a61af66fc99e Initial load
duke
parents:
diff changeset
600 }
a61af66fc99e Initial load
duke
parents:
diff changeset
601
a61af66fc99e Initial load
duke
parents:
diff changeset
602
a61af66fc99e Initial load
duke
parents:
diff changeset
603 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
604
a61af66fc99e Initial load
duke
parents:
diff changeset
605 uint MachCallNode::cmp( const Node &n ) const
a61af66fc99e Initial load
duke
parents:
diff changeset
606 { return _tf == ((MachCallNode&)n)._tf; }
a61af66fc99e Initial load
duke
parents:
diff changeset
607 const Type *MachCallNode::bottom_type() const { return tf()->range(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
608 const Type *MachCallNode::Value(PhaseTransform *phase) const { return tf()->range(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
609
a61af66fc99e Initial load
duke
parents:
diff changeset
610 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
611 void MachCallNode::dump_spec(outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
612 st->print("# ");
a61af66fc99e Initial load
duke
parents:
diff changeset
613 tf()->dump_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
614 if (_cnt != COUNT_UNKNOWN) st->print(" C=%f",_cnt);
a61af66fc99e Initial load
duke
parents:
diff changeset
615 if (jvms() != NULL) jvms()->dump_spec(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
616 }
a61af66fc99e Initial load
duke
parents:
diff changeset
617 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
618
a61af66fc99e Initial load
duke
parents:
diff changeset
619
a61af66fc99e Initial load
duke
parents:
diff changeset
620 bool MachCallNode::return_value_is_used() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
621 if (tf()->range()->cnt() == TypeFunc::Parms) {
a61af66fc99e Initial load
duke
parents:
diff changeset
622 // void return
a61af66fc99e Initial load
duke
parents:
diff changeset
623 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
624 }
a61af66fc99e Initial load
duke
parents:
diff changeset
625
a61af66fc99e Initial load
duke
parents:
diff changeset
626 // find the projection corresponding to the return value
a61af66fc99e Initial load
duke
parents:
diff changeset
627 for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
628 Node *use = fast_out(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
629 if (!use->is_Proj()) continue;
a61af66fc99e Initial load
duke
parents:
diff changeset
630 if (use->as_Proj()->_con == TypeFunc::Parms) {
a61af66fc99e Initial load
duke
parents:
diff changeset
631 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
632 }
a61af66fc99e Initial load
duke
parents:
diff changeset
633 }
a61af66fc99e Initial load
duke
parents:
diff changeset
634 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
635 }
a61af66fc99e Initial load
duke
parents:
diff changeset
636
a61af66fc99e Initial load
duke
parents:
diff changeset
637
a61af66fc99e Initial load
duke
parents:
diff changeset
638 //------------------------------Registers--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
639 const RegMask &MachCallNode::in_RegMask( uint idx ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
640 // Values in the domain use the users calling convention, embodied in the
a61af66fc99e Initial load
duke
parents:
diff changeset
641 // _in_rms array of RegMasks.
a61af66fc99e Initial load
duke
parents:
diff changeset
642 if (idx < tf()->domain()->cnt()) return _in_rms[idx];
a61af66fc99e Initial load
duke
parents:
diff changeset
643 // Values outside the domain represent debug info
a61af66fc99e Initial load
duke
parents:
diff changeset
644 return *Compile::current()->matcher()->idealreg2debugmask[in(idx)->ideal_reg()];
a61af66fc99e Initial load
duke
parents:
diff changeset
645 }
a61af66fc99e Initial load
duke
parents:
diff changeset
646
a61af66fc99e Initial load
duke
parents:
diff changeset
647 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
648 uint MachCallJavaNode::size_of() const { return sizeof(*this); }
a61af66fc99e Initial load
duke
parents:
diff changeset
649 uint MachCallJavaNode::cmp( const Node &n ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
650 MachCallJavaNode &call = (MachCallJavaNode&)n;
a61af66fc99e Initial load
duke
parents:
diff changeset
651 return MachCallNode::cmp(call) && _method->equals(call._method);
a61af66fc99e Initial load
duke
parents:
diff changeset
652 }
a61af66fc99e Initial load
duke
parents:
diff changeset
653 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
654 void MachCallJavaNode::dump_spec(outputStream *st) const {
1137
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
655 if (_method_handle_invoke)
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
656 st->print("MethodHandle ");
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
657 if (_method) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
658 _method->print_short_name(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
659 st->print(" ");
a61af66fc99e Initial load
duke
parents:
diff changeset
660 }
a61af66fc99e Initial load
duke
parents:
diff changeset
661 MachCallNode::dump_spec(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
662 }
a61af66fc99e Initial load
duke
parents:
diff changeset
663 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
664
1137
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
665 //------------------------------Registers--------------------------------------
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
666 const RegMask &MachCallJavaNode::in_RegMask(uint idx) const {
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
667 // Values in the domain use the users calling convention, embodied in the
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
668 // _in_rms array of RegMasks.
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
669 if (idx < tf()->domain()->cnt()) return _in_rms[idx];
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
670 // Values outside the domain represent debug info
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
671 Matcher* m = Compile::current()->matcher();
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
672 // If this call is a MethodHandle invoke we have to use a different
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
673 // debugmask which does not include the register we use to save the
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
674 // SP over MH invokes.
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
675 RegMask** debugmask = _method_handle_invoke ? m->idealreg2mhdebugmask : m->idealreg2debugmask;
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
676 return *debugmask[in(idx)->ideal_reg()];
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
677 }
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 866
diff changeset
678
0
a61af66fc99e Initial load
duke
parents:
diff changeset
679 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
680 uint MachCallStaticJavaNode::size_of() const { return sizeof(*this); }
a61af66fc99e Initial load
duke
parents:
diff changeset
681 uint MachCallStaticJavaNode::cmp( const Node &n ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
682 MachCallStaticJavaNode &call = (MachCallStaticJavaNode&)n;
a61af66fc99e Initial load
duke
parents:
diff changeset
683 return MachCallJavaNode::cmp(call) && _name == call._name;
a61af66fc99e Initial load
duke
parents:
diff changeset
684 }
a61af66fc99e Initial load
duke
parents:
diff changeset
685
a61af66fc99e Initial load
duke
parents:
diff changeset
686 //----------------------------uncommon_trap_request----------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
687 // If this is an uncommon trap, return the request code, else zero.
a61af66fc99e Initial load
duke
parents:
diff changeset
688 int MachCallStaticJavaNode::uncommon_trap_request() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
689 if (_name != NULL && !strcmp(_name, "uncommon_trap")) {
a61af66fc99e Initial load
duke
parents:
diff changeset
690 return CallStaticJavaNode::extract_uncommon_trap_request(this);
a61af66fc99e Initial load
duke
parents:
diff changeset
691 }
a61af66fc99e Initial load
duke
parents:
diff changeset
692 return 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
693 }
a61af66fc99e Initial load
duke
parents:
diff changeset
694
a61af66fc99e Initial load
duke
parents:
diff changeset
695 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
696 // Helper for summarizing uncommon_trap arguments.
a61af66fc99e Initial load
duke
parents:
diff changeset
697 void MachCallStaticJavaNode::dump_trap_args(outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
698 int trap_req = uncommon_trap_request();
a61af66fc99e Initial load
duke
parents:
diff changeset
699 if (trap_req != 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
700 char buf[100];
a61af66fc99e Initial load
duke
parents:
diff changeset
701 st->print("(%s)",
a61af66fc99e Initial load
duke
parents:
diff changeset
702 Deoptimization::format_trap_request(buf, sizeof(buf),
a61af66fc99e Initial load
duke
parents:
diff changeset
703 trap_req));
a61af66fc99e Initial load
duke
parents:
diff changeset
704 }
a61af66fc99e Initial load
duke
parents:
diff changeset
705 }
a61af66fc99e Initial load
duke
parents:
diff changeset
706
a61af66fc99e Initial load
duke
parents:
diff changeset
707 void MachCallStaticJavaNode::dump_spec(outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
708 st->print("Static ");
a61af66fc99e Initial load
duke
parents:
diff changeset
709 if (_name != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
710 st->print("wrapper for: %s", _name );
a61af66fc99e Initial load
duke
parents:
diff changeset
711 dump_trap_args(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
712 st->print(" ");
a61af66fc99e Initial load
duke
parents:
diff changeset
713 }
a61af66fc99e Initial load
duke
parents:
diff changeset
714 MachCallJavaNode::dump_spec(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
715 }
a61af66fc99e Initial load
duke
parents:
diff changeset
716 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
717
a61af66fc99e Initial load
duke
parents:
diff changeset
718 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
719 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
720 void MachCallDynamicJavaNode::dump_spec(outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
721 st->print("Dynamic ");
a61af66fc99e Initial load
duke
parents:
diff changeset
722 MachCallJavaNode::dump_spec(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
723 }
a61af66fc99e Initial load
duke
parents:
diff changeset
724 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
725 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
726 uint MachCallRuntimeNode::size_of() const { return sizeof(*this); }
a61af66fc99e Initial load
duke
parents:
diff changeset
727 uint MachCallRuntimeNode::cmp( const Node &n ) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
728 MachCallRuntimeNode &call = (MachCallRuntimeNode&)n;
a61af66fc99e Initial load
duke
parents:
diff changeset
729 return MachCallNode::cmp(call) && !strcmp(_name,call._name);
a61af66fc99e Initial load
duke
parents:
diff changeset
730 }
a61af66fc99e Initial load
duke
parents:
diff changeset
731 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
732 void MachCallRuntimeNode::dump_spec(outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
733 st->print("%s ",_name);
a61af66fc99e Initial load
duke
parents:
diff changeset
734 MachCallNode::dump_spec(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
735 }
a61af66fc99e Initial load
duke
parents:
diff changeset
736 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
737 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
738 // A shared JVMState for all HaltNodes. Indicates the start of debug info
a61af66fc99e Initial load
duke
parents:
diff changeset
739 // is at TypeFunc::Parms. Only required for SOE register spill handling -
a61af66fc99e Initial load
duke
parents:
diff changeset
740 // to indicate where the stack-slot-only debug info inputs begin.
a61af66fc99e Initial load
duke
parents:
diff changeset
741 // There is no other JVM state needed here.
a61af66fc99e Initial load
duke
parents:
diff changeset
742 JVMState jvms_for_throw(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
743 JVMState *MachHaltNode::jvms() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
744 return &jvms_for_throw;
a61af66fc99e Initial load
duke
parents:
diff changeset
745 }
a61af66fc99e Initial load
duke
parents:
diff changeset
746
a61af66fc99e Initial load
duke
parents:
diff changeset
747 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
748 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
749 void labelOper::int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
750 st->print("B%d", _block_num);
a61af66fc99e Initial load
duke
parents:
diff changeset
751 }
a61af66fc99e Initial load
duke
parents:
diff changeset
752 #endif // PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
753
a61af66fc99e Initial load
duke
parents:
diff changeset
754 //=============================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
755 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
756 void methodOper::int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
757 st->print(INTPTR_FORMAT, _method);
a61af66fc99e Initial load
duke
parents:
diff changeset
758 }
a61af66fc99e Initial load
duke
parents:
diff changeset
759 #endif // PRODUCT