--- old/src/share/vm/opto/graphKit.hpp 2017-04-25 16:45:33.207173165 +0200 +++ new/src/share/vm/opto/graphKit.hpp 2017-04-25 16:45:33.059173170 +0200 @@ -27,6 +27,7 @@ #include "ci/ciEnv.hpp" #include "ci/ciMethodData.hpp" +#include "gc/shared/c2BarrierSetCodeGen.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" @@ -103,9 +104,6 @@ Node* zerocon(BasicType bt) const { return _gvn.zerocon(bt); } // (See also macro MakeConX in type.hpp, which uses intcon or longcon.) - // Helper for byte_map_base - Node* byte_map_base_node(); - jint find_int_con(Node* n, jint value_if_unknown) { return _gvn.find_int_con(n, value_if_unknown); } @@ -566,70 +564,67 @@ bool unaligned = false, bool mismatched = false); + // Perform decorated accesses - // All in one pre-barrier, store, post_barrier - // Insert a write-barrier'd store. This is to let generational GC - // work; we have to flag all oop-stores before the next GC point. - // - // It comes in 3 flavors of store to an object, array, or unknown. - // We use precise card marks for arrays to avoid scanning the entire - // array. We use imprecise for object. We use precise for unknown - // since we don't know if we have an array or and object or even - // where the object starts. - // - // If val==NULL, it is taken to be a completely unknown value. QQQ - - Node* store_oop(Node* ctl, - Node* obj, // containing obj - Node* adr, // actual adress to store val at - const TypePtr* adr_type, - Node* val, - const TypeOopPtr* val_type, - BasicType bt, - bool use_precise, - MemNode::MemOrd mo, - bool mismatched = false); - - Node* store_oop_to_object(Node* ctl, - Node* obj, // containing obj - Node* adr, // actual adress to store val at - const TypePtr* adr_type, - Node* val, - const TypeOopPtr* val_type, - BasicType bt, - MemNode::MemOrd mo) { - return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, false, mo); - } - - Node* store_oop_to_array(Node* ctl, - Node* obj, // containing obj - Node* adr, // actual adress to store val at + Node* access_store_at(Node* ctl, + Node* obj, // containing obj + Node* adr, // actual adress to store val at + const TypePtr* adr_type, + Node* val, + const Type* val_type, + BasicType bt, + C2DecoratorSet decorators); + + Node* access_load_at(Node* obj, // containing obj + Node* adr, // actual adress to store val at + const TypePtr* adr_type, + const Type* val_type, + BasicType bt, + C2DecoratorSet decorators); + + Node* access_cas_val_at(Node* ctl, + Node* obj, + Node* adr, + const TypePtr* adr_type, + int alias_idx, + Node* expected_val, + Node* new_val, + const Type* value_type, + BasicType bt, + C2DecoratorSet decorators); + + Node* access_cas_bool_at(Node* ctl, + Node* obj, + Node* adr, const TypePtr* adr_type, - Node* val, - const TypeOopPtr* val_type, + int alias_idx, + Node* expected_val, + Node* new_val, + const Type* value_type, BasicType bt, - MemNode::MemOrd mo) { - return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true, mo); - } + C2DecoratorSet decorators); - // Could be an array or object we don't know at compile time (unsafe ref.) - Node* store_oop_to_unknown(Node* ctl, - Node* obj, // containing obj - Node* adr, // actual adress to store val at - const TypePtr* adr_type, - Node* val, - BasicType bt, - MemNode::MemOrd mo, - bool mismatched = false); - - // For the few case where the barriers need special help - void pre_barrier(bool do_load, Node* ctl, - Node* obj, Node* adr, uint adr_idx, Node* val, const TypeOopPtr* val_type, - Node* pre_val, - BasicType bt); + Node* access_swap_at(Node* ctl, + Node* obj, + Node* adr, + const TypePtr* adr_type, + int alias_idx, + Node* new_val, + const Type* value_type, + BasicType bt, + C2DecoratorSet decorators); + + Node* access_fetch_and_add_at(Node* ctl, + Node* obj, + Node* adr, + const TypePtr* adr_type, + int alias_idx, + Node* new_val, + const Type* value_type, + BasicType bt, + C2DecoratorSet decorators); - void post_barrier(Node* ctl, Node* store, Node* obj, Node* adr, uint adr_idx, - Node* val, BasicType bt, bool use_precise); + void access_clone(Node* ctl, Node* src, Node* dst, Node* size, bool is_array); // Return addressing for an array element. Node* array_element_address(Node* ary, Node* idx, BasicType elembt, @@ -751,50 +746,10 @@ // Returns the object (if any) which was created the moment before. Node* just_allocated_object(Node* current_control); - static bool use_ReduceInitialCardMarks() { - return (ReduceInitialCardMarks - && Universe::heap()->can_elide_tlab_store_barriers()); - } - // Sync Ideal and Graph kits. void sync_kit(IdealKit& ideal); void final_sync(IdealKit& ideal); - // vanilla/CMS post barrier - void write_barrier_post(Node *store, Node* obj, - Node* adr, uint adr_idx, Node* val, bool use_precise); - - // Allow reordering of pre-barrier with oop store and/or post-barrier. - // Used for load_store operations which loads old value. - bool can_move_pre_barrier() const; - - // G1 pre/post barriers - void g1_write_barrier_pre(bool do_load, - Node* obj, - Node* adr, - uint alias_idx, - Node* val, - const TypeOopPtr* val_type, - Node* pre_val, - BasicType bt); - - void g1_write_barrier_post(Node* store, - Node* obj, - Node* adr, - uint alias_idx, - Node* val, - BasicType bt, - bool use_precise); - // Helper function for g1 - private: - void g1_mark_card(IdealKit& ideal, Node* card_adr, Node* store, uint oop_alias_idx, - Node* index, Node* index_adr, - Node* buffer, const TypeFunc* tf); - - bool g1_can_remove_pre_barrier(PhaseTransform* phase, Node* adr, BasicType bt, uint adr_idx); - - bool g1_can_remove_post_barrier(PhaseTransform* phase, Node* store, Node* adr); - public: // Helper function to round double arguments before a call void round_double_arguments(ciMethod* dest_method);