826 new_illegal_monitor_state_exception));
827 }
828 z_bru(restart);
829 }
830
831 bind(loop);
832 // Check if current entry is used.
833 load_and_test_long(Z_R0_scratch, Address(R_current_monitor, BasicObjectLock::obj_offset_in_bytes()));
834 z_brne(exception);
835
836 add2reg(R_current_monitor, entry_size); // Otherwise advance to next entry.
837 bind(entry);
838 compareU64_and_branch(R_current_monitor, R_monitor_block_bot, bcondNotEqual, loop);
839 }
840
841 bind(no_unlock);
842 pop(state);
843 verify_oop(Z_tos, state);
844 }
845
846 // remove activation
847 //
848 // Unlock the receiver if this is a synchronized method.
849 // Unlock any Java monitors from syncronized blocks.
850 // Remove the activation from the stack.
851 //
852 // If there are locked Java monitors
853 // If throw_monitor_exception
854 // throws IllegalMonitorStateException
855 // Else if install_monitor_exception
856 // installs IllegalMonitorStateException
857 // Else
858 // no error processing
859 void InterpreterMacroAssembler::remove_activation(TosState state,
860 Register return_pc,
861 bool throw_monitor_exception,
862 bool install_monitor_exception,
863 bool notify_jvmti) {
864 BLOCK_COMMENT("remove_activation {");
865 unlock_if_synchronized_method(state, throw_monitor_exception, install_monitor_exception);
|
826 new_illegal_monitor_state_exception));
827 }
828 z_bru(restart);
829 }
830
831 bind(loop);
832 // Check if current entry is used.
833 load_and_test_long(Z_R0_scratch, Address(R_current_monitor, BasicObjectLock::obj_offset_in_bytes()));
834 z_brne(exception);
835
836 add2reg(R_current_monitor, entry_size); // Otherwise advance to next entry.
837 bind(entry);
838 compareU64_and_branch(R_current_monitor, R_monitor_block_bot, bcondNotEqual, loop);
839 }
840
841 bind(no_unlock);
842 pop(state);
843 verify_oop(Z_tos, state);
844 }
845
846 void InterpreterMacroAssembler::narrow(Register result, Register ret_type) {
847 get_method(ret_type);
848 z_lg(ret_type, Address(ret_type, in_bytes(Method::const_offset())));
849 z_lb(ret_type, Address(ret_type, in_bytes(ConstMethod::result_type_offset())));
850
851 Label notBool, notByte, notChar, done;
852
853 // common case first
854 compareU32_and_branch(ret_type, T_INT, bcondEqual, done);
855
856 compareU32_and_branch(ret_type, T_BOOLEAN, bcondNotEqual, notBool);
857 z_nilf(result, 0x1);
858 z_bru(done);
859
860 bind(notBool);
861 compareU32_and_branch(ret_type, T_BYTE, bcondNotEqual, notByte);
862 z_lbr(result, result);
863 z_bru(done);
864
865 bind(notByte);
866 compareU32_and_branch(ret_type, T_CHAR, bcondNotEqual, notChar);
867 z_nilf(result, 0xffff);
868 z_bru(done);
869
870 bind(notChar);
871 // compareU32_and_branch(ret_type, T_SHORT, bcondNotEqual, notShort);
872 z_lhr(result, result);
873
874 // Nothing to do for T_INT
875 bind(done);
876 }
877
878 // remove activation
879 //
880 // Unlock the receiver if this is a synchronized method.
881 // Unlock any Java monitors from syncronized blocks.
882 // Remove the activation from the stack.
883 //
884 // If there are locked Java monitors
885 // If throw_monitor_exception
886 // throws IllegalMonitorStateException
887 // Else if install_monitor_exception
888 // installs IllegalMonitorStateException
889 // Else
890 // no error processing
891 void InterpreterMacroAssembler::remove_activation(TosState state,
892 Register return_pc,
893 bool throw_monitor_exception,
894 bool install_monitor_exception,
895 bool notify_jvmti) {
896 BLOCK_COMMENT("remove_activation {");
897 unlock_if_synchronized_method(state, throw_monitor_exception, install_monitor_exception);
|