hotspot/src/share/vm/prims/jvm.cpp
changeset 24456 8c7933fa5a1f
parent 24429 4efc66ee325c
child 25057 f38210f84f8c
equal deleted inserted replaced
24455:79b5204317a2 24456:8c7933fa5a1f
  1852       if (offset == java_lang_Throwable::get_backtrace_offset()) continue;
  1852       if (offset == java_lang_Throwable::get_backtrace_offset()) continue;
  1853     }
  1853     }
  1854 
  1854 
  1855     if (!publicOnly || fs.access_flags().is_public()) {
  1855     if (!publicOnly || fs.access_flags().is_public()) {
  1856       fd.reinitialize(k(), fs.index());
  1856       fd.reinitialize(k(), fs.index());
  1857       oop field = Reflection::new_field(&fd, UseNewReflection, CHECK_NULL);
  1857       oop field = Reflection::new_field(&fd, CHECK_NULL);
  1858       result->obj_at_put(out_idx, field);
  1858       result->obj_at_put(out_idx, field);
  1859       ++out_idx;
  1859       ++out_idx;
  1860     }
  1860     }
  1861   }
  1861   }
  1862   assert(out_idx == num_fields, "just checking");
  1862   assert(out_idx == num_fields, "just checking");
  1930     } else {
  1930     } else {
  1931       oop m;
  1931       oop m;
  1932       if (want_constructor) {
  1932       if (want_constructor) {
  1933         m = Reflection::new_constructor(method, CHECK_NULL);
  1933         m = Reflection::new_constructor(method, CHECK_NULL);
  1934       } else {
  1934       } else {
  1935         m = Reflection::new_method(method, UseNewReflection, false, CHECK_NULL);
  1935         m = Reflection::new_method(method, false, CHECK_NULL);
  1936       }
  1936       }
  1937       result->obj_at_put(i, m);
  1937       result->obj_at_put(i, m);
  1938     }
  1938     }
  1939   }
  1939   }
  1940 
  1940 
  2053   if (m.is_null()) {
  2053   if (m.is_null()) {
  2054     THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "Unable to look up method in target class");
  2054     THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "Unable to look up method in target class");
  2055   }
  2055   }
  2056   oop method;
  2056   oop method;
  2057   if (!m->is_initializer() || m->is_static()) {
  2057   if (!m->is_initializer() || m->is_static()) {
  2058     method = Reflection::new_method(m, true, true, CHECK_NULL);
  2058     method = Reflection::new_method(m, true, CHECK_NULL);
  2059   } else {
  2059   } else {
  2060     method = Reflection::new_constructor(m, CHECK_NULL);
  2060     method = Reflection::new_constructor(m, CHECK_NULL);
  2061   }
  2061   }
  2062   return JNIHandles::make_local(method);
  2062   return JNIHandles::make_local(method);
  2063 }
  2063 }
  2103   fieldDescriptor fd;
  2103   fieldDescriptor fd;
  2104   Klass* target_klass = k->find_field(name, sig, &fd);
  2104   Klass* target_klass = k->find_field(name, sig, &fd);
  2105   if (target_klass == NULL) {
  2105   if (target_klass == NULL) {
  2106     THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "Unable to look up field in target class");
  2106     THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "Unable to look up field in target class");
  2107   }
  2107   }
  2108   oop field = Reflection::new_field(&fd, true, CHECK_NULL);
  2108   oop field = Reflection::new_field(&fd, CHECK_NULL);
  2109   return JNIHandles::make_local(field);
  2109   return JNIHandles::make_local(field);
  2110 }
  2110 }
  2111 
  2111 
  2112 JVM_ENTRY(jobject, JVM_ConstantPoolGetFieldAt(JNIEnv *env, jobject obj, jobject unusedl, jint index))
  2112 JVM_ENTRY(jobject, JVM_ConstantPoolGetFieldAt(JNIEnv *env, jobject obj, jobject unusedl, jint index))
  2113 {
  2113 {
  3519 // Return the first non-null class loader up the execution stack, or null
  3519 // Return the first non-null class loader up the execution stack, or null
  3520 // if only code from the null class loader is on the stack.
  3520 // if only code from the null class loader is on the stack.
  3521 
  3521 
  3522 JVM_ENTRY(jobject, JVM_LatestUserDefinedLoader(JNIEnv *env))
  3522 JVM_ENTRY(jobject, JVM_LatestUserDefinedLoader(JNIEnv *env))
  3523   for (vframeStream vfst(thread); !vfst.at_end(); vfst.next()) {
  3523   for (vframeStream vfst(thread); !vfst.at_end(); vfst.next()) {
  3524     // UseNewReflection
       
  3525     vfst.skip_reflection_related_frames(); // Only needed for 1.4 reflection
  3524     vfst.skip_reflection_related_frames(); // Only needed for 1.4 reflection
  3526     oop loader = vfst.method()->method_holder()->class_loader();
  3525     oop loader = vfst.method()->method_holder()->class_loader();
  3527     if (loader != NULL) {
  3526     if (loader != NULL) {
  3528       return JNIHandles::make_local(env, loader);
  3527       return JNIHandles::make_local(env, loader);
  3529     }
  3528     }