1806 constantTag tag = cp->tag_at(index); |
1806 constantTag tag = cp->tag_at(index); |
1807 if (!tag.is_klass() && !tag.is_unresolved_klass()) { |
1807 if (!tag.is_klass() && !tag.is_unresolved_klass()) { |
1808 THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); |
1808 THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); |
1809 } |
1809 } |
1810 klassOop k = cp->klass_at(index, CHECK_NULL); |
1810 klassOop k = cp->klass_at(index, CHECK_NULL); |
1811 return (jclass) JNIHandles::make_local(k->klass_part()->java_mirror()); |
1811 return (jclass) JNIHandles::make_local(k->java_mirror()); |
1812 } |
1812 } |
1813 JVM_END |
1813 JVM_END |
1814 |
1814 |
1815 |
1815 |
1816 JVM_ENTRY(jclass, JVM_ConstantPoolGetClassAtIfLoaded(JNIEnv *env, jobject unused, jobject jcpool, jint index)) |
1816 JVM_ENTRY(jclass, JVM_ConstantPoolGetClassAtIfLoaded(JNIEnv *env, jobject unused, jobject jcpool, jint index)) |
1822 if (!tag.is_klass() && !tag.is_unresolved_klass()) { |
1822 if (!tag.is_klass() && !tag.is_unresolved_klass()) { |
1823 THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); |
1823 THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); |
1824 } |
1824 } |
1825 klassOop k = constantPoolOopDesc::klass_at_if_loaded(cp, index); |
1825 klassOop k = constantPoolOopDesc::klass_at_if_loaded(cp, index); |
1826 if (k == NULL) return NULL; |
1826 if (k == NULL) return NULL; |
1827 return (jclass) JNIHandles::make_local(k->klass_part()->java_mirror()); |
1827 return (jclass) JNIHandles::make_local(k->java_mirror()); |
1828 } |
1828 } |
1829 JVM_END |
1829 JVM_END |
1830 |
1830 |
1831 static jobject get_method_at_helper(constantPoolHandle cp, jint index, bool force_resolution, TRAPS) { |
1831 static jobject get_method_at_helper(constantPoolHandle cp, jint index, bool force_resolution, TRAPS) { |
1832 constantTag tag = cp->tag_at(index); |
1832 constantTag tag = cp->tag_at(index); |