1 /* |
1 /* |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
828 bind(L); |
828 bind(L); |
829 } |
829 } |
830 if (verifyoop) { |
830 if (verifyoop) { |
831 verify_oop(rax, state); |
831 verify_oop(rax, state); |
832 } |
832 } |
|
833 |
|
834 address* const safepoint_table = Interpreter::safept_table(state); |
833 #ifdef _LP64 |
835 #ifdef _LP64 |
834 |
|
835 Label no_safepoint, dispatch; |
836 Label no_safepoint, dispatch; |
836 address* const safepoint_table = Interpreter::safept_table(state); |
|
837 if (SafepointMechanism::uses_thread_local_poll() && table != safepoint_table && generate_poll) { |
837 if (SafepointMechanism::uses_thread_local_poll() && table != safepoint_table && generate_poll) { |
838 NOT_PRODUCT(block_comment("Thread-local Safepoint poll")); |
838 NOT_PRODUCT(block_comment("Thread-local Safepoint poll")); |
839 |
|
840 testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit()); |
839 testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit()); |
841 |
840 |
842 jccb(Assembler::zero, no_safepoint); |
841 jccb(Assembler::zero, no_safepoint); |
843 lea(rscratch1, ExternalAddress((address)safepoint_table)); |
842 lea(rscratch1, ExternalAddress((address)safepoint_table)); |
844 jmpb(dispatch); |
843 jmpb(dispatch); |
849 bind(dispatch); |
848 bind(dispatch); |
850 jmp(Address(rscratch1, rbx, Address::times_8)); |
849 jmp(Address(rscratch1, rbx, Address::times_8)); |
851 |
850 |
852 #else |
851 #else |
853 Address index(noreg, rbx, Address::times_ptr); |
852 Address index(noreg, rbx, Address::times_ptr); |
854 ExternalAddress tbl((address)table); |
853 if (SafepointMechanism::uses_thread_local_poll() && table != safepoint_table && generate_poll) { |
855 ArrayAddress dispatch(tbl, index); |
854 NOT_PRODUCT(block_comment("Thread-local Safepoint poll")); |
856 jump(dispatch); |
855 Label no_safepoint; |
|
856 const Register thread = rcx; |
|
857 get_thread(thread); |
|
858 testb(Address(thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit()); |
|
859 |
|
860 jccb(Assembler::zero, no_safepoint); |
|
861 ArrayAddress dispatch_addr(ExternalAddress((address)safepoint_table), index); |
|
862 jump(dispatch_addr); |
|
863 bind(no_safepoint); |
|
864 } |
|
865 |
|
866 { |
|
867 ArrayAddress dispatch_addr(ExternalAddress((address)table), index); |
|
868 jump(dispatch_addr); |
|
869 } |
857 #endif // _LP64 |
870 #endif // _LP64 |
858 } |
871 } |
859 |
872 |
860 void InterpreterMacroAssembler::dispatch_only(TosState state, bool generate_poll) { |
873 void InterpreterMacroAssembler::dispatch_only(TosState state, bool generate_poll) { |
861 dispatch_base(state, Interpreter::dispatch_table(state), true, generate_poll); |
874 dispatch_base(state, Interpreter::dispatch_table(state), true, generate_poll); |