< prev index next >

src/hotspot/share/utilities/constantTag.cpp

Print this page
rev 52749 : Bootstrap method consolidation
* clean up and simplify JDK support code for BSM invocation
* simplify JVM bootstrap handshake: use BootstrapCallInfo only
* remove unused JVM paths and data fields
* move bootstrap argument processing from MethodHandleNatives to ConstantPool
* remove ConstantGroup; merge argument access into BootstrapCallInfo
* adjust BSM argument access: remove copyArguments, add argumentRef API
* add metadata-free BSM modes, including symbolic arguments from CP

@@ -66,10 +66,35 @@
       return T_ILLEGAL;
   }
 }
 
 
+// value as specified in the classfile format
+jbyte constantTag::classfile_value() const {
+  switch (_tag) {
+  case JVM_CONSTANT_ClassIndex:
+  case JVM_CONSTANT_UnresolvedClass:
+  case JVM_CONSTANT_UnresolvedClassInError:
+    return JVM_CONSTANT_Class;
+  case JVM_CONSTANT_StringIndex:
+    return JVM_CONSTANT_String;
+  case JVM_CONSTANT_MethodHandleInError:
+    return JVM_CONSTANT_MethodHandle;
+  case JVM_CONSTANT_MethodTypeInError:
+    return JVM_CONSTANT_MethodType;
+  case JVM_CONSTANT_DynamicInError:
+    return JVM_CONSTANT_Dynamic;
+  default:
+    // Return a zero tag for a gap after Long or Double,
+    // even though that doesn't exactly appear in a classfile.
+    assert(_tag >= 0 && _tag <= JVM_CONSTANT_ExternalMax,
+           "cannot interpret tag %d as a standard classfile tag", _tag);
+    return _tag;
+  }
+}
+
+
 jbyte constantTag::non_error_value() const {
   switch (_tag) {
   case JVM_CONSTANT_UnresolvedClassInError:
     return JVM_CONSTANT_UnresolvedClass;
   case JVM_CONSTANT_MethodHandleInError:
< prev index next >