< prev index next >

src/share/vm/opto/type.cpp

Print this page

        

@@ -1926,50 +1926,17 @@
       field_array[pos++] = Type::HALF;
     }
   }
 }
 
-// Can a value type instance of this type be returned as multiple
-// returned values?
-static bool vt_can_be_returned_as_fields(ciValueKlass* vk) {
-  if (vk == ciEnv::current()->___Value_klass()) {
-    return false;
-  }
-
-  ResourceMark rm;
-  uint args = vk->value_arg_slots() + 1 /* return vk as well */;
-
-  BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, args);
-  VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, args);
-
-  sig_bt[0] = T_METADATA;
-  for (uint i = 0, j = 1; i < (uint)vk->nof_nonstatic_fields(); i++) {
-    BasicType bt = vk->nonstatic_field_at(i)->layout_type();
-    assert(i+j < args, "out of bounds access");
-    sig_bt[i+j] = bt;
-    if (bt == T_LONG || bt == T_DOUBLE) {
-      j++;
-      assert(i+j < args, "out of bounds access");
-      sig_bt[i+j] = T_VOID;
-    }
-  }
-
-  if (SharedRuntime::java_return_convention(sig_bt, regs, args) <= 0) {
-    return false;
-  }
-
-  return true;
-}
-
-
 //------------------------------make-------------------------------------------
 // Make a TypeTuple from the range of a method signature
 const TypeTuple *TypeTuple::make_range(ciSignature* sig, bool ret_vt_fields) {
   ciType* return_type = sig->return_type();
   uint arg_cnt = 0;
   if (ret_vt_fields) {
-    ret_vt_fields = return_type->is_valuetype() && vt_can_be_returned_as_fields((ciValueKlass*)return_type);
+    ret_vt_fields = return_type->is_valuetype() && ((ciValueKlass*)return_type)->can_be_returned_as_fields();
   }
   if (ret_vt_fields) {
     ciValueKlass* vk = (ciValueKlass*)return_type;
     arg_cnt = vk->value_arg_slots()+1;
   } else {
< prev index next >