919 if (n->Opcode() == Op_AddP && ShenandoahBarrierSetC2::has_only_shenandoah_wb_pre_uses(n)) {
920 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
921 C->record_for_igvn(n->fast_out(i));
922 }
923 }
924 }
925 for (int i = state()->enqueue_barriers_count() - 1; i >= 0; i--) {
926 ShenandoahEnqueueBarrierNode* n = state()->enqueue_barrier(i);
927 if (!useful.member(n)) {
928 state()->remove_enqueue_barrier(n);
929 }
930 }
931 for (int i = state()->load_reference_barriers_count() - 1; i >= 0; i--) {
932 ShenandoahLoadReferenceBarrierNode* n = state()->load_reference_barrier(i);
933 if (!useful.member(n)) {
934 state()->remove_load_reference_barrier(n);
935 }
936 }
937 }
938
939 void ShenandoahBarrierSetC2::add_users_to_worklist(Unique_Node_List* worklist) const {}
940
941 void* ShenandoahBarrierSetC2::create_barrier_state(Arena* comp_arena) const {
942 return new(comp_arena) ShenandoahBarrierSetC2State(comp_arena);
943 }
944
945 ShenandoahBarrierSetC2State* ShenandoahBarrierSetC2::state() const {
946 return reinterpret_cast<ShenandoahBarrierSetC2State*>(Compile::current()->barrier_set_state());
947 }
948
949 // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be
950 // expanded later, then now is the time to do so.
951 bool ShenandoahBarrierSetC2::expand_macro_nodes(PhaseMacroExpand* macro) const { return false; }
952
953 #ifdef ASSERT
954 void ShenandoahBarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase phase) const {
955 if (ShenandoahVerifyOptoBarriers && phase == BarrierSetC2::BeforeExpand) {
956 ShenandoahBarrierC2Support::verify(Compile::current()->root());
957 } else if (phase == BarrierSetC2::BeforeCodeGen) {
958 // Verify G1 pre-barriers
959 const int marking_offset = in_bytes(ShenandoahThreadLocalData::satb_mark_queue_active_offset());
960
961 ResourceArea *area = Thread::current()->resource_area();
962 Unique_Node_List visited(area);
963 Node_List worklist(area);
964 // We're going to walk control flow backwards starting from the Root
965 worklist.push(compile->root());
966 while (worklist.size() > 0) {
967 Node *x = worklist.pop();
968 if (x == NULL || x == compile->top()) continue;
969 if (visited.member(x)) {
970 continue;
971 } else {
972 visited.push(x);
973 }
974
975 if (x->is_Region()) {
|
919 if (n->Opcode() == Op_AddP && ShenandoahBarrierSetC2::has_only_shenandoah_wb_pre_uses(n)) {
920 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
921 C->record_for_igvn(n->fast_out(i));
922 }
923 }
924 }
925 for (int i = state()->enqueue_barriers_count() - 1; i >= 0; i--) {
926 ShenandoahEnqueueBarrierNode* n = state()->enqueue_barrier(i);
927 if (!useful.member(n)) {
928 state()->remove_enqueue_barrier(n);
929 }
930 }
931 for (int i = state()->load_reference_barriers_count() - 1; i >= 0; i--) {
932 ShenandoahLoadReferenceBarrierNode* n = state()->load_reference_barrier(i);
933 if (!useful.member(n)) {
934 state()->remove_load_reference_barrier(n);
935 }
936 }
937 }
938
939 void* ShenandoahBarrierSetC2::create_barrier_state(Arena* comp_arena) const {
940 return new(comp_arena) ShenandoahBarrierSetC2State(comp_arena);
941 }
942
943 ShenandoahBarrierSetC2State* ShenandoahBarrierSetC2::state() const {
944 return reinterpret_cast<ShenandoahBarrierSetC2State*>(Compile::current()->barrier_set_state());
945 }
946
947 // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be
948 // expanded later, then now is the time to do so.
949 bool ShenandoahBarrierSetC2::expand_macro_nodes(PhaseMacroExpand* macro) const { return false; }
950
951 #ifdef ASSERT
952 void ShenandoahBarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase phase) const {
953 if (ShenandoahVerifyOptoBarriers && phase == BarrierSetC2::BeforeMacroExpand) {
954 ShenandoahBarrierC2Support::verify(Compile::current()->root());
955 } else if (phase == BarrierSetC2::BeforeCodeGen) {
956 // Verify G1 pre-barriers
957 const int marking_offset = in_bytes(ShenandoahThreadLocalData::satb_mark_queue_active_offset());
958
959 ResourceArea *area = Thread::current()->resource_area();
960 Unique_Node_List visited(area);
961 Node_List worklist(area);
962 // We're going to walk control flow backwards starting from the Root
963 worklist.push(compile->root());
964 while (worklist.size() > 0) {
965 Node *x = worklist.pop();
966 if (x == NULL || x == compile->top()) continue;
967 if (visited.member(x)) {
968 continue;
969 } else {
970 visited.push(x);
971 }
972
973 if (x->is_Region()) {
|