comparison src/share/vm/opto/compile.hpp @ 12355:cefad50507d8

Merge with hs25-b53
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 11 Oct 2013 10:38:03 +0200
parents 1b64d46620a3
children 3213ba4d3dff
comparison
equal deleted inserted replaced
12058:ccb4f2af2319 12355:cefad50507d8
70 class relocInfo; 70 class relocInfo;
71 class Scope; 71 class Scope;
72 class StartNode; 72 class StartNode;
73 class SafePointNode; 73 class SafePointNode;
74 class JVMState; 74 class JVMState;
75 class Type;
75 class TypeData; 76 class TypeData;
76 class TypePtr; 77 class TypePtr;
77 class TypeOopPtr; 78 class TypeOopPtr;
78 class TypeFunc; 79 class TypeFunc;
79 class Unique_Node_List; 80 class Unique_Node_List;
117 friend class Compile; 118 friend class Compile;
118 119
119 int _index; // unique index, used with MergeMemNode 120 int _index; // unique index, used with MergeMemNode
120 const TypePtr* _adr_type; // normalized address type 121 const TypePtr* _adr_type; // normalized address type
121 ciField* _field; // relevant instance field, or null if none 122 ciField* _field; // relevant instance field, or null if none
123 const Type* _element; // relevant array element type, or null if none
122 bool _is_rewritable; // false if the memory is write-once only 124 bool _is_rewritable; // false if the memory is write-once only
123 int _general_index; // if this is type is an instance, the general 125 int _general_index; // if this is type is an instance, the general
124 // type that this is an instance of 126 // type that this is an instance of
125 127
126 void Init(int i, const TypePtr* at); 128 void Init(int i, const TypePtr* at);
127 129
128 public: 130 public:
129 int index() const { return _index; } 131 int index() const { return _index; }
130 const TypePtr* adr_type() const { return _adr_type; } 132 const TypePtr* adr_type() const { return _adr_type; }
131 ciField* field() const { return _field; } 133 ciField* field() const { return _field; }
134 const Type* element() const { return _element; }
132 bool is_rewritable() const { return _is_rewritable; } 135 bool is_rewritable() const { return _is_rewritable; }
133 bool is_volatile() const { return (_field ? _field->is_volatile() : false); } 136 bool is_volatile() const { return (_field ? _field->is_volatile() : false); }
134 int general_index() const { return (_general_index != 0) ? _general_index : _index; } 137 int general_index() const { return (_general_index != 0) ? _general_index : _index; }
135 138
136 void set_rewritable(bool z) { _is_rewritable = z; } 139 void set_rewritable(bool z) { _is_rewritable = z; }
137 void set_field(ciField* f) { 140 void set_field(ciField* f) {
138 assert(!_field,""); 141 assert(!_field,"");
139 _field = f; 142 _field = f;
140 if (f->is_final()) _is_rewritable = false; 143 if (f->is_final() || f->is_stable()) {
144 // In the case of @Stable, multiple writes are possible but may be assumed to be no-ops.
145 _is_rewritable = false;
146 }
147 }
148 void set_element(const Type* e) {
149 assert(_element == NULL, "");
150 _element = e;
141 } 151 }
142 152
143 void print_on(outputStream* st) PRODUCT_RETURN; 153 void print_on(outputStream* st) PRODUCT_RETURN;
144 }; 154 };
145 155
300 bool _do_freq_based_layout; // True if we intend to do frequency based block layout 310 bool _do_freq_based_layout; // True if we intend to do frequency based block layout
301 bool _do_count_invocations; // True if we generate code to count invocations 311 bool _do_count_invocations; // True if we generate code to count invocations
302 bool _do_method_data_update; // True if we generate code to update MethodData*s 312 bool _do_method_data_update; // True if we generate code to update MethodData*s
303 int _AliasLevel; // Locally-adjusted version of AliasLevel flag. 313 int _AliasLevel; // Locally-adjusted version of AliasLevel flag.
304 bool _print_assembly; // True if we should dump assembly code for this compilation 314 bool _print_assembly; // True if we should dump assembly code for this compilation
315 bool _print_inlining; // True if we should print inlining for this compilation
316 bool _print_intrinsics; // True if we should print intrinsics for this compilation
305 #ifndef PRODUCT 317 #ifndef PRODUCT
306 bool _trace_opto_output; 318 bool _trace_opto_output;
307 bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing 319 bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing
308 #endif 320 #endif
309 321
402 CallGenerator* cg() const { return _cg; } 414 CallGenerator* cg() const { return _cg; }
403 void set_cg(CallGenerator* cg) { _cg = cg; } 415 void set_cg(CallGenerator* cg) { _cg = cg; }
404 }; 416 };
405 417
406 GrowableArray<PrintInliningBuffer>* _print_inlining_list; 418 GrowableArray<PrintInliningBuffer>* _print_inlining_list;
407 int _print_inlining; 419 int _print_inlining_idx;
408 420
409 // Only keep nodes in the expensive node list that need to be optimized 421 // Only keep nodes in the expensive node list that need to be optimized
410 void cleanup_expensive_nodes(PhaseIterGVN &igvn); 422 void cleanup_expensive_nodes(PhaseIterGVN &igvn);
411 // Use for sorting expensive nodes to bring similar nodes together 423 // Use for sorting expensive nodes to bring similar nodes together
412 static int cmp_expensive_nodes(Node** n1, Node** n2); 424 static int cmp_expensive_nodes(Node** n1, Node** n2);
414 bool expensive_nodes_sorted() const; 426 bool expensive_nodes_sorted() const;
415 427
416 public: 428 public:
417 429
418 outputStream* print_inlining_stream() const { 430 outputStream* print_inlining_stream() const {
419 return _print_inlining_list->at(_print_inlining).ss(); 431 return _print_inlining_list->adr_at(_print_inlining_idx)->ss();
420 } 432 }
421 433
422 void print_inlining_skip(CallGenerator* cg) { 434 void print_inlining_skip(CallGenerator* cg) {
423 if (PrintInlining) { 435 if (_print_inlining) {
424 _print_inlining_list->at(_print_inlining).set_cg(cg); 436 _print_inlining_list->adr_at(_print_inlining_idx)->set_cg(cg);
425 _print_inlining++; 437 _print_inlining_idx++;
426 _print_inlining_list->insert_before(_print_inlining, PrintInliningBuffer()); 438 _print_inlining_list->insert_before(_print_inlining_idx, PrintInliningBuffer());
427 } 439 }
428 } 440 }
429 441
430 void print_inlining_insert(CallGenerator* cg) { 442 void print_inlining_insert(CallGenerator* cg) {
431 if (PrintInlining) { 443 if (_print_inlining) {
432 for (int i = 0; i < _print_inlining_list->length(); i++) { 444 for (int i = 0; i < _print_inlining_list->length(); i++) {
433 if (_print_inlining_list->at(i).cg() == cg) { 445 if (_print_inlining_list->adr_at(i)->cg() == cg) {
434 _print_inlining_list->insert_before(i+1, PrintInliningBuffer()); 446 _print_inlining_list->insert_before(i+1, PrintInliningBuffer());
435 _print_inlining = i+1; 447 _print_inlining_idx = i+1;
436 _print_inlining_list->at(i).set_cg(NULL); 448 _print_inlining_list->adr_at(i)->set_cg(NULL);
437 return; 449 return;
438 } 450 }
439 } 451 }
440 ShouldNotReachHere(); 452 ShouldNotReachHere();
441 } 453 }
560 bool do_method_data_update() const { return _do_method_data_update; } 572 bool do_method_data_update() const { return _do_method_data_update; }
561 void set_do_method_data_update(bool z) { _do_method_data_update = z; } 573 void set_do_method_data_update(bool z) { _do_method_data_update = z; }
562 int AliasLevel() const { return _AliasLevel; } 574 int AliasLevel() const { return _AliasLevel; }
563 bool print_assembly() const { return _print_assembly; } 575 bool print_assembly() const { return _print_assembly; }
564 void set_print_assembly(bool z) { _print_assembly = z; } 576 void set_print_assembly(bool z) { _print_assembly = z; }
577 bool print_inlining() const { return _print_inlining; }
578 void set_print_inlining(bool z) { _print_inlining = z; }
579 bool print_intrinsics() const { return _print_intrinsics; }
580 void set_print_intrinsics(bool z) { _print_intrinsics = z; }
565 // check the CompilerOracle for special behaviours for this compile 581 // check the CompilerOracle for special behaviours for this compile
566 bool method_has_option(const char * option) { 582 bool method_has_option(const char * option) {
567 return method() != NULL && method()->has_option(option); 583 return method() != NULL && method()->has_option(option);
568 } 584 }
569 #ifndef PRODUCT 585 #ifndef PRODUCT