hotspot/src/share/vm/classfile/classFileParser.hpp
changeset 46513 c61eea516a0a
parent 46504 38048d4d20e7
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp	Wed May 31 13:17:00 2017 +0200
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp	Thu Jun 01 09:34:53 2017 -0700
@@ -75,6 +75,9 @@
   enum { LegalClass, LegalField, LegalMethod }; // used to verify unqualified names
 
  private:
+  // Potentially unaligned pointer to various 16-bit entries in the class file
+  typedef void unsafe_u2;
+
   const ClassFileStream* _stream; // Actual input stream
   const Symbol* _requested_name;
   Symbol* _class_name;
@@ -242,28 +245,28 @@
                      bool* const declares_nonstatic_concrete_methods,
                      TRAPS);
 
-  const void* parse_exception_table(const ClassFileStream* const stream,
-                                    u4 code_length,
-                                    u4 exception_table_length,
-                                    TRAPS);
+  const unsafe_u2* parse_exception_table(const ClassFileStream* const stream,
+                                         u4 code_length,
+                                         u4 exception_table_length,
+                                         TRAPS);
 
   void parse_linenumber_table(u4 code_attribute_length,
                               u4 code_length,
                               CompressedLineNumberWriteStream**const write_stream,
                               TRAPS);
 
-  const void* parse_localvariable_table(const ClassFileStream* const cfs,
-                                        u4 code_length,
-                                        u2 max_locals,
-                                        u4 code_attribute_length,
-                                        u2* const localvariable_table_length,
-                                        bool isLVTT,
-                                        TRAPS);
+  const unsafe_u2* parse_localvariable_table(const ClassFileStream* const cfs,
+                                             u4 code_length,
+                                             u2 max_locals,
+                                             u4 code_attribute_length,
+                                             u2* const localvariable_table_length,
+                                             bool isLVTT,
+                                             TRAPS);
 
-  const void* parse_checked_exceptions(const ClassFileStream* const cfs,
-                                       u2* const checked_exceptions_length,
-                                       u4 method_attribute_length,
-                                       TRAPS);
+  const unsafe_u2* parse_checked_exceptions(const ClassFileStream* const cfs,
+                                            u2* const checked_exceptions_length,
+                                            u4 method_attribute_length,
+                                            TRAPS);
 
   void parse_type_array(u2 array_length,
                         u4 code_length,
@@ -462,10 +465,10 @@
   void copy_localvariable_table(const ConstMethod* cm,
                                 int lvt_cnt,
                                 u2* const localvariable_table_length,
-                                const void** const localvariable_table_start,
+                                const unsafe_u2** const localvariable_table_start,
                                 int lvtt_cnt,
                                 u2* const localvariable_type_table_length,
-                                const void** const localvariable_type_table_start,
+                                const unsafe_u2** const localvariable_type_table_start,
                                 TRAPS);
 
   void copy_method_annotations(ConstMethod* cm,