< prev index next >

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

Print this page

1026       sub(current_header, current_header, R1_SP);
1027 
1028       assert(os::vm_page_size() > 0xfff, "page size too small - change the constant");
1029       load_const_optimized(tmp, ~(os::vm_page_size()-1) | markWord::lock_mask_in_place);
1030 
1031       and_(R0/*==0?*/, current_header, tmp);
1032       // If condition is true we are done and hence we can store 0 in the displaced
1033       // header indicating it is a recursive lock.
1034       bne(CCR0, slow_case);
1035       std(R0/*==0!*/, mark_offset, monitor);
1036       b(count_locking);
1037     }
1038 
1039     // } else {
1040     //   // Slow path.
1041     //   InterpreterRuntime::monitorenter(THREAD, monitor);
1042 
1043     // None of the above fast optimizations worked so we have to get into the
1044     // slow case of monitor enter.
1045     bind(slow_case);
1046     if (LockingMode == LM_LIGHTWEIGHT) {
1047       call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter_obj), object);
1048     } else {
1049       call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter), monitor);
1050     }
1051     b(done);
1052     // }
1053     align(32, 12);
1054     bind(count_locking);
1055     inc_held_monitor_count(current_header /*tmp*/);
1056     bind(done);
1057   }
1058 }
1059 
1060 // Unlocks an object. Used in monitorexit bytecode and remove_activation.
1061 //
1062 // Registers alive
1063 //   monitor - Address of the BasicObjectLock to be used for locking,
1064 //             which must be initialized with the object to lock.
1065 //
1066 // Throw IllegalMonitorException if object is not locked by current thread.
1067 void InterpreterMacroAssembler::unlock_object(Register monitor) {
1068   if (LockingMode == LM_MONITOR) {
1069     call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), monitor);
1070   } else {

1026       sub(current_header, current_header, R1_SP);
1027 
1028       assert(os::vm_page_size() > 0xfff, "page size too small - change the constant");
1029       load_const_optimized(tmp, ~(os::vm_page_size()-1) | markWord::lock_mask_in_place);
1030 
1031       and_(R0/*==0?*/, current_header, tmp);
1032       // If condition is true we are done and hence we can store 0 in the displaced
1033       // header indicating it is a recursive lock.
1034       bne(CCR0, slow_case);
1035       std(R0/*==0!*/, mark_offset, monitor);
1036       b(count_locking);
1037     }
1038 
1039     // } else {
1040     //   // Slow path.
1041     //   InterpreterRuntime::monitorenter(THREAD, monitor);
1042 
1043     // None of the above fast optimizations worked so we have to get into the
1044     // slow case of monitor enter.
1045     bind(slow_case);
1046     call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter), monitor);




1047     b(done);
1048     // }
1049     align(32, 12);
1050     bind(count_locking);
1051     inc_held_monitor_count(current_header /*tmp*/);
1052     bind(done);
1053   }
1054 }
1055 
1056 // Unlocks an object. Used in monitorexit bytecode and remove_activation.
1057 //
1058 // Registers alive
1059 //   monitor - Address of the BasicObjectLock to be used for locking,
1060 //             which must be initialized with the object to lock.
1061 //
1062 // Throw IllegalMonitorException if object is not locked by current thread.
1063 void InterpreterMacroAssembler::unlock_object(Register monitor) {
1064   if (LockingMode == LM_MONITOR) {
1065     call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), monitor);
1066   } else {
< prev index next >