src/share/vm/opto/library_call.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File webrev Sdiff src/share/vm/opto

src/share/vm/opto/library_call.cpp

Print this page




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




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


src/share/vm/opto/library_call.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File