Skip to content
Permalink
Browse files
8253740: [PPC64] Minor interpreter cleanup
Reviewed-by: lucy
  • Loading branch information
TheRealMDoerr committed Oct 9, 2020
1 parent b1448da commit e9c1905bd0c9b3dadf3cb458af103669bff6d1ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
@@ -211,7 +211,7 @@ class InterpreterMacroAssembler: public MacroAssembler {

// Object locking
void lock_object (Register lock_reg, Register obj_reg);
void unlock_object(Register lock_reg, bool check_for_exceptions = true);
void unlock_object(Register lock_reg);

// Interpreter profiling operations
void set_method_data_pointer_for_bcp();
@@ -878,8 +878,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
//
void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
if (UseHeavyMonitors) {
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
monitor, /*check_for_exceptions=*/true);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter), monitor);
} else {
// template code:
//
@@ -980,8 +979,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
// None of the above fast optimizations worked so we have to get into the
// slow case of monitor enter.
bind(slow_case);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
monitor, /*check_for_exceptions=*/true);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter), monitor);
// }
align(32, 12);
bind(done);
@@ -995,7 +993,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
// which must be initialized with the object to lock.
//
// Throw IllegalMonitorException if object is not locked by current thread.
void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_exceptions) {
void InterpreterMacroAssembler::unlock_object(Register monitor) {
if (UseHeavyMonitors) {
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), monitor);
} else {
@@ -2401,8 +2399,7 @@ void InterpreterMacroAssembler::notify_method_entry() {
lwz(R0, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
cmpwi(CCR0, R0, 0);
beq(CCR0, jvmti_post_done);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry),
/*check_exceptions=*/true);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry));

bind(jvmti_post_done);
}
@@ -2437,8 +2434,7 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta
cmpwi(CCR0, R0, 0);
beq(CCR0, jvmti_post_done);
if (!is_native_method) { push(state); } // Expose tos to GC.
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit),
/*check_exceptions=*/check_exceptions);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit), check_exceptions);
if (!is_native_method) { pop(state); }

align(32, 12);
@@ -1549,9 +1549,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Handle exceptions

if (synchronized) {
// Don't check for exceptions since we're still in the i2n frame. Do that
// manually afterwards.
__ unlock_object(R26_monitor, false); // Can also unlock methods.
__ unlock_object(R26_monitor); // Can also unlock methods.
}

// Reset active handles after returning from native.
@@ -1592,9 +1590,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
BIND(exception_return_sync_check);

if (synchronized) {
// Don't check for exceptions since we're still in the i2n frame. Do that
// manually afterwards.
__ unlock_object(R26_monitor, false); // Can also unlock methods.
__ unlock_object(R26_monitor); // Can also unlock methods.
}
BIND(exception_return_sync_check_already_unlocked);

@@ -2105,7 +2101,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
// Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
__ ld(R4_ARG2, 0, R18_locals);
__ call_VM(R4_ARG2, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), R4_ARG2, R19_method, R14_bcp);
__ restore_interpreter_state(R11_scratch1, /*bcp_and_mdx_only*/ true);

__ cmpdi(CCR0, R4_ARG2, 0);
__ beq(CCR0, L_done);
__ std(R4_ARG2, wordSize, R15_esp);

1 comment on commit e9c1905

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on e9c1905 Oct 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.