< prev index next >

src/hotspot/share/oops/method.cpp

Print this page
*** 101,10 ***
--- 101,11 ---
    set_access_flags(access_flags);
    set_intrinsic_id(vmIntrinsics::_none);
    set_force_inline(false);
    set_hidden(false);
    set_dont_inline(false);
+   set_changes_current_thread(false);
    set_has_injected_profile(false);
    set_method_data(NULL);
    clear_method_counters();
    set_vtable_index(Method::garbage_vtable_index);
  

*** 969,14 ***
      if (constants()->tag_at(klass_index).is_unresolved_klass()) return false;
    }
    return is_klass_loaded_by_klass_index(klass_index);
  }
  
- 
  void Method::set_native_function(address function, bool post_event_flag) {
    assert(function != NULL, "use clear_native_function to unregister natives");
!   assert(!is_method_handle_intrinsic() || function == SharedRuntime::native_method_throw_unsatisfied_link_error_entry(), "");
    address* native_function = native_function_addr();
  
    // We can see racers trying to place the same native function into place. Once
    // is plenty.
    address current = *native_function;
--- 970,13 ---
      if (constants()->tag_at(klass_index).is_unresolved_klass()) return false;
    }
    return is_klass_loaded_by_klass_index(klass_index);
  }
  
  void Method::set_native_function(address function, bool post_event_flag) {
    assert(function != NULL, "use clear_native_function to unregister natives");
!   assert(!is_special_native_intrinsic() || function == SharedRuntime::native_method_throw_unsatisfied_link_error_entry(), "");
    address* native_function = native_function_addr();
  
    // We can see racers trying to place the same native function into place. Once
    // is plenty.
    address current = *native_function;

*** 1002,11 ***
    }
  }
  
  
  bool Method::has_native_function() const {
!   if (is_method_handle_intrinsic())
      return false;  // special-cased in SharedRuntime::generate_native_wrapper
    address func = native_function();
    return (func != NULL && func != SharedRuntime::native_method_throw_unsatisfied_link_error_entry());
  }
  
--- 1002,11 ---
    }
  }
  
  
  bool Method::has_native_function() const {
!   if (is_special_native_intrinsic())
      return false;  // special-cased in SharedRuntime::generate_native_wrapper
    address func = native_function();
    return (func != NULL && func != SharedRuntime::native_method_throw_unsatisfied_link_error_entry());
  }
  

*** 1218,10 ***
--- 1218,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) {
    // Adapters for compiled code are made eagerly here.  They are fairly

*** 1303,10 ***
--- 1305,14 ---
    mh->_from_compiled_entry = code->verified_entry_point();
    OrderAccess::storestore();
    // Instantly compiled code can execute.
    if (!mh->is_method_handle_intrinsic())
      mh->_from_interpreted_entry = mh->get_i2c_entry();
+   if (mh->is_continuation_enter_intrinsic()) {
+     mh->_i2i_entry = mh->get_i2c_entry(); // this is the entry used when we're in interpreter-only mode; see InterpreterMacroAssembler::jump_from_interpreted
+     mh->_from_interpreted_entry = mh->get_i2c_entry();
+   }
  }
  
  
  bool Method::is_overridden_in(Klass* k) const {
    InstanceKlass* ik = InstanceKlass::cast(k);

*** 1722,11 ***
    }
    return false;
  }
  
  // Exposed so field engineers can debug VM
! void Method::print_short_name(outputStream* st) {
    ResourceMark rm;
  #ifdef PRODUCT
    st->print(" %s::", method_holder()->external_name());
  #else
    st->print(" %s::", method_holder()->internal_name());
--- 1728,11 ---
    }
    return false;
  }
  
  // Exposed so field engineers can debug VM
! 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());

*** 1764,10 ***
--- 1770,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);
+ }
+ 
  //-----------------------------------------------------------------------------------
  // Non-product code unless JVM/TI needs it
  
  #if !defined(PRODUCT) || INCLUDE_JVMTI
  class SignatureTypePrinter : public SignatureTypeNames {

*** 1790,11 ***
    void print_parameters()              { _use_separator = false; do_parameters_on(this); }
    void print_returntype()              { _use_separator = false; do_type(return_type()); }
  };
  
  
! void Method::print_name(outputStream* st) {
    Thread *thread = Thread::current();
    ResourceMark rm(thread);
    st->print("%s ", is_static() ? "static" : "virtual");
    if (WizardMode) {
      st->print("%s.", method_holder()->internal_name());
--- 1815,11 ---
    void print_parameters()              { _use_separator = false; do_parameters_on(this); }
    void print_returntype()              { _use_separator = false; do_type(return_type()); }
  };
  
  
! 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());

*** 2275,10 ***
--- 2300,17 ---
    if (value && !already_set) {
      MetadataOnStackMark::record(this);
    }
  }
  
+ void Method::record_marking_cycle() {
+   // If any method is on the stack in continuations, none of them can be reclaimed,
+   // so save the marking cycle to check for the whole class in the cpCache.
+   // The cpCache is writeable.
+   constants()->cache()->record_marking_cycle();
+ }
+ 
  // Called when the class loader is unloaded to make all methods weak.
  void Method::clear_jmethod_ids(ClassLoaderData* loader_data) {
    loader_data->jmethod_ids()->clear_all_methods();
  }
  
< prev index next >