3752 //
3753 // Like generate_guard, adds a new path onto the region.
3754 jint layout_con = 0;
3755 Node* layout_val = get_layout_helper(kls, layout_con);
3756 if (layout_val == NULL) {
3757 bool query = (obj_array
3758 ? Klass::layout_helper_is_objArray(layout_con)
3759 : Klass::layout_helper_is_array(layout_con));
3760 if (query == not_array) {
3761 return NULL; // never a branch
3762 } else { // always a branch
3763 Node* always_branch = control();
3764 if (region != NULL)
3765 region->add_req(always_branch);
3766 set_control(top());
3767 return always_branch;
3768 }
3769 }
3770 // Now test the correct condition.
3771 jint nval = (obj_array
3772 ? ((jint)Klass::_lh_array_tag_type_value
3773 << Klass::_lh_array_tag_shift)
3774 : Klass::_lh_neutral_value);
3775 Node* cmp = _gvn.transform(new CmpINode(layout_val, intcon(nval)));
3776 BoolTest::mask btest = BoolTest::lt; // correct for testing is_[obj]array
3777 // invert the test if we are looking for a non-array
3778 if (not_array) btest = BoolTest(btest).negate();
3779 Node* bol = _gvn.transform(new BoolNode(cmp, btest));
3780 return generate_fair_guard(bol, region);
3781 }
3782
3783
3784 //-----------------------inline_native_newArray--------------------------
3785 // private static native Object java.lang.reflect.newArray(Class<?> componentType, int length);
3786 // private native Object Unsafe.allocateUninitializedArray0(Class<?> cls, int size);
3787 bool LibraryCallKit::inline_unsafe_newArray(bool uninitialized) {
3788 Node* mirror;
3789 Node* count_val;
3790 if (uninitialized) {
3791 mirror = argument(1);
3792 count_val = argument(2);
|
3752 //
3753 // Like generate_guard, adds a new path onto the region.
3754 jint layout_con = 0;
3755 Node* layout_val = get_layout_helper(kls, layout_con);
3756 if (layout_val == NULL) {
3757 bool query = (obj_array
3758 ? Klass::layout_helper_is_objArray(layout_con)
3759 : Klass::layout_helper_is_array(layout_con));
3760 if (query == not_array) {
3761 return NULL; // never a branch
3762 } else { // always a branch
3763 Node* always_branch = control();
3764 if (region != NULL)
3765 region->add_req(always_branch);
3766 set_control(top());
3767 return always_branch;
3768 }
3769 }
3770 // Now test the correct condition.
3771 jint nval = (obj_array
3772 ? (jint)(Klass::_lh_array_tag_type_value
3773 << Klass::_lh_array_tag_shift)
3774 : Klass::_lh_neutral_value);
3775 Node* cmp = _gvn.transform(new CmpINode(layout_val, intcon(nval)));
3776 BoolTest::mask btest = BoolTest::lt; // correct for testing is_[obj]array
3777 // invert the test if we are looking for a non-array
3778 if (not_array) btest = BoolTest(btest).negate();
3779 Node* bol = _gvn.transform(new BoolNode(cmp, btest));
3780 return generate_fair_guard(bol, region);
3781 }
3782
3783
3784 //-----------------------inline_native_newArray--------------------------
3785 // private static native Object java.lang.reflect.newArray(Class<?> componentType, int length);
3786 // private native Object Unsafe.allocateUninitializedArray0(Class<?> cls, int size);
3787 bool LibraryCallKit::inline_unsafe_newArray(bool uninitialized) {
3788 Node* mirror;
3789 Node* count_val;
3790 if (uninitialized) {
3791 mirror = argument(1);
3792 count_val = argument(2);
|