Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/compile.hpp @ 12295:1b64d46620a3
8022585: VM crashes when ran with -XX:+PrintInlining
Summary: use adr_at() to access inline info structures in growableArray. Add ability to specify print inlining per method.
Reviewed-by: twisti
author | kvn |
---|---|
date | Tue, 24 Sep 2013 16:08:00 -0700 |
parents | edb5ab0f3fe5 |
children | 3213ba4d3dff |
comparison
equal
deleted
inserted
replaced
12294:891687731b59 | 12295:1b64d46620a3 |
---|---|
310 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 |
311 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 |
312 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 |
313 int _AliasLevel; // Locally-adjusted version of AliasLevel flag. | 313 int _AliasLevel; // Locally-adjusted version of AliasLevel flag. |
314 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 | |
315 #ifndef PRODUCT | 317 #ifndef PRODUCT |
316 bool _trace_opto_output; | 318 bool _trace_opto_output; |
317 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 |
318 #endif | 320 #endif |
319 | 321 |
412 CallGenerator* cg() const { return _cg; } | 414 CallGenerator* cg() const { return _cg; } |
413 void set_cg(CallGenerator* cg) { _cg = cg; } | 415 void set_cg(CallGenerator* cg) { _cg = cg; } |
414 }; | 416 }; |
415 | 417 |
416 GrowableArray<PrintInliningBuffer>* _print_inlining_list; | 418 GrowableArray<PrintInliningBuffer>* _print_inlining_list; |
417 int _print_inlining; | 419 int _print_inlining_idx; |
418 | 420 |
419 // 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 |
420 void cleanup_expensive_nodes(PhaseIterGVN &igvn); | 422 void cleanup_expensive_nodes(PhaseIterGVN &igvn); |
421 // Use for sorting expensive nodes to bring similar nodes together | 423 // Use for sorting expensive nodes to bring similar nodes together |
422 static int cmp_expensive_nodes(Node** n1, Node** n2); | 424 static int cmp_expensive_nodes(Node** n1, Node** n2); |
424 bool expensive_nodes_sorted() const; | 426 bool expensive_nodes_sorted() const; |
425 | 427 |
426 public: | 428 public: |
427 | 429 |
428 outputStream* print_inlining_stream() const { | 430 outputStream* print_inlining_stream() const { |
429 return _print_inlining_list->at(_print_inlining).ss(); | 431 return _print_inlining_list->adr_at(_print_inlining_idx)->ss(); |
430 } | 432 } |
431 | 433 |
432 void print_inlining_skip(CallGenerator* cg) { | 434 void print_inlining_skip(CallGenerator* cg) { |
433 if (PrintInlining) { | 435 if (_print_inlining) { |
434 _print_inlining_list->at(_print_inlining).set_cg(cg); | 436 _print_inlining_list->adr_at(_print_inlining_idx)->set_cg(cg); |
435 _print_inlining++; | 437 _print_inlining_idx++; |
436 _print_inlining_list->insert_before(_print_inlining, PrintInliningBuffer()); | 438 _print_inlining_list->insert_before(_print_inlining_idx, PrintInliningBuffer()); |
437 } | 439 } |
438 } | 440 } |
439 | 441 |
440 void print_inlining_insert(CallGenerator* cg) { | 442 void print_inlining_insert(CallGenerator* cg) { |
441 if (PrintInlining) { | 443 if (_print_inlining) { |
442 for (int i = 0; i < _print_inlining_list->length(); i++) { | 444 for (int i = 0; i < _print_inlining_list->length(); i++) { |
443 if (_print_inlining_list->at(i).cg() == cg) { | 445 if (_print_inlining_list->adr_at(i)->cg() == cg) { |
444 _print_inlining_list->insert_before(i+1, PrintInliningBuffer()); | 446 _print_inlining_list->insert_before(i+1, PrintInliningBuffer()); |
445 _print_inlining = i+1; | 447 _print_inlining_idx = i+1; |
446 _print_inlining_list->at(i).set_cg(NULL); | 448 _print_inlining_list->adr_at(i)->set_cg(NULL); |
447 return; | 449 return; |
448 } | 450 } |
449 } | 451 } |
450 ShouldNotReachHere(); | 452 ShouldNotReachHere(); |
451 } | 453 } |
570 bool do_method_data_update() const { return _do_method_data_update; } | 572 bool do_method_data_update() const { return _do_method_data_update; } |
571 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; } |
572 int AliasLevel() const { return _AliasLevel; } | 574 int AliasLevel() const { return _AliasLevel; } |
573 bool print_assembly() const { return _print_assembly; } | 575 bool print_assembly() const { return _print_assembly; } |
574 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; } | |
575 // check the CompilerOracle for special behaviours for this compile | 581 // check the CompilerOracle for special behaviours for this compile |
576 bool method_has_option(const char * option) { | 582 bool method_has_option(const char * option) { |
577 return method() != NULL && method()->has_option(option); | 583 return method() != NULL && method()->has_option(option); |
578 } | 584 } |
579 #ifndef PRODUCT | 585 #ifndef PRODUCT |