< prev index next >

src/hotspot/share/oops/method.cpp

Print this page

        

@@ -1106,10 +1106,12 @@
   // called from the vtable.  We need adapters on such methods that get loaded
   // later.  Ditto for mega-morphic itable calls.  If this proves to be a
   // problem we'll make these lazily later.
   (void) make_adapters(h_method, CHECK);
 
+  set_num_stack_arg_slots();
+
   // ONLY USE the h_method now as make_adapter may have blocked
 
 }
 
 address Method::make_adapters(const methodHandle& mh, TRAPS) {

@@ -1624,11 +1626,11 @@
   }
   return false;
 }
 
 // Exposed so field engineers can debug VM
-void Method::print_short_name(outputStream* st) {
+void Method::print_short_name(outputStream* st) const {
   ResourceMark rm;
 #ifdef PRODUCT
   st->print(" %s::", method_holder()->external_name());
 #else
   st->print(" %s::", method_holder()->internal_name());

@@ -1663,10 +1665,29 @@
       }
     }
   }
 }
 
+void Method::set_num_stack_arg_slots() {
+  ResourceMark rm;
+  int sizeargs = size_of_parameters();
+  BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, sizeargs);
+  VMRegPair* regs   = NEW_RESOURCE_ARRAY(VMRegPair, sizeargs);
+
+  int sig_index = 0;
+  if (!is_static()) sig_bt[sig_index++] = T_OBJECT; // 'this'
+  for (SignatureStream ss(signature()); !ss.at_return_type(); ss.next()) {
+    BasicType t = ss.type();
+    assert(type2size[t] == 1 || type2size[t] == 2, "size is 1 or 2");
+    sig_bt[sig_index++] = t;
+    if (type2size[t] == 2) sig_bt[sig_index++] = T_VOID;
+  }
+  assert(sig_index == sizeargs, "");
+
+  _num_stack_arg_slots = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs, false);
+}
+
 //-----------------------------------------------------------------------------------
 // Non-product code unless JVM/TI needs it
 
 #if !defined(PRODUCT) || INCLUDE_JVMTI
 class SignatureTypePrinter : public SignatureTypeNames {

@@ -1689,11 +1710,11 @@
   void print_parameters()              { _use_separator = false; iterate_parameters(); }
   void print_returntype()              { _use_separator = false; iterate_returntype(); }
 };
 
 
-void Method::print_name(outputStream* st) {
+void Method::print_name(outputStream* st) const {
   Thread *thread = Thread::current();
   ResourceMark rm(thread);
   st->print("%s ", is_static() ? "static" : "virtual");
   if (WizardMode) {
     st->print("%s.", method_holder()->internal_name());
< prev index next >