1061
1062 // The prior sequence "LGR, NGR, LTGR" can be done better
1063 // (Z_R1 is temp and not used after here).
1064 load_const_optimized(Z_R0, (~(os::vm_page_size() - 1) | markWord::lock_mask_in_place));
1065 z_ngr(Z_R0, current_header); // AND sets CC (result eq/ne 0)
1066
1067 // If condition is true we are done and hence we can store 0 in the displaced
1068 // header indicating it is a recursive lock and be done.
1069 z_brne(slow_case);
1070 z_release(); // Member unnecessary on zarch AND because the above csg does a sync before and after.
1071 z_stg(Z_R0/*==0!*/, mark_offset, monitor);
1072 }
1073 z_bru(done);
1074 // } else {
1075 // // Slow path.
1076 // InterpreterRuntime::monitorenter(THREAD, monitor);
1077
1078 // None of the above fast optimizations worked so we have to get into the
1079 // slow case of monitor enter.
1080 bind(slow_case);
1081 if (LockingMode == LM_LIGHTWEIGHT) {
1082 // for lightweight locking we need to use monitorenter_obj, see interpreterRuntime.cpp
1083 call_VM(noreg,
1084 CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter_obj),
1085 object);
1086 } else {
1087 call_VM(noreg,
1088 CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
1089 monitor);
1090 }
1091 // }
1092
1093 bind(done);
1094 }
1095
1096 // Unlocks an object. Used in monitorexit bytecode and remove_activation.
1097 //
1098 // Registers alive
1099 // monitor - address of the BasicObjectLock to be used for locking,
1100 // which must be initialized with the object to lock.
1101 //
1102 // Throw IllegalMonitorException if object is not locked by current thread.
1103 void InterpreterMacroAssembler::unlock_object(Register monitor, Register object) {
1104
1105 if (LockingMode == LM_MONITOR) {
1106 call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), monitor);
1107 return;
1108 }
1109
1110 // else {
|
1061
1062 // The prior sequence "LGR, NGR, LTGR" can be done better
1063 // (Z_R1 is temp and not used after here).
1064 load_const_optimized(Z_R0, (~(os::vm_page_size() - 1) | markWord::lock_mask_in_place));
1065 z_ngr(Z_R0, current_header); // AND sets CC (result eq/ne 0)
1066
1067 // If condition is true we are done and hence we can store 0 in the displaced
1068 // header indicating it is a recursive lock and be done.
1069 z_brne(slow_case);
1070 z_release(); // Member unnecessary on zarch AND because the above csg does a sync before and after.
1071 z_stg(Z_R0/*==0!*/, mark_offset, monitor);
1072 }
1073 z_bru(done);
1074 // } else {
1075 // // Slow path.
1076 // InterpreterRuntime::monitorenter(THREAD, monitor);
1077
1078 // None of the above fast optimizations worked so we have to get into the
1079 // slow case of monitor enter.
1080 bind(slow_case);
1081 call_VM(noreg,
1082 CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
1083 monitor);
1084 // }
1085
1086 bind(done);
1087 }
1088
1089 // Unlocks an object. Used in monitorexit bytecode and remove_activation.
1090 //
1091 // Registers alive
1092 // monitor - address of the BasicObjectLock to be used for locking,
1093 // which must be initialized with the object to lock.
1094 //
1095 // Throw IllegalMonitorException if object is not locked by current thread.
1096 void InterpreterMacroAssembler::unlock_object(Register monitor, Register object) {
1097
1098 if (LockingMode == LM_MONITOR) {
1099 call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), monitor);
1100 return;
1101 }
1102
1103 // else {
|