src/hotspot/share/oops/method.cpp
changeset 53924 09cba396916f
parent 53838 c8c9bd65c198
child 54042 6dd6f988b4e4
equal deleted inserted replaced
53923:c431ab7f9e85 53924:09cba396916f
  2118 
  2118 
  2119 void Method::change_method_associated_with_jmethod_id(jmethodID jmid, Method* new_method) {
  2119 void Method::change_method_associated_with_jmethod_id(jmethodID jmid, Method* new_method) {
  2120   // Can't assert the method_holder is the same because the new method has the
  2120   // Can't assert the method_holder is the same because the new method has the
  2121   // scratch method holder.
  2121   // scratch method holder.
  2122   assert(resolve_jmethod_id(jmid)->method_holder()->class_loader()
  2122   assert(resolve_jmethod_id(jmid)->method_holder()->class_loader()
  2123            == new_method->method_holder()->class_loader(),
  2123            == new_method->method_holder()->class_loader() ||
       
  2124            new_method->method_holder()->class_loader() == NULL, // allow Unsafe substitution
  2124          "changing to a different class loader");
  2125          "changing to a different class loader");
  2125   // Just change the method in place, jmethodID pointer doesn't change.
  2126   // Just change the method in place, jmethodID pointer doesn't change.
  2126   *((Method**)jmid) = new_method;
  2127   *((Method**)jmid) = new_method;
  2127 }
  2128 }
  2128 
  2129