3887
3888 if (x->is_Region()) {
3889 for (uint i = 1; i < x->req(); i++) {
3890 worklist.push(x->in(i));
3891 }
3892 } else {
3893 worklist.push(x->in(0));
3894 // We are looking for the pattern:
3895 // /->ThreadLocal
3896 // If->Bool->CmpI->LoadB->AddP->ConL(marking_offset)
3897 // \->ConI(0)
3898 // We want to verify that the If and the LoadB have the same control
3899 // See GraphKit::g1_write_barrier_pre()
3900 if (x->is_If()) {
3901 IfNode *iff = x->as_If();
3902 if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) {
3903 CmpNode *cmp = iff->in(1)->in(1)->as_Cmp();
3904 if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0
3905 && cmp->in(1)->is_Load()) {
3906 LoadNode* load = cmp->in(1)->as_Load();
3907 if (load->is_g1_marking_load()) {
3908
3909 Node* if_ctrl = iff->in(0);
3910 Node* load_ctrl = load->in(0);
3911
3912 if (if_ctrl != load_ctrl) {
3913 // Skip possible CProj->NeverBranch in infinite loops
3914 if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj)
3915 && (if_ctrl->in(0)->is_MultiBranch() && if_ctrl->in(0)->Opcode() == Op_NeverBranch)) {
3916 if_ctrl = if_ctrl->in(0)->in(0);
3917 }
3918 }
3919 assert(load_ctrl != NULL && if_ctrl == load_ctrl, "controls must match");
3920 }
3921 }
3922 }
3923 }
3924 }
3925 }
3926 }
3927 #endif
|
3887
3888 if (x->is_Region()) {
3889 for (uint i = 1; i < x->req(); i++) {
3890 worklist.push(x->in(i));
3891 }
3892 } else {
3893 worklist.push(x->in(0));
3894 // We are looking for the pattern:
3895 // /->ThreadLocal
3896 // If->Bool->CmpI->LoadB->AddP->ConL(marking_offset)
3897 // \->ConI(0)
3898 // We want to verify that the If and the LoadB have the same control
3899 // See GraphKit::g1_write_barrier_pre()
3900 if (x->is_If()) {
3901 IfNode *iff = x->as_If();
3902 if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) {
3903 CmpNode *cmp = iff->in(1)->in(1)->as_Cmp();
3904 if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0
3905 && cmp->in(1)->is_Load()) {
3906 LoadNode* load = cmp->in(1)->as_Load();
3907 if (load->Opcode() == Op_LoadB && load->in(2)->is_AddP() && load->in(2)->in(2)->Opcode() == Op_ThreadLocal
3908 && load->in(2)->in(3)->is_Con()
3909 && load->in(2)->in(3)->bottom_type()->is_intptr_t()->get_con() == marking_offset) {
3910
3911 Node* if_ctrl = iff->in(0);
3912 Node* load_ctrl = load->in(0);
3913
3914 if (if_ctrl != load_ctrl) {
3915 // Skip possible CProj->NeverBranch in infinite loops
3916 if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj)
3917 && (if_ctrl->in(0)->is_MultiBranch() && if_ctrl->in(0)->Opcode() == Op_NeverBranch)) {
3918 if_ctrl = if_ctrl->in(0)->in(0);
3919 }
3920 }
3921 assert(load_ctrl != NULL && if_ctrl == load_ctrl, "controls must match");
3922 }
3923 }
3924 }
3925 }
3926 }
3927 }
3928 }
3929 #endif
|