718 put_code,
719 info.field_holder(),
720 info.index(),
721 info.offset(),
722 state,
723 info.access_flags().is_final(),
724 info.access_flags().is_volatile()
725 );
726 }
727
728
729 //------------------------------------------------------------------------------------------------------------------------
730 // Synchronization
731 //
732 // The interpreter's synchronization code is factored out so that it can
733 // be shared by method invocation and synchronized blocks.
734 //%note synchronization_3
735
736 //%note monitor_1
737 JRT_ENTRY_NO_ASYNC(void, InterpreterRuntime::monitorenter(JavaThread* current, BasicObjectLock* elem))
738 #ifdef ASSERT
739 current->last_frame().interpreter_frame_verify_monitor(elem);
740 #endif
741 Handle h_obj(current, elem->obj());
742 assert(Universe::heap()->is_in_or_null(h_obj()),
743 "must be null or an object");
744 ObjectSynchronizer::enter(h_obj, elem->lock(), current);
745 assert(Universe::heap()->is_in_or_null(elem->obj()),
746 "must be null or an object");
747 #ifdef ASSERT
748 current->last_frame().interpreter_frame_verify_monitor(elem);
749 #endif
750 JRT_END
751
752
753 JRT_LEAF(void, InterpreterRuntime::monitorexit(BasicObjectLock* elem))
754 oop obj = elem->obj();
755 assert(Universe::heap()->is_in(obj), "must be an object");
756 // The object could become unlocked through a JNI call, which we have no other checks for.
757 // Give a fatal message if CheckJNICalls. Otherwise we ignore it.
|
718 put_code,
719 info.field_holder(),
720 info.index(),
721 info.offset(),
722 state,
723 info.access_flags().is_final(),
724 info.access_flags().is_volatile()
725 );
726 }
727
728
729 //------------------------------------------------------------------------------------------------------------------------
730 // Synchronization
731 //
732 // The interpreter's synchronization code is factored out so that it can
733 // be shared by method invocation and synchronized blocks.
734 //%note synchronization_3
735
736 //%note monitor_1
737 JRT_ENTRY_NO_ASYNC(void, InterpreterRuntime::monitorenter(JavaThread* current, BasicObjectLock* elem))
738 if (!UseHeavyMonitors && UseFastLocking) {
739 // This is a hack to get around the limitation of registers in x86_32. We really
740 // send an oopDesc* instead of a BasicObjectLock*.
741 Handle h_obj(current, oop((reinterpret_cast<oopDesc*>(elem))));
742 assert(Universe::heap()->is_in_or_null(h_obj()),
743 "must be NULL or an object");
744 ObjectSynchronizer::enter(h_obj, NULL, current);
745 return;
746 }
747 #ifdef ASSERT
748 current->last_frame().interpreter_frame_verify_monitor(elem);
749 #endif
750 Handle h_obj(current, elem->obj());
751 assert(Universe::heap()->is_in_or_null(h_obj()),
752 "must be null or an object");
753 ObjectSynchronizer::enter(h_obj, elem->lock(), current);
754 assert(Universe::heap()->is_in_or_null(elem->obj()),
755 "must be null or an object");
756 #ifdef ASSERT
757 current->last_frame().interpreter_frame_verify_monitor(elem);
758 #endif
759 JRT_END
760
761
762 JRT_LEAF(void, InterpreterRuntime::monitorexit(BasicObjectLock* elem))
763 oop obj = elem->obj();
764 assert(Universe::heap()->is_in(obj), "must be an object");
765 // The object could become unlocked through a JNI call, which we have no other checks for.
766 // Give a fatal message if CheckJNICalls. Otherwise we ignore it.
|