changeset 56904:8d093ef9814e records-and-sealed

adjusting Record attribute to last spec: remove access flags from the attr, etc
author vromero
date Wed, 26 Jun 2019 17:52:40 -0400
parents 88397728dd30
children 66954227dfc2 7241fb1920dc
files src/hotspot/share/classfile/classFileParser.cpp src/hotspot/share/oops/instanceKlass.hpp src/hotspot/share/oops/recordParamInfo.hpp src/hotspot/share/oops/recordParamStreams.hpp src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
diffstat 5 files changed, 6 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/classfile/classFileParser.cpp	Wed Jun 26 15:52:31 2019 -0400
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Wed Jun 26 17:52:40 2019 -0400
@@ -3291,11 +3291,6 @@
     // DEBUG
     // tty->print_cr("name read %s", name->as_klass_external_name());
 
-    AccessFlags access_flags;
-    const jint flags = cfs->get_u2_fast() & JVM_RECOGNIZED_FIELD_MODIFIERS;
-    verify_legal_field_modifiers(flags, false, CHECK);
-    access_flags.set_flags(flags);
-
     const u2 descriptor_index = cfs->get_u2_fast();
     check_property(valid_symbol_at(descriptor_index),
       "Invalid constant pool index %u for record parameter descriptor in class file %s",
@@ -3315,7 +3310,6 @@
 
     RecordParamInfo* const record_param_info = RecordParamInfo::from_record_params_array(record_params_array, n);
     record_param_info->initialize(
-                      access_flags.as_short(),
                       name_index,
                       descriptor_index,
                       signature_index);
--- a/src/hotspot/share/oops/instanceKlass.hpp	Wed Jun 26 15:52:31 2019 -0400
+++ b/src/hotspot/share/oops/instanceKlass.hpp	Wed Jun 26 17:52:40 2019 -0400
@@ -457,7 +457,6 @@
   void set_nest_host_index(u2 i)  { _nest_host_index = i; }
 
   // record parameters
-  int     record_param_access_flags(int index) const { return record_param(index)->access_flags(); }
   Symbol* record_param_name(int index) const { return record_param(index)->name(constants()); }
   Symbol* record_param_signature(int index) const { return record_param(index)->signature(constants()); }
   Symbol* record_param_descriptor(int index) const { return record_param(index)->signature(constants()); }
--- a/src/hotspot/share/oops/recordParamInfo.hpp	Wed Jun 26 15:52:31 2019 -0400
+++ b/src/hotspot/share/oops/recordParamInfo.hpp	Wed Jun 26 17:52:40 2019 -0400
@@ -40,11 +40,10 @@
   friend class RecordParameterStreamBase;
   friend class JavaRecordParameterStream;
   enum ParamOffset {
-    access_flags_offset      = 0,
-    name_index_offset        = 1,
-    descriptor_index_offset  = 2,
-    signature_index_offset   = 3,
-    param_slots              = 4
+    name_index_offset        = 0,
+    descriptor_index_offset  = 1,
+    signature_index_offset   = 2,
+    param_slots              = 3
   };
 
 private:
@@ -65,21 +64,17 @@
     return ((RecordParamInfo*)(record_params + index * param_slots));
   }
 
-  void initialize(u2 access_flags,
-                  u2 name_index,
+  void initialize(u2 name_index,
                   u2 descriptor_index,
                   u2 signature_index) {
-    _shorts[access_flags_offset] = access_flags;
     _shorts[name_index_offset] = name_index;
     _shorts[descriptor_index_offset] = descriptor_index;
     _shorts[signature_index_offset] = signature_index;
   }
 
-  u2 access_flags() const                                   { return _shorts[access_flags_offset];      }
   Symbol* name(const constantPoolHandle& cp) const          { return cp->symbol_at(name_index());       }
   Symbol* signature(const constantPoolHandle& cp) const     { return cp->symbol_at(signature_index());  }
   Symbol* descriptor(const constantPoolHandle& cp) const    { return cp->symbol_at(descriptor_index()); }
-  void set_access_flags(u2 val)                             { _shorts[access_flags_offset] = val;       }
 };
 
 #endif // SHARE_VM_OOPS_RECORDPARAMINFO_HPP
--- a/src/hotspot/share/oops/recordParamStreams.hpp	Wed Jun 26 15:52:31 2019 -0400
+++ b/src/hotspot/share/oops/recordParamStreams.hpp	Wed Jun 26 17:52:40 2019 -0400
@@ -76,21 +76,6 @@
   }
   bool done() const { return _index >= _limit; }
 
-  // Accessors for current record parameter
-  AccessFlags access_flags() const {
-    AccessFlags flags;
-    flags.set_flags(record_param()->access_flags());
-    return flags;
-  }
-
-  void set_access_flags(u2 flags) const {
-    record_param()->set_access_flags(flags);
-  }
-
-  void set_access_flags(AccessFlags flags) const {
-    set_access_flags(flags.as_short());
-  }
-
   Symbol* name() const {
     return record_param()->name(_constants);
   }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed Jun 26 15:52:31 2019 -0400
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed Jun 26 17:52:40 2019 -0400
@@ -846,9 +846,8 @@
         databuf.appendChar(numParams);
         for (VarSymbol v: vars) {
             databuf.appendChar(poolWriter.putName(v.name));
-            databuf.appendChar(adjustFlags(v.flags()));
             // descriptor
-            databuf.appendChar(poolWriter.putSignature(v));
+            databuf.appendChar(poolWriter.putDescriptor(v));
             // signature
             databuf.appendChar(poolWriter.putSignature(v));
         }