changeset 13220:2b43fcc68add

Put _pending_deoptimization and _pending_monitorenter under ifdef GRAAL
author Gilles Duboscq <duboscq@ssw.jku.at>
date Mon, 02 Dec 2013 18:06:00 +0100
parents fdc3925a8e74
children d5c6d9beebe3
files src/cpu/x86/vm/templateInterpreter_x86_64.cpp src/share/vm/graal/vmStructs_graal.hpp src/share/vm/runtime/deoptimization.cpp src/share/vm/runtime/vmStructs.cpp src/share/vm/utilities/exceptions.hpp
diffstat 5 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Mon Dec 02 18:02:04 2013 +0100
+++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Mon Dec 02 18:06:00 2013 +0100
@@ -207,6 +207,7 @@
   __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
   __ restore_bcp();
   __ restore_locals();
+#ifdef GRAAL
   // Check if we need to take lock at entry of synchronized method.
   {
     Label L;
@@ -220,6 +221,7 @@
     lock_method();
     __ bind(L);
   }
+#endif
   // handle exceptions
   {
     Label L;
--- a/src/share/vm/graal/vmStructs_graal.hpp	Mon Dec 02 18:02:04 2013 +0100
+++ b/src/share/vm/graal/vmStructs_graal.hpp	Mon Dec 02 18:06:00 2013 +0100
@@ -30,6 +30,7 @@
 
 #define VM_STRUCTS_GRAAL(nonstatic_field, static_field)                       \
   static_field(java_lang_Class, _graal_mirror_offset, int)                    \
+  nonstatic_field(ThreadShadow, _pending_deoptimization, int)                 \
 
 #define VM_TYPES_GRAAL(declare_type, declare_toplevel_type)                   \
 
--- a/src/share/vm/runtime/deoptimization.cpp	Mon Dec 02 18:02:04 2013 +0100
+++ b/src/share/vm/runtime/deoptimization.cpp	Mon Dec 02 18:06:00 2013 +0100
@@ -1368,10 +1368,12 @@
 
     methodHandle    trap_method = trap_scope->method();
     int             trap_bci    = trap_scope->bci();
+#ifdef GRAAL
     if (trap_bci == SynchronizationEntryBCI) {
       trap_bci = 0;
       Thread::current()->set_pending_monitorenter(true);
     }
+#endif
     Bytecodes::Code trap_bc     = trap_method->java_code_at(trap_bci);
 
     if (trap_scope->rethrow_exception()) {
--- a/src/share/vm/runtime/vmStructs.cpp	Mon Dec 02 18:02:04 2013 +0100
+++ b/src/share/vm/runtime/vmStructs.cpp	Mon Dec 02 18:06:00 2013 +0100
@@ -913,7 +913,6 @@
      static_field(Threads,                     _return_code,                                  int)                                   \
                                                                                                                                      \
   nonstatic_field(ThreadShadow,                _pending_exception,                            oop)                                   \
-  nonstatic_field(ThreadShadow,                _pending_deoptimization,                       int)                                   \
   nonstatic_field(ThreadShadow,                _exception_file,                               const char*)                           \
   nonstatic_field(ThreadShadow,                _exception_line,                               int)                                   \
    volatile_nonstatic_field(Thread,            _suspend_flags,                                uint32_t)                              \
--- a/src/share/vm/utilities/exceptions.hpp	Mon Dec 02 18:02:04 2013 +0100
+++ b/src/share/vm/utilities/exceptions.hpp	Mon Dec 02 18:06:00 2013 +0100
@@ -61,8 +61,10 @@
   friend class VMStructs;
 
  protected:
+#ifdef GRAAL
   int _pending_deoptimization;
   bool _pending_monitorenter;
+#endif
   oop  _pending_exception;                       // Thread has gc actions.
   const char* _exception_file;                   // file information for exception (debugging only)
   int         _exception_line;                   // line information for exception (debugging only)
@@ -78,19 +80,23 @@
 
  public:
   oop  pending_exception() const                 { return _pending_exception; }
-  int  pending_deoptimization() const            { return _pending_deoptimization; }
   bool has_pending_exception() const             { return _pending_exception != NULL; }
   const char* exception_file() const             { return _exception_file; }
   int  exception_line() const                    { return _exception_line; }
+#ifdef GRAAL
+  int  pending_deoptimization() const            { return _pending_deoptimization; }
   bool has_pending_monitorenter() const          { return _pending_monitorenter; }
+#endif
 
   // Code generation support
+  static ByteSize pending_exception_offset()     { return byte_offset_of(ThreadShadow, _pending_exception); }
+#ifdef GRAAL
   static ByteSize pending_deoptimization_offset() { return byte_offset_of(ThreadShadow, _pending_deoptimization); }
-  static ByteSize pending_exception_offset()     { return byte_offset_of(ThreadShadow, _pending_exception); }
   static ByteSize pending_monitorenter_offset()  { return byte_offset_of(ThreadShadow, _pending_monitorenter); }
 
   void set_pending_monitorenter(bool b)          { _pending_monitorenter = b; }
   void set_pending_deoptimization(int reason)    { _pending_deoptimization = reason; }
+#endif
 
   // use THROW whenever possible!
   void set_pending_exception(oop exception, const char* file, int line);
@@ -99,7 +105,11 @@
   void clear_pending_exception();
 
   ThreadShadow() : _pending_exception(NULL),
-                   _exception_file(NULL), _exception_line(0), _pending_monitorenter(false), _pending_deoptimization(-1) {}
+                   _exception_file(NULL), _exception_line(0)
+#ifdef GRAAL
+                   , _pending_monitorenter(false), _pending_deoptimization(-1)
+#endif
+  {}
 };