891 MacroAssembler::cmpxchgx_hint_acquire_lock(),
892 noreg,
893 &cas_failed);
894
895 // If the compare-and-exchange succeeded, then we found an unlocked
896 // object and we have now locked it.
897 b(done);
898 bind(cas_failed);
899
900 // } else if (THREAD->is_lock_owned((address)displaced_header))
901 // // Simple recursive case.
902 // monitor->lock()->set_displaced_header(NULL);
903
904 // We did not see an unlocked object so try the fast recursive case.
905
906 // Check if owner is self by comparing the value in the markOop of object
907 // (current_header) with the stack pointer.
908 sub(current_header, current_header, R1_SP);
909
910 assert(os::vm_page_size() > 0xfff, "page size too small - change the constant");
911 load_const_optimized(tmp,
912 (address) (~(os::vm_page_size()-1) |
913 markOopDesc::lock_mask_in_place));
914
915 and_(R0/*==0?*/, current_header, tmp);
916 // If condition is true we are done and hence we can store 0 in the displaced
917 // header indicating it is a recursive lock.
918 bne(CCR0, slow_case);
919 release();
920 std(R0/*==0!*/, BasicObjectLock::lock_offset_in_bytes() +
921 BasicLock::displaced_header_offset_in_bytes(), monitor);
922 b(done);
923
924 // } else {
925 // // Slow path.
926 // InterpreterRuntime::monitorenter(THREAD, monitor);
927
928 // None of the above fast optimizations worked so we have to get into the
929 // slow case of monitor enter.
930 bind(slow_case);
931 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
932 monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false));
933 // }
|
891 MacroAssembler::cmpxchgx_hint_acquire_lock(),
892 noreg,
893 &cas_failed);
894
895 // If the compare-and-exchange succeeded, then we found an unlocked
896 // object and we have now locked it.
897 b(done);
898 bind(cas_failed);
899
900 // } else if (THREAD->is_lock_owned((address)displaced_header))
901 // // Simple recursive case.
902 // monitor->lock()->set_displaced_header(NULL);
903
904 // We did not see an unlocked object so try the fast recursive case.
905
906 // Check if owner is self by comparing the value in the markOop of object
907 // (current_header) with the stack pointer.
908 sub(current_header, current_header, R1_SP);
909
910 assert(os::vm_page_size() > 0xfff, "page size too small - change the constant");
911 load_const_optimized(tmp, ~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place);
912
913 and_(R0/*==0?*/, current_header, tmp);
914 // If condition is true we are done and hence we can store 0 in the displaced
915 // header indicating it is a recursive lock.
916 bne(CCR0, slow_case);
917 release();
918 std(R0/*==0!*/, BasicObjectLock::lock_offset_in_bytes() +
919 BasicLock::displaced_header_offset_in_bytes(), monitor);
920 b(done);
921
922 // } else {
923 // // Slow path.
924 // InterpreterRuntime::monitorenter(THREAD, monitor);
925
926 // None of the above fast optimizations worked so we have to get into the
927 // slow case of monitor enter.
928 bind(slow_case);
929 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
930 monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false));
931 // }
|