# HG changeset patch # User Gilles Duboscq # Date 1386003960 -3600 # Node ID 2b43fcc68adde29296bad26ba9ab6537a9761ec1 # Parent fdc3925a8e7401535da70fe3fa052001946d9103 Put _pending_deoptimization and _pending_monitorenter under ifdef GRAAL diff -r fdc3925a8e74 -r 2b43fcc68add src/cpu/x86/vm/templateInterpreter_x86_64.cpp --- 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; diff -r fdc3925a8e74 -r 2b43fcc68add src/share/vm/graal/vmStructs_graal.hpp --- 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) \ diff -r fdc3925a8e74 -r 2b43fcc68add src/share/vm/runtime/deoptimization.cpp --- 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()) { diff -r fdc3925a8e74 -r 2b43fcc68add src/share/vm/runtime/vmStructs.cpp --- 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) \ diff -r fdc3925a8e74 -r 2b43fcc68add src/share/vm/utilities/exceptions.hpp --- 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 + {} };