< prev index next >

src/hotspot/share/prims/jvm.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -1914,12 +1914,11 @@
 {
   JVMWrapper("JVM_ConstantPoolGetClassAt");
   constantPoolHandle cp = constantPoolHandle(THREAD, reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj)));
   bounds_check(cp, index, CHECK_NULL);
   constantTag tag = cp->tag_at(index);
-  if (!tag.is_klass() && !tag.is_unresolved_klass() &&
-      !tag.is_value_type() && !tag.is_unresolved_value_type()) {
+  if (!tag.is_klass() && !tag.is_unresolved_klass()) {
     THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index");
   }
   Klass* k = cp->klass_at(index, CHECK_NULL);
   return (jclass) JNIHandles::make_local(k->java_mirror());
 }

@@ -1929,12 +1928,11 @@
 {
   JVMWrapper("JVM_ConstantPoolGetClassAtIfLoaded");
   constantPoolHandle cp = constantPoolHandle(THREAD, reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj)));
   bounds_check(cp, index, CHECK_NULL);
   constantTag tag = cp->tag_at(index);
-  if (!tag.is_klass() && !tag.is_unresolved_klass() &&
-      !tag.is_value_type() && !tag.is_unresolved_value_type()) {
+  if (!tag.is_klass() && !tag.is_unresolved_klass()) {
     THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index");
   }
   Klass* k = ConstantPool::klass_at_if_loaded(cp, index);
   if (k == NULL) return NULL;
   return (jclass) JNIHandles::make_local(k->java_mirror());

@@ -2207,13 +2205,10 @@
   // If returned tag values are not from the JVM spec, e.g. tags from 100 to 105,
   // they are changed to the corresponding tags from the JVM spec, so that java code in
   // sun.reflect.ConstantPool will return only tags from the JVM spec, not internal ones.
   if (tag.is_klass_or_reference()) {
       result = JVM_CONSTANT_Class;
-  } else if (tag.is_value_type_or_reference()) {
-      // Return Class, JVM_CONSTANT_Value not externally visible
-      result = JVM_CONSTANT_Class;
   } else if (tag.is_string_index()) {
       result = JVM_CONSTANT_String;
   } else if (tag.is_method_type_in_error()) {
       result = JVM_CONSTANT_MethodType;
   } else if (tag.is_method_handle_in_error()) {

@@ -2326,12 +2321,11 @@
   // (length is determined by call to JVM_GetClassCPEntriesCount)
   if (k->is_instance_klass()) {
     ConstantPool* cp = InstanceKlass::cast(k)->constants();
     for (int index = cp->length() - 1; index >= 0; index--) {
       constantTag tag = cp->tag_at(index);
-      // For a value type return Class, JVM_CONSTANT_Value not externally visible
-      types[index] = (tag.is_unresolved_klass() || tag.is_unresolved_value_type()) ? JVM_CONSTANT_Class : tag.value();
+      types[index] = tag.is_unresolved_klass() ? JVM_CONSTANT_Class : tag.value();
     }
   }
 JVM_END
 
 
< prev index next >