author | zmajo |
Wed, 15 Jun 2016 14:27:58 +0200 | |
changeset 39421 | a9652c919db8 |
parent 36604 | e9c073b0c19e |
child 40868 | 607b015fd047 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
28954
7dda6c26cc98
8068977: Remove unused sun.misc.Unsafe prefetch intrinsic support
psandoz
parents:
24313
diff
changeset
|
2 |
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1623
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1623
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1623
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_C1_C1_GRAPHBUILDER_HPP |
26 |
#define SHARE_VM_C1_C1_GRAPHBUILDER_HPP |
|
27 |
||
28 |
#include "c1/c1_IR.hpp" |
|
29 |
#include "c1/c1_Instruction.hpp" |
|
30 |
#include "c1/c1_ValueMap.hpp" |
|
31 |
#include "c1/c1_ValueStack.hpp" |
|
32 |
#include "ci/ciMethodData.hpp" |
|
33 |
#include "ci/ciStreams.hpp" |
|
13964 | 34 |
#include "compiler/compileLog.hpp" |
7397 | 35 |
|
1 | 36 |
class MemoryBuffer; |
37 |
||
38 |
class GraphBuilder VALUE_OBJ_CLASS_SPEC { |
|
39 |
private: |
|
40 |
// Per-scope data. These are pushed and popped as we descend into |
|
41 |
// inlined methods. Currently in order to generate good code in the |
|
42 |
// inliner we have to attempt to inline methods directly into the |
|
43 |
// basic block we are parsing; this adds complexity. |
|
44 |
class ScopeData: public CompilationResourceObj { |
|
45 |
private: |
|
46 |
ScopeData* _parent; |
|
47 |
// bci-to-block mapping |
|
48 |
BlockList* _bci2block; |
|
49 |
// Scope |
|
50 |
IRScope* _scope; |
|
51 |
// Whether this scope or any parent scope has exception handlers |
|
52 |
bool _has_handler; |
|
53 |
// The bytecodes |
|
54 |
ciBytecodeStream* _stream; |
|
55 |
||
56 |
// Work list |
|
57 |
BlockList* _work_list; |
|
58 |
||
59 |
// Maximum inline size for this scope |
|
60 |
intx _max_inline_size; |
|
61 |
// Expression stack depth at point where inline occurred |
|
62 |
int _caller_stack_size; |
|
63 |
||
64 |
// The continuation point for the inline. Currently only used in |
|
65 |
// multi-block inlines, but eventually would like to use this for |
|
66 |
// all inlines for uniformity and simplicity; in this case would |
|
67 |
// get the continuation point from the BlockList instead of |
|
68 |
// fabricating it anew because Invokes would be considered to be |
|
69 |
// BlockEnds. |
|
70 |
BlockBegin* _continuation; |
|
71 |
||
72 |
// Was this ScopeData created only for the parsing and inlining of |
|
73 |
// a jsr? |
|
74 |
bool _parsing_jsr; |
|
75 |
// We track the destination bci of the jsr only to determine |
|
76 |
// bailout conditions, since we only handle a subset of all of the |
|
77 |
// possible jsr-ret control structures. Recursive invocations of a |
|
78 |
// jsr are disallowed by the verifier. |
|
79 |
int _jsr_entry_bci; |
|
80 |
// We need to track the local variable in which the return address |
|
81 |
// was stored to ensure we can handle inlining the jsr, because we |
|
82 |
// don't handle arbitrary jsr/ret constructs. |
|
83 |
int _jsr_ret_addr_local; |
|
84 |
// If we are parsing a jsr, the continuation point for rets |
|
85 |
BlockBegin* _jsr_continuation; |
|
86 |
// Cloned XHandlers for jsr-related ScopeDatas |
|
87 |
XHandlers* _jsr_xhandlers; |
|
88 |
||
89 |
// Number of returns seen in this scope |
|
90 |
int _num_returns; |
|
91 |
||
92 |
// In order to generate profitable code for inlining, we currently |
|
93 |
// have to perform an optimization for single-block inlined |
|
94 |
// methods where we continue parsing into the same block. This |
|
95 |
// allows us to perform CSE across inlined scopes and to avoid |
|
96 |
// storing parameters to the stack. Having a global register |
|
97 |
// allocator and being able to perform global CSE would allow this |
|
98 |
// code to be removed and thereby simplify the inliner. |
|
99 |
BlockBegin* _cleanup_block; // The block to which the return was added |
|
100 |
Instruction* _cleanup_return_prev; // Instruction before return instruction |
|
101 |
ValueStack* _cleanup_state; // State of that block (not yet pinned) |
|
102 |
||
103 |
public: |
|
104 |
ScopeData(ScopeData* parent); |
|
105 |
||
106 |
ScopeData* parent() const { return _parent; } |
|
107 |
||
108 |
BlockList* bci2block() const { return _bci2block; } |
|
109 |
void set_bci2block(BlockList* bci2block) { _bci2block = bci2block; } |
|
110 |
||
111 |
// NOTE: this has a different effect when parsing jsrs |
|
112 |
BlockBegin* block_at(int bci); |
|
113 |
||
114 |
IRScope* scope() const { return _scope; } |
|
115 |
// Has side-effect of setting has_handler flag |
|
116 |
void set_scope(IRScope* scope); |
|
117 |
||
118 |
// Whether this or any parent scope has exception handlers |
|
119 |
bool has_handler() const { return _has_handler; } |
|
120 |
void set_has_handler() { _has_handler = true; } |
|
121 |
||
122 |
// Exception handlers list to be used for this scope |
|
123 |
XHandlers* xhandlers() const; |
|
124 |
||
125 |
// How to get a block to be parsed |
|
126 |
void add_to_work_list(BlockBegin* block); |
|
127 |
// How to remove the next block to be parsed; returns NULL if none left |
|
128 |
BlockBegin* remove_from_work_list(); |
|
129 |
// Indicates parse is over |
|
130 |
bool is_work_list_empty() const; |
|
131 |
||
132 |
ciBytecodeStream* stream() { return _stream; } |
|
133 |
void set_stream(ciBytecodeStream* stream) { _stream = stream; } |
|
134 |
||
135 |
intx max_inline_size() const { return _max_inline_size; } |
|
136 |
||
137 |
BlockBegin* continuation() const { return _continuation; } |
|
138 |
void set_continuation(BlockBegin* cont) { _continuation = cont; } |
|
139 |
||
140 |
// Indicates whether this ScopeData was pushed only for the |
|
141 |
// parsing and inlining of a jsr |
|
142 |
bool parsing_jsr() const { return _parsing_jsr; } |
|
143 |
void set_parsing_jsr() { _parsing_jsr = true; } |
|
144 |
int jsr_entry_bci() const { return _jsr_entry_bci; } |
|
145 |
void set_jsr_entry_bci(int bci) { _jsr_entry_bci = bci; } |
|
146 |
void set_jsr_return_address_local(int local_no){ _jsr_ret_addr_local = local_no; } |
|
147 |
int jsr_return_address_local() const { return _jsr_ret_addr_local; } |
|
148 |
// Must be called after scope is set up for jsr ScopeData |
|
149 |
void setup_jsr_xhandlers(); |
|
150 |
||
151 |
// The jsr continuation is only used when parsing_jsr is true, and |
|
152 |
// is different from the "normal" continuation since we can end up |
|
153 |
// doing a return (rather than a ret) from within a subroutine |
|
154 |
BlockBegin* jsr_continuation() const { return _jsr_continuation; } |
|
155 |
void set_jsr_continuation(BlockBegin* cont) { _jsr_continuation = cont; } |
|
156 |
||
157 |
int num_returns(); |
|
158 |
void incr_num_returns(); |
|
159 |
||
160 |
void set_inline_cleanup_info(BlockBegin* block, |
|
161 |
Instruction* return_prev, |
|
162 |
ValueStack* return_state); |
|
163 |
BlockBegin* inline_cleanup_block() const { return _cleanup_block; } |
|
164 |
Instruction* inline_cleanup_return_prev() const{ return _cleanup_return_prev; } |
|
165 |
ValueStack* inline_cleanup_state() const { return _cleanup_state; } |
|
166 |
}; |
|
167 |
||
168 |
// for all GraphBuilders |
|
169 |
static bool _can_trap[Bytecodes::number_of_java_codes]; |
|
170 |
||
171 |
// for each instance of GraphBuilder |
|
172 |
ScopeData* _scope_data; // Per-scope data; used for inlining |
|
173 |
Compilation* _compilation; // the current compilation |
|
174 |
ValueMap* _vmap; // the map of values encountered (for CSE) |
|
175 |
MemoryBuffer* _memory; |
|
176 |
const char* _inline_bailout_msg; // non-null if most recent inline attempt failed |
|
177 |
int _instruction_count; // for bailing out in pathological jsr/ret cases |
|
178 |
BlockBegin* _start; // the start block |
|
179 |
BlockBegin* _osr_entry; // the osr entry block block |
|
180 |
ValueStack* _initial_state; // The state for the start block |
|
181 |
||
182 |
// for each call to connect_to_end; can also be set by inliner |
|
183 |
BlockBegin* _block; // the current block |
|
184 |
ValueStack* _state; // the current execution state |
|
185 |
Instruction* _last; // the last instruction added |
|
186 |
bool _skip_block; // skip processing of the rest of this block |
|
187 |
||
188 |
// accessors |
|
189 |
ScopeData* scope_data() const { return _scope_data; } |
|
190 |
Compilation* compilation() const { return _compilation; } |
|
191 |
BlockList* bci2block() const { return scope_data()->bci2block(); } |
|
192 |
ValueMap* vmap() const { assert(UseLocalValueNumbering, "should not access otherwise"); return _vmap; } |
|
193 |
bool has_handler() const { return scope_data()->has_handler(); } |
|
194 |
||
195 |
BlockBegin* block() const { return _block; } |
|
196 |
ValueStack* state() const { return _state; } |
|
197 |
void set_state(ValueStack* state) { _state = state; } |
|
198 |
IRScope* scope() const { return scope_data()->scope(); } |
|
199 |
ciMethod* method() const { return scope()->method(); } |
|
200 |
ciBytecodeStream* stream() const { return scope_data()->stream(); } |
|
201 |
Instruction* last() const { return _last; } |
|
202 |
Bytecodes::Code code() const { return stream()->cur_bc(); } |
|
203 |
int bci() const { return stream()->cur_bci(); } |
|
204 |
int next_bci() const { return stream()->next_bci(); } |
|
205 |
||
206 |
// unified bailout support |
|
207 |
void bailout(const char* msg) const { compilation()->bailout(msg); } |
|
208 |
bool bailed_out() const { return compilation()->bailed_out(); } |
|
209 |
||
210 |
// stack manipulation helpers |
|
211 |
void ipush(Value t) const { state()->ipush(t); } |
|
212 |
void lpush(Value t) const { state()->lpush(t); } |
|
213 |
void fpush(Value t) const { state()->fpush(t); } |
|
214 |
void dpush(Value t) const { state()->dpush(t); } |
|
215 |
void apush(Value t) const { state()->apush(t); } |
|
216 |
void push(ValueType* type, Value t) const { state()-> push(type, t); } |
|
217 |
||
218 |
Value ipop() { return state()->ipop(); } |
|
219 |
Value lpop() { return state()->lpop(); } |
|
220 |
Value fpop() { return state()->fpop(); } |
|
221 |
Value dpop() { return state()->dpop(); } |
|
222 |
Value apop() { return state()->apop(); } |
|
223 |
Value pop(ValueType* type) { return state()-> pop(type); } |
|
224 |
||
225 |
// instruction helpers |
|
226 |
void load_constant(); |
|
227 |
void load_local(ValueType* type, int index); |
|
228 |
void store_local(ValueType* type, int index); |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
11635
diff
changeset
|
229 |
void store_local(ValueStack* state, Value value, int index); |
1 | 230 |
void load_indexed (BasicType type); |
231 |
void store_indexed(BasicType type); |
|
232 |
void stack_op(Bytecodes::Code code); |
|
6745 | 233 |
void arithmetic_op(ValueType* type, Bytecodes::Code code, ValueStack* state_before = NULL); |
1 | 234 |
void negate_op(ValueType* type); |
235 |
void shift_op(ValueType* type, Bytecodes::Code code); |
|
236 |
void logic_op(ValueType* type, Bytecodes::Code code); |
|
237 |
void compare_op(ValueType* type, Bytecodes::Code code); |
|
238 |
void convert(Bytecodes::Code op, BasicType from, BasicType to); |
|
239 |
void increment(); |
|
240 |
void _goto(int from_bci, int to_bci); |
|
241 |
void if_node(Value x, If::Condition cond, Value y, ValueStack* stack_before); |
|
242 |
void if_zero(ValueType* type, If::Condition cond); |
|
243 |
void if_null(ValueType* type, If::Condition cond); |
|
244 |
void if_same(ValueType* type, If::Condition cond); |
|
245 |
void jsr(int dest); |
|
246 |
void ret(int local_index); |
|
247 |
void table_switch(); |
|
248 |
void lookup_switch(); |
|
249 |
void method_return(Value x); |
|
250 |
void call_register_finalizer(); |
|
251 |
void access_field(Bytecodes::Code code); |
|
252 |
void invoke(Bytecodes::Code code); |
|
253 |
void new_instance(int klass_index); |
|
254 |
void new_type_array(); |
|
255 |
void new_object_array(); |
|
256 |
void check_cast(int klass_index); |
|
257 |
void instance_of(int klass_index); |
|
258 |
void monitorenter(Value x, int bci); |
|
259 |
void monitorexit(Value x, int bci); |
|
260 |
void new_multi_array(int dimensions); |
|
261 |
void throw_op(int bci); |
|
262 |
Value round_fp(Value fp_value); |
|
263 |
||
264 |
// stack/code manipulation helpers |
|
265 |
Instruction* append_with_bci(Instruction* instr, int bci); |
|
266 |
Instruction* append(Instruction* instr); |
|
267 |
Instruction* append_split(StateSplit* instr); |
|
268 |
||
269 |
// other helpers |
|
270 |
BlockBegin* block_at(int bci) { return scope_data()->block_at(bci); } |
|
6745 | 271 |
XHandlers* handle_exception(Instruction* instruction); |
1 | 272 |
void connect_to_end(BlockBegin* beg); |
273 |
void null_check(Value value); |
|
274 |
void eliminate_redundant_phis(BlockBegin* start); |
|
275 |
BlockEnd* iterate_bytecodes_for_block(int bci); |
|
276 |
void iterate_all_blocks(bool start_in_current_block_for_inlining = false); |
|
277 |
Dependencies* dependency_recorder() const; // = compilation()->dependencies() |
|
278 |
bool direct_compare(ciKlass* k); |
|
36604 | 279 |
Value make_constant(ciConstant value, ciField* field); |
1 | 280 |
|
281 |
void kill_all(); |
|
282 |
||
6745 | 283 |
// use of state copy routines (try to minimize unnecessary state |
284 |
// object allocations): |
|
285 |
||
286 |
// - if the instruction unconditionally needs a full copy of the |
|
287 |
// state (for patching for example), then use copy_state_before* |
|
288 |
||
289 |
// - if the instruction needs a full copy of the state only for |
|
290 |
// handler generation (Instruction::needs_exception_state() returns |
|
291 |
// false) then use copy_state_exhandling* |
|
292 |
||
293 |
// - if the instruction needs either a full copy of the state for |
|
294 |
// handler generation and a least a minimal copy of the state (as |
|
295 |
// returned by Instruction::exception_state()) for debug info |
|
296 |
// generation (that is when Instruction::needs_exception_state() |
|
297 |
// returns true) then use copy_state_for_exception* |
|
298 |
||
299 |
ValueStack* copy_state_before_with_bci(int bci); |
|
300 |
ValueStack* copy_state_before(); |
|
301 |
ValueStack* copy_state_exhandling_with_bci(int bci); |
|
302 |
ValueStack* copy_state_exhandling(); |
|
303 |
ValueStack* copy_state_for_exception_with_bci(int bci); |
|
304 |
ValueStack* copy_state_for_exception(); |
|
16611 | 305 |
ValueStack* copy_state_if_bb(bool is_bb) { return (is_bb || compilation()->is_optimistic()) ? copy_state_before() : NULL; } |
306 |
ValueStack* copy_state_indexed_access() { return compilation()->is_optimistic() ? copy_state_before() : copy_state_for_exception(); } |
|
1 | 307 |
|
308 |
// |
|
309 |
// Inlining support |
|
310 |
// |
|
311 |
||
312 |
// accessors |
|
313 |
bool parsing_jsr() const { return scope_data()->parsing_jsr(); } |
|
314 |
BlockBegin* continuation() const { return scope_data()->continuation(); } |
|
315 |
BlockBegin* jsr_continuation() const { return scope_data()->jsr_continuation(); } |
|
316 |
void set_continuation(BlockBegin* continuation) { scope_data()->set_continuation(continuation); } |
|
317 |
void set_inline_cleanup_info(BlockBegin* block, |
|
318 |
Instruction* return_prev, |
|
319 |
ValueStack* return_state) { scope_data()->set_inline_cleanup_info(block, |
|
320 |
return_prev, |
|
321 |
return_state); } |
|
10509
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
322 |
void set_inline_cleanup_info() { |
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
323 |
set_inline_cleanup_info(_block, _last, _state); |
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
324 |
} |
1 | 325 |
BlockBegin* inline_cleanup_block() const { return scope_data()->inline_cleanup_block(); } |
326 |
Instruction* inline_cleanup_return_prev() const { return scope_data()->inline_cleanup_return_prev(); } |
|
327 |
ValueStack* inline_cleanup_state() const { return scope_data()->inline_cleanup_state(); } |
|
10509
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
328 |
void restore_inline_cleanup_info() { |
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
329 |
_block = inline_cleanup_block(); |
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
330 |
_last = inline_cleanup_return_prev(); |
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
331 |
_state = inline_cleanup_state(); |
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
332 |
} |
1 | 333 |
void incr_num_returns() { scope_data()->incr_num_returns(); } |
334 |
int num_returns() const { return scope_data()->num_returns(); } |
|
335 |
intx max_inline_size() const { return scope_data()->max_inline_size(); } |
|
336 |
int inline_level() const { return scope()->level(); } |
|
337 |
int recursive_inline_level(ciMethod* callee) const; |
|
338 |
||
339 |
// inlining of synchronized methods |
|
340 |
void inline_sync_entry(Value lock, BlockBegin* sync_handler); |
|
341 |
void fill_sync_handler(Value lock, BlockBegin* sync_handler, bool default_handler = false); |
|
342 |
||
31962
d05e0a4d1b43
8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents:
28954
diff
changeset
|
343 |
void build_graph_for_intrinsic(ciMethod* callee); |
d05e0a4d1b43
8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents:
28954
diff
changeset
|
344 |
|
1 | 345 |
// inliners |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
11635
diff
changeset
|
346 |
bool try_inline( ciMethod* callee, bool holder_known, Bytecodes::Code bc = Bytecodes::_illegal, Value receiver = NULL); |
1 | 347 |
bool try_inline_intrinsics(ciMethod* callee); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
11635
diff
changeset
|
348 |
bool try_inline_full( ciMethod* callee, bool holder_known, Bytecodes::Code bc = Bytecodes::_illegal, Value receiver = NULL); |
1 | 349 |
bool try_inline_jsr(int jsr_dest_bci); |
350 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
11635
diff
changeset
|
351 |
const char* check_can_parse(ciMethod* callee) const; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
11635
diff
changeset
|
352 |
const char* should_not_inline(ciMethod* callee) const; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
11635
diff
changeset
|
353 |
|
10509
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
354 |
// JSR 292 support |
13522
5ad4627e792a
7192406: JSR 292: C2 needs exact return type information for invokedynamic and invokehandle call sites
twisti
parents:
13391
diff
changeset
|
355 |
bool try_method_handle_inline(ciMethod* callee); |
10509
43d670e5701e
7079673: JSR 292: C1 should inline bytecoded method handle adapters
twisti
parents:
7397
diff
changeset
|
356 |
|
1 | 357 |
// helpers |
358 |
void inline_bailout(const char* msg); |
|
359 |
BlockBegin* header_block(BlockBegin* entry, BlockBegin::Flag f, ValueStack* state); |
|
360 |
BlockBegin* setup_start_block(int osr_bci, BlockBegin* std_entry, BlockBegin* osr_entry, ValueStack* init_state); |
|
361 |
void setup_osr_entry_block(); |
|
362 |
void clear_inline_bailout(); |
|
363 |
ValueStack* state_at_entry(); |
|
364 |
void push_root_scope(IRScope* scope, BlockList* bci2block, BlockBegin* start); |
|
365 |
void push_scope(ciMethod* callee, BlockBegin* continuation); |
|
366 |
void push_scope_for_jsr(BlockBegin* jsr_continuation, int jsr_dest_bci); |
|
367 |
void pop_scope(); |
|
368 |
void pop_scope_for_jsr(); |
|
369 |
||
31962
d05e0a4d1b43
8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents:
28954
diff
changeset
|
370 |
void append_unsafe_get_obj(ciMethod* callee, BasicType t, bool is_volatile); |
d05e0a4d1b43
8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents:
28954
diff
changeset
|
371 |
void append_unsafe_put_obj(ciMethod* callee, BasicType t, bool is_volatile); |
d05e0a4d1b43
8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents:
28954
diff
changeset
|
372 |
void append_unsafe_get_raw(ciMethod* callee, BasicType t); |
d05e0a4d1b43
8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents:
28954
diff
changeset
|
373 |
void append_unsafe_put_raw(ciMethod* callee, BasicType t); |
1 | 374 |
void append_unsafe_CAS(ciMethod* callee); |
31962
d05e0a4d1b43
8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents:
28954
diff
changeset
|
375 |
void append_unsafe_get_and_set_obj(ciMethod* callee, bool is_add); |
33628 | 376 |
void append_char_access(ciMethod* callee, bool is_store); |
1 | 377 |
|
13964 | 378 |
void print_inlining(ciMethod* callee, const char* msg = NULL, bool success = true); |
1 | 379 |
|
20702
bbe0fcde6e13
8023657: New type profiling points: arguments to call
roland
parents:
16611
diff
changeset
|
380 |
void profile_call(ciMethod* callee, Value recv, ciKlass* predicted_holder, Values* obj_args, bool inlined); |
20709
034be898bf04
8026054: New type profiling points: type of return values at calls
roland
parents:
20702
diff
changeset
|
381 |
void profile_return_type(Value ret, ciMethod* callee, ciMethod* m = NULL, int bci = -1); |
6751 | 382 |
void profile_invocation(ciMethod* inlinee, ValueStack* state); |
1 | 383 |
|
6453 | 384 |
// Shortcuts to profiling control. |
385 |
bool is_profiling() { return _compilation->is_profiling(); } |
|
386 |
bool count_invocations() { return _compilation->count_invocations(); } |
|
387 |
bool count_backedges() { return _compilation->count_backedges(); } |
|
388 |
bool profile_branches() { return _compilation->profile_branches(); } |
|
389 |
bool profile_calls() { return _compilation->profile_calls(); } |
|
390 |
bool profile_inlined_calls() { return _compilation->profile_inlined_calls(); } |
|
391 |
bool profile_checkcasts() { return _compilation->profile_checkcasts(); } |
|
21095
1a04f7b3946e
8026251: New type profiling points: parameters to methods
roland
parents:
20709
diff
changeset
|
392 |
bool profile_parameters() { return _compilation->profile_parameters(); } |
1a04f7b3946e
8026251: New type profiling points: parameters to methods
roland
parents:
20709
diff
changeset
|
393 |
bool profile_arguments() { return _compilation->profile_arguments(); } |
1a04f7b3946e
8026251: New type profiling points: parameters to methods
roland
parents:
20709
diff
changeset
|
394 |
bool profile_return() { return _compilation->profile_return(); } |
1 | 395 |
|
21095
1a04f7b3946e
8026251: New type profiling points: parameters to methods
roland
parents:
20709
diff
changeset
|
396 |
Values* args_list_for_profiling(ciMethod* target, int& start, bool may_have_receiver); |
1a04f7b3946e
8026251: New type profiling points: parameters to methods
roland
parents:
20709
diff
changeset
|
397 |
Values* collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver); |
24313
2e10cd8a870f
8041481: JVM crashes with collect_args_for_profiling
roland
parents:
22234
diff
changeset
|
398 |
void check_args_for_profiling(Values* obj_args, int expected); |
20702
bbe0fcde6e13
8023657: New type profiling points: arguments to call
roland
parents:
16611
diff
changeset
|
399 |
|
1 | 400 |
public: |
401 |
NOT_PRODUCT(void print_stats();) |
|
402 |
||
403 |
// initialization |
|
404 |
static void initialize(); |
|
405 |
||
406 |
// public |
|
407 |
static bool can_trap(ciMethod* method, Bytecodes::Code code) { |
|
408 |
assert(0 <= code && code < Bytecodes::number_of_java_codes, "illegal bytecode"); |
|
409 |
if (_can_trap[code]) return true; |
|
410 |
// special handling for finalizer registration |
|
411 |
return code == Bytecodes::_return && method->intrinsic_id() == vmIntrinsics::_Object_init; |
|
412 |
} |
|
413 |
||
414 |
// creation |
|
415 |
GraphBuilder(Compilation* compilation, IRScope* scope); |
|
416 |
static void sort_top_into_worklist(BlockList* worklist, BlockBegin* top); |
|
417 |
||
418 |
BlockBegin* start() const { return _start; } |
|
419 |
}; |
|
7397 | 420 |
|
421 |
#endif // SHARE_VM_C1_C1_GRAPHBUILDER_HPP |