< prev index next >

src/share/vm/oops/method.hpp

Print this page
rev 10298 : 8147978: Remove Method::_method_data for C1
Summary: Method::_method_data field removed when not using C2 or JVMCI
Reviewed-by: dholmes, kvn

@@ -62,11 +62,13 @@
 class Method : public Metadata {
  friend class VMStructs;
  friend class JVMCIVMStructs;
  private:
   ConstMethod*      _constMethod;                // Method read-only data.
+#if defined(COMPILER2) || INCLUDE_JVMCI
   MethodData*       _method_data;
+#endif
   MethodCounters*   _method_counters;
   AccessFlags       _access_flags;               // Access flags
   int               _vtable_index;               // vtable index of this method (see VtableIndexFlag)
                                                  // note: can have vtables with >2**16 elements (because of inheritance)
 #ifdef CC_INTERP

@@ -317,10 +319,11 @@
   // exception handler which caused the exception to be thrown, which
   // is needed for proper retries. See, for example,
   // InterpreterRuntime::exception_handler_for_exception.
   static int fast_exception_handler_bci_for(methodHandle mh, KlassHandle ex_klass, int throw_bci, TRAPS);
 
+#if defined(COMPILER2) || INCLUDE_JVMCI
   // method data access
   MethodData* method_data() const              {
     return _method_data;
   }
 

@@ -328,10 +331,14 @@
     // The store into method must be released. On platforms without
     // total store order (TSO) the reference may become visible before
     // the initialization of data otherwise.
     OrderAccess::release_store_ptr((volatile void *)&_method_data, data);
   }
+#else
+  MethodData* method_data() const              { return NULL; }
+  void set_method_data(MethodData* data)       { }
+#endif
 
   MethodCounters* method_counters() const {
     return _method_counters;
   }
 

@@ -637,13 +644,20 @@
 #ifdef CC_INTERP
   static ByteSize result_index_offset()          { return byte_offset_of(Method, _result_index ); }
 #endif /* CC_INTERP */
   static ByteSize from_compiled_offset()         { return byte_offset_of(Method, _from_compiled_entry); }
   static ByteSize code_offset()                  { return byte_offset_of(Method, _code); }
+#if defined(COMPILER2) || INCLUDE_JVMCI
   static ByteSize method_data_offset()           {
     return byte_offset_of(Method, _method_data);
   }
+#else
+  static ByteSize method_data_offset()           {
+    ShouldNotReachHere();
+    return in_ByteSize(0);
+  }
+#endif
   static ByteSize method_counters_offset()       {
     return byte_offset_of(Method, _method_counters);
   }
 #ifndef PRODUCT
   static ByteSize compiled_invocation_counter_offset() { return byte_offset_of(Method, _compiled_invocation_count); }

@@ -652,11 +666,15 @@
   static ByteSize from_interpreted_offset()      { return byte_offset_of(Method, _from_interpreted_entry ); }
   static ByteSize interpreter_entry_offset()     { return byte_offset_of(Method, _i2i_entry ); }
   static ByteSize signature_handler_offset()     { return in_ByteSize(sizeof(Method) + wordSize);      }
 
   // for code generation
+#if defined(COMPILER2) || INCLUDE_JVMCI
   static int method_data_offset_in_bytes()       { return offset_of(Method, _method_data); }
+#else
+  static int method_data_offset_in_bytes()       { ShouldNotReachHere(); return 0; }
+#endif
   static int intrinsic_id_offset_in_bytes()      { return offset_of(Method, _intrinsic_id); }
   static int intrinsic_id_size_in_bytes()        { return sizeof(u2); }
 
   // Static methods that are used to implement member methods where an exposed this pointer
   // is needed due to possible GCs
< prev index next >