567 MemNode::MemOrd, |
568 MemNode::MemOrd, |
568 bool require_atomic_access = false, |
569 bool require_atomic_access = false, |
569 bool unaligned = false, |
570 bool unaligned = false, |
570 bool mismatched = false); |
571 bool mismatched = false); |
571 |
572 |
572 |
573 // Perform decorated accesses |
573 // All in one pre-barrier, store, post_barrier |
574 |
574 // Insert a write-barrier'd store. This is to let generational GC |
575 Node* access_store_at(Node* ctl, |
575 // work; we have to flag all oop-stores before the next GC point. |
576 Node* obj, // containing obj |
576 // |
577 Node* adr, // actual adress to store val at |
577 // It comes in 3 flavors of store to an object, array, or unknown. |
578 const TypePtr* adr_type, |
578 // We use precise card marks for arrays to avoid scanning the entire |
579 Node* val, |
579 // array. We use imprecise for object. We use precise for unknown |
580 const Type* val_type, |
580 // since we don't know if we have an array or and object or even |
581 BasicType bt, |
581 // where the object starts. |
582 DecoratorSet decorators); |
582 // |
583 |
583 // If val==NULL, it is taken to be a completely unknown value. QQQ |
584 Node* access_load_at(Node* obj, // containing obj |
584 |
585 Node* adr, // actual adress to store val at |
585 Node* store_oop(Node* ctl, |
586 const TypePtr* adr_type, |
586 Node* obj, // containing obj |
587 const Type* val_type, |
587 Node* adr, // actual adress to store val at |
588 BasicType bt, |
588 const TypePtr* adr_type, |
589 DecoratorSet decorators); |
589 Node* val, |
590 |
590 const TypeOopPtr* val_type, |
591 Node* access_atomic_cmpxchg_val_at(Node* ctl, |
591 BasicType bt, |
592 Node* obj, |
592 bool use_precise, |
593 Node* adr, |
593 MemNode::MemOrd mo, |
594 const TypePtr* adr_type, |
594 bool mismatched = false); |
595 int alias_idx, |
595 |
596 Node* expected_val, |
596 Node* store_oop_to_object(Node* ctl, |
597 Node* new_val, |
597 Node* obj, // containing obj |
598 const Type* value_type, |
598 Node* adr, // actual adress to store val at |
599 BasicType bt, |
599 const TypePtr* adr_type, |
600 DecoratorSet decorators); |
600 Node* val, |
601 |
601 const TypeOopPtr* val_type, |
602 Node* access_atomic_cmpxchg_bool_at(Node* ctl, |
602 BasicType bt, |
603 Node* obj, |
603 MemNode::MemOrd mo) { |
604 Node* adr, |
604 return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, false, mo); |
605 const TypePtr* adr_type, |
605 } |
606 int alias_idx, |
606 |
607 Node* expected_val, |
607 Node* store_oop_to_array(Node* ctl, |
608 Node* new_val, |
608 Node* obj, // containing obj |
609 const Type* value_type, |
609 Node* adr, // actual adress to store val at |
610 BasicType bt, |
610 const TypePtr* adr_type, |
611 DecoratorSet decorators); |
611 Node* val, |
612 |
612 const TypeOopPtr* val_type, |
613 Node* access_atomic_xchg_at(Node* ctl, |
613 BasicType bt, |
614 Node* obj, |
614 MemNode::MemOrd mo) { |
615 Node* adr, |
615 return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true, mo); |
616 const TypePtr* adr_type, |
616 } |
617 int alias_idx, |
617 |
618 Node* new_val, |
618 // Could be an array or object we don't know at compile time (unsafe ref.) |
619 const Type* value_type, |
619 Node* store_oop_to_unknown(Node* ctl, |
620 BasicType bt, |
620 Node* obj, // containing obj |
621 DecoratorSet decorators); |
621 Node* adr, // actual adress to store val at |
622 |
|
623 Node* access_atomic_add_at(Node* ctl, |
|
624 Node* obj, |
|
625 Node* adr, |
622 const TypePtr* adr_type, |
626 const TypePtr* adr_type, |
623 Node* val, |
627 int alias_idx, |
|
628 Node* new_val, |
|
629 const Type* value_type, |
624 BasicType bt, |
630 BasicType bt, |
625 MemNode::MemOrd mo, |
631 DecoratorSet decorators); |
626 bool mismatched = false); |
632 |
627 |
633 void access_clone(Node* ctl, Node* src, Node* dst, Node* size, bool is_array); |
628 // For the few case where the barriers need special help |
|
629 void pre_barrier(bool do_load, Node* ctl, |
|
630 Node* obj, Node* adr, uint adr_idx, Node* val, const TypeOopPtr* val_type, |
|
631 Node* pre_val, |
|
632 BasicType bt); |
|
633 |
|
634 void post_barrier(Node* ctl, Node* store, Node* obj, Node* adr, uint adr_idx, |
|
635 Node* val, BasicType bt, bool use_precise); |
|
636 |
634 |
637 // Return addressing for an array element. |
635 // Return addressing for an array element. |
638 Node* array_element_address(Node* ary, Node* idx, BasicType elembt, |
636 Node* array_element_address(Node* ary, Node* idx, BasicType elembt, |
639 // Optional constraint on the array size: |
637 // Optional constraint on the array size: |
640 const TypeInt* sizetype = NULL, |
638 const TypeInt* sizetype = NULL, |
752 } |
750 } |
753 |
751 |
754 // Returns the object (if any) which was created the moment before. |
752 // Returns the object (if any) which was created the moment before. |
755 Node* just_allocated_object(Node* current_control); |
753 Node* just_allocated_object(Node* current_control); |
756 |
754 |
757 static bool use_ReduceInitialCardMarks(); |
|
758 |
|
759 // Sync Ideal and Graph kits. |
755 // Sync Ideal and Graph kits. |
760 void sync_kit(IdealKit& ideal); |
756 void sync_kit(IdealKit& ideal); |
761 void final_sync(IdealKit& ideal); |
757 void final_sync(IdealKit& ideal); |
762 |
|
763 // vanilla/CMS post barrier |
|
764 void write_barrier_post(Node *store, Node* obj, |
|
765 Node* adr, uint adr_idx, Node* val, bool use_precise); |
|
766 |
|
767 // Allow reordering of pre-barrier with oop store and/or post-barrier. |
|
768 // Used for load_store operations which loads old value. |
|
769 bool can_move_pre_barrier() const; |
|
770 |
|
771 #if INCLUDE_G1GC |
|
772 // G1 pre/post barriers |
|
773 void g1_write_barrier_pre(bool do_load, |
|
774 Node* obj, |
|
775 Node* adr, |
|
776 uint alias_idx, |
|
777 Node* val, |
|
778 const TypeOopPtr* val_type, |
|
779 Node* pre_val, |
|
780 BasicType bt); |
|
781 |
|
782 void g1_write_barrier_post(Node* store, |
|
783 Node* obj, |
|
784 Node* adr, |
|
785 uint alias_idx, |
|
786 Node* val, |
|
787 BasicType bt, |
|
788 bool use_precise); |
|
789 // Helper function for g1 |
|
790 private: |
|
791 void g1_mark_card(IdealKit& ideal, Node* card_adr, Node* store, uint oop_alias_idx, |
|
792 Node* index, Node* index_adr, |
|
793 Node* buffer, const TypeFunc* tf); |
|
794 |
|
795 bool g1_can_remove_pre_barrier(PhaseTransform* phase, Node* adr, BasicType bt, uint adr_idx); |
|
796 |
|
797 bool g1_can_remove_post_barrier(PhaseTransform* phase, Node* store, Node* adr); |
|
798 #endif // INCLUDE_G1GC |
|
799 |
758 |
800 public: |
759 public: |
801 // Helper function to round double arguments before a call |
760 // Helper function to round double arguments before a call |
802 void round_double_arguments(ciMethod* dest_method); |
761 void round_double_arguments(ciMethod* dest_method); |
803 void round_double_result(ciMethod* dest_method); |
762 void round_double_result(ciMethod* dest_method); |