equal
deleted
inserted
replaced
312 CompileLog* _log; // from CompilerThread |
312 CompileLog* _log; // from CompilerThread |
313 const char* _failure_reason; // for record_failure/failing pattern |
313 const char* _failure_reason; // for record_failure/failing pattern |
314 GrowableArray<CallGenerator*>* _intrinsics; // List of intrinsics. |
314 GrowableArray<CallGenerator*>* _intrinsics; // List of intrinsics. |
315 GrowableArray<Node*>* _macro_nodes; // List of nodes which need to be expanded before matching. |
315 GrowableArray<Node*>* _macro_nodes; // List of nodes which need to be expanded before matching. |
316 GrowableArray<Node*>* _predicate_opaqs; // List of Opaque1 nodes for the loop predicates. |
316 GrowableArray<Node*>* _predicate_opaqs; // List of Opaque1 nodes for the loop predicates. |
|
317 GrowableArray<Node*>* _expensive_nodes; // List of nodes that are expensive to compute and that we'd better not let the GVN freely common |
317 ConnectionGraph* _congraph; |
318 ConnectionGraph* _congraph; |
318 #ifndef PRODUCT |
319 #ifndef PRODUCT |
319 IdealGraphPrinter* _printer; |
320 IdealGraphPrinter* _printer; |
320 #endif |
321 #endif |
321 |
322 |
395 void set_cg(CallGenerator* cg) { _cg = cg; } |
396 void set_cg(CallGenerator* cg) { _cg = cg; } |
396 }; |
397 }; |
397 |
398 |
398 GrowableArray<PrintInliningBuffer>* _print_inlining_list; |
399 GrowableArray<PrintInliningBuffer>* _print_inlining_list; |
399 int _print_inlining; |
400 int _print_inlining; |
|
401 |
|
402 // Only keep nodes in the expensive node list that need to be optimized |
|
403 void cleanup_expensive_nodes(PhaseIterGVN &igvn); |
|
404 // Use for sorting expensive nodes to bring similar nodes together |
|
405 static int cmp_expensive_nodes(Node** n1, Node** n2); |
|
406 // Expensive nodes list already sorted? |
|
407 bool expensive_nodes_sorted() const; |
400 |
408 |
401 public: |
409 public: |
402 |
410 |
403 outputStream* print_inlining_stream() const { |
411 outputStream* print_inlining_stream() const { |
404 return _print_inlining_list->at(_print_inlining).ss(); |
412 return _print_inlining_list->at(_print_inlining).ss(); |
571 #endif |
579 #endif |
572 } |
580 } |
573 |
581 |
574 int macro_count() { return _macro_nodes->length(); } |
582 int macro_count() { return _macro_nodes->length(); } |
575 int predicate_count() { return _predicate_opaqs->length();} |
583 int predicate_count() { return _predicate_opaqs->length();} |
|
584 int expensive_count() { return _expensive_nodes->length(); } |
576 Node* macro_node(int idx) { return _macro_nodes->at(idx); } |
585 Node* macro_node(int idx) { return _macro_nodes->at(idx); } |
577 Node* predicate_opaque1_node(int idx) { return _predicate_opaqs->at(idx);} |
586 Node* predicate_opaque1_node(int idx) { return _predicate_opaqs->at(idx);} |
|
587 Node* expensive_node(int idx) { return _expensive_nodes->at(idx); } |
578 ConnectionGraph* congraph() { return _congraph;} |
588 ConnectionGraph* congraph() { return _congraph;} |
579 void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;} |
589 void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;} |
580 void add_macro_node(Node * n) { |
590 void add_macro_node(Node * n) { |
581 //assert(n->is_macro(), "must be a macro node"); |
591 //assert(n->is_macro(), "must be a macro node"); |
582 assert(!_macro_nodes->contains(n), " duplicate entry in expand list"); |
592 assert(!_macro_nodes->contains(n), " duplicate entry in expand list"); |
590 // remove from _predicate_opaqs list also if it is there |
600 // remove from _predicate_opaqs list also if it is there |
591 if (predicate_count() > 0 && _predicate_opaqs->contains(n)){ |
601 if (predicate_count() > 0 && _predicate_opaqs->contains(n)){ |
592 _predicate_opaqs->remove(n); |
602 _predicate_opaqs->remove(n); |
593 } |
603 } |
594 } |
604 } |
|
605 void add_expensive_node(Node * n); |
|
606 void remove_expensive_node(Node * n) { |
|
607 if (_expensive_nodes->contains(n)) { |
|
608 _expensive_nodes->remove(n); |
|
609 } |
|
610 } |
595 void add_predicate_opaq(Node * n) { |
611 void add_predicate_opaq(Node * n) { |
596 assert(!_predicate_opaqs->contains(n), " duplicate entry in predicate opaque1"); |
612 assert(!_predicate_opaqs->contains(n), " duplicate entry in predicate opaque1"); |
597 assert(_macro_nodes->contains(n), "should have already been in macro list"); |
613 assert(_macro_nodes->contains(n), "should have already been in macro list"); |
598 _predicate_opaqs->append(n); |
614 _predicate_opaqs->append(n); |
599 } |
615 } |
601 // uncommon traps will be eliminated from the graph. |
617 // uncommon traps will be eliminated from the graph. |
602 void cleanup_loop_predicates(PhaseIterGVN &igvn); |
618 void cleanup_loop_predicates(PhaseIterGVN &igvn); |
603 bool is_predicate_opaq(Node * n) { |
619 bool is_predicate_opaq(Node * n) { |
604 return _predicate_opaqs->contains(n); |
620 return _predicate_opaqs->contains(n); |
605 } |
621 } |
|
622 |
|
623 // Are there candidate expensive nodes for optimization? |
|
624 bool should_optimize_expensive_nodes(PhaseIterGVN &igvn); |
|
625 // Check whether n1 and n2 are similar |
|
626 static int cmp_expensive_nodes(Node* n1, Node* n2); |
|
627 // Sort expensive nodes to locate similar expensive nodes |
|
628 void sort_expensive_nodes(); |
606 |
629 |
607 // Compilation environment. |
630 // Compilation environment. |
608 Arena* comp_arena() { return &_comp_arena; } |
631 Arena* comp_arena() { return &_comp_arena; } |
609 ciEnv* env() const { return _env; } |
632 ciEnv* env() const { return _env; } |
610 CompileLog* log() const { return _log; } |
633 CompileLog* log() const { return _log; } |