< prev index next >

src/hotspot/cpu/x86/interp_masm_x86.cpp

Print this page
rev 47415 : Add Thread Local handshakes and thread local polling


  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "interp_masm_x86.hpp"
  27 #include "interpreter/interpreter.hpp"
  28 #include "interpreter/interpreterRuntime.hpp"
  29 #include "logging/log.hpp"
  30 #include "oops/arrayOop.hpp"
  31 #include "oops/markOop.hpp"
  32 #include "oops/methodData.hpp"
  33 #include "oops/method.hpp"
  34 #include "prims/jvmtiExport.hpp"
  35 #include "prims/jvmtiThreadState.hpp"
  36 #include "runtime/basicLock.hpp"
  37 #include "runtime/biasedLocking.hpp"

  38 #include "runtime/sharedRuntime.hpp"
  39 #include "runtime/thread.inline.hpp"
  40 
  41 // Implementation of InterpreterMacroAssembler
  42 
  43 void InterpreterMacroAssembler::jump_to_entry(address entry) {
  44   assert(entry, "Entry must have been generated by now");
  45   jump(RuntimeAddress(entry));
  46 }
  47 
  48 void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) {
  49   Label update, next, none;
  50 
  51   verify_oop(obj);
  52 
  53   testptr(obj, obj);
  54   jccb(Assembler::notZero, update);
  55   orptr(mdo_addr, TypeEntries::null_seen);
  56   jmpb(next);
  57 


 810 void InterpreterMacroAssembler::dispatch_base(TosState state,
 811                                               address* table,
 812                                               bool verifyoop) {
 813   verify_FPU(1, state);
 814   if (VerifyActivationFrameSize) {
 815     Label L;
 816     mov(rcx, rbp);
 817     subptr(rcx, rsp);
 818     int32_t min_frame_size =
 819       (frame::link_offset - frame::interpreter_frame_initial_sp_offset) *
 820       wordSize;
 821     cmpptr(rcx, (int32_t)min_frame_size);
 822     jcc(Assembler::greaterEqual, L);
 823     stop("broken stack frame");
 824     bind(L);
 825   }
 826   if (verifyoop) {
 827     verify_oop(rax, state);
 828   }
 829 #ifdef _LP64














 830   lea(rscratch1, ExternalAddress((address)table));

 831   jmp(Address(rscratch1, rbx, Address::times_8));

 832 #else
 833   Address index(noreg, rbx, Address::times_ptr);
 834   ExternalAddress tbl((address)table);
 835   ArrayAddress dispatch(tbl, index);
 836   jump(dispatch);
 837 #endif // _LP64
 838 }
 839 
 840 void InterpreterMacroAssembler::dispatch_only(TosState state) {
 841   dispatch_base(state, Interpreter::dispatch_table(state));
 842 }
 843 
 844 void InterpreterMacroAssembler::dispatch_only_normal(TosState state) {
 845   dispatch_base(state, Interpreter::normal_table(state));
 846 }
 847 
 848 void InterpreterMacroAssembler::dispatch_only_noverify(TosState state) {
 849   dispatch_base(state, Interpreter::normal_table(state), false);
 850 }
 851 




  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "interp_masm_x86.hpp"
  27 #include "interpreter/interpreter.hpp"
  28 #include "interpreter/interpreterRuntime.hpp"
  29 #include "logging/log.hpp"
  30 #include "oops/arrayOop.hpp"
  31 #include "oops/markOop.hpp"
  32 #include "oops/methodData.hpp"
  33 #include "oops/method.hpp"
  34 #include "prims/jvmtiExport.hpp"
  35 #include "prims/jvmtiThreadState.hpp"
  36 #include "runtime/basicLock.hpp"
  37 #include "runtime/biasedLocking.hpp"
  38 #include "runtime/safepointMechanism.hpp"
  39 #include "runtime/sharedRuntime.hpp"
  40 #include "runtime/thread.inline.hpp"
  41 
  42 // Implementation of InterpreterMacroAssembler
  43 
  44 void InterpreterMacroAssembler::jump_to_entry(address entry) {
  45   assert(entry, "Entry must have been generated by now");
  46   jump(RuntimeAddress(entry));
  47 }
  48 
  49 void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) {
  50   Label update, next, none;
  51 
  52   verify_oop(obj);
  53 
  54   testptr(obj, obj);
  55   jccb(Assembler::notZero, update);
  56   orptr(mdo_addr, TypeEntries::null_seen);
  57   jmpb(next);
  58 


 811 void InterpreterMacroAssembler::dispatch_base(TosState state,
 812                                               address* table,
 813                                               bool verifyoop) {
 814   verify_FPU(1, state);
 815   if (VerifyActivationFrameSize) {
 816     Label L;
 817     mov(rcx, rbp);
 818     subptr(rcx, rsp);
 819     int32_t min_frame_size =
 820       (frame::link_offset - frame::interpreter_frame_initial_sp_offset) *
 821       wordSize;
 822     cmpptr(rcx, (int32_t)min_frame_size);
 823     jcc(Assembler::greaterEqual, L);
 824     stop("broken stack frame");
 825     bind(L);
 826   }
 827   if (verifyoop) {
 828     verify_oop(rax, state);
 829   }
 830 #ifdef _LP64
 831 
 832   Label no_safepoint, dispatch;
 833   address* const safepoint_table = Interpreter::safept_table(state);
 834   if (SafepointMechanism::uses_thread_local_poll() && table != safepoint_table) {
 835     NOT_PRODUCT(block_comment("Thread-local Safepoint poll"));
 836 
 837     testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
 838 
 839     jccb(Assembler::zero, no_safepoint);
 840     lea(rscratch1, ExternalAddress((address)safepoint_table));
 841     jmpb(dispatch);
 842   }
 843 
 844   bind(no_safepoint);
 845   lea(rscratch1, ExternalAddress((address)table));
 846   bind(dispatch);
 847   jmp(Address(rscratch1, rbx, Address::times_8));
 848 
 849 #else
 850   Address index(noreg, rbx, Address::times_ptr);
 851   ExternalAddress tbl((address)table);
 852   ArrayAddress dispatch(tbl, index);
 853   jump(dispatch);
 854 #endif // _LP64
 855 }
 856 
 857 void InterpreterMacroAssembler::dispatch_only(TosState state) {
 858   dispatch_base(state, Interpreter::dispatch_table(state));
 859 }
 860 
 861 void InterpreterMacroAssembler::dispatch_only_normal(TosState state) {
 862   dispatch_base(state, Interpreter::normal_table(state));
 863 }
 864 
 865 void InterpreterMacroAssembler::dispatch_only_noverify(TosState state) {
 866   dispatch_base(state, Interpreter::normal_table(state), false);
 867 }
 868 


< prev index next >