Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
/ jdk22u Public archive

Commit

Permalink
8330011: [s390x] update block-comments to make code consistent
Browse files Browse the repository at this point in the history
Backport-of: 01bda278d6a498ca89c0bc5218680cd51a04e9d3
  • Loading branch information
offamitkumar authored and shipilev committed Apr 22, 2024
1 parent 52b43e9 commit bde0fad
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
32 changes: 17 additions & 15 deletions src/hotspot/cpu/s390/downcallLinker_s390.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -138,10 +138,10 @@ void DowncallLinker::StubGenerator::generate() {
locs.set(StubLocations::TARGET_ADDRESS, _abi._scratch2);

if (_captured_state_mask != 0) {
__ block_comment("{ _captured_state_mask is set");
__ block_comment("_captured_state_mask_is_set {");
locs.set_frame_data(StubLocations::CAPTURED_STATE_BUFFER, allocated_frame_size);
allocated_frame_size += BytesPerWord;
__ block_comment("} _captured_state_mask is set");
__ block_comment("} _captured_state_mask_is_set");
}

VMStorage shuffle_reg = _abi._scratch1;
Expand Down Expand Up @@ -176,7 +176,7 @@ void DowncallLinker::StubGenerator::generate() {
_frame_complete = __ pc() - start; // frame build complete.

if (_needs_transition) {
__ block_comment("{ thread java2native");
__ block_comment("thread_java2native {");
__ get_PC(Z_R1_scratch);
address the_pc = __ pc();
__ set_last_Java_frame(Z_SP, Z_R1_scratch);
Expand All @@ -186,21 +186,21 @@ void DowncallLinker::StubGenerator::generate() {

// State transition
__ set_thread_state(_thread_in_native);
__ block_comment("} thread java2native");
__ block_comment("} thread_java2native");
}
if (has_objects) {
add_offsets_to_oops(java_regs, _abi._scratch1, _abi._scratch2);
}
__ block_comment("{ argument shuffle");
__ block_comment("argument shuffle {");
arg_shuffle.generate(_masm, shuffle_reg, frame::z_jit_out_preserve_size, _abi._shadow_space_bytes);
__ block_comment("} argument shuffle");
__ block_comment("} argument_shuffle");

__ call(as_Register(locs.get(StubLocations::TARGET_ADDRESS)));

//////////////////////////////////////////////////////////////////////////////

if (_captured_state_mask != 0) {
__ block_comment("{ save thread local");
__ block_comment("save_thread_local {");

out_reg_spiller.generate_spill(_masm, spill_offset);

Expand All @@ -211,7 +211,7 @@ void DowncallLinker::StubGenerator::generate() {

out_reg_spiller.generate_fill(_masm, spill_offset);

__ block_comment("} save thread local");
__ block_comment("} save_thread_local");
}

//////////////////////////////////////////////////////////////////////////////
Expand All @@ -222,7 +222,7 @@ void DowncallLinker::StubGenerator::generate() {
Label L_after_reguard;

if (_needs_transition) {
__ block_comment("{ thread native2java");
__ block_comment("thread_native2java {");
__ set_thread_state(_thread_in_native_trans);

if (!UseSystemMemoryBarrier) {
Expand All @@ -239,10 +239,12 @@ void DowncallLinker::StubGenerator::generate() {
// change thread state
__ set_thread_state(_thread_in_Java);

__ block_comment("reguard stack check");
__ z_cli(Address(Z_thread, JavaThread::stack_guard_state_offset() + in_ByteSize(sizeof(StackOverflow::StackGuardState) - 1)),
StackOverflow::stack_guard_yellow_reserved_disabled);
__ block_comment("reguard_stack_check {");
__ z_cli(Address(Z_thread,
JavaThread::stack_guard_state_offset() + in_ByteSize(sizeof(StackOverflow::StackGuardState) - 1)),
StackOverflow::stack_guard_yellow_reserved_disabled);
__ z_bre(L_reguard);
__ block_comment("} reguard_stack_check");
__ bind(L_after_reguard);

__ reset_last_Java_frame();
Expand All @@ -256,7 +258,7 @@ void DowncallLinker::StubGenerator::generate() {
//////////////////////////////////////////////////////////////////////////////

if (_needs_transition) {
__ block_comment("{ L_safepoint_poll_slow_path");
__ block_comment("L_safepoint_poll_slow_path {");
__ bind(L_safepoint_poll_slow_path);

// Need to save the native result registers around any runtime calls.
Expand All @@ -272,7 +274,7 @@ void DowncallLinker::StubGenerator::generate() {
__ block_comment("} L_safepoint_poll_slow_path");

//////////////////////////////////////////////////////////////////////////////
__ block_comment("{ L_reguard");
__ block_comment("L_reguard {");
__ bind(L_reguard);

// Need to save the native result registers around any runtime calls.
Expand Down
20 changes: 10 additions & 10 deletions src/hotspot/cpu/s390/upcallLinker_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void preserve_callee_saved_registers(MacroAssembler* _masm, const ABIDesc

int offset = reg_save_area_offset;

__ block_comment("{ preserve_callee_saved_regs ");
__ block_comment("preserve_callee_saved_regs {");
for (int i = 0; i < Register::number_of_registers; i++) {
Register reg = as_Register(i);
// Z_SP saved/restored by prologue/epilogue
Expand All @@ -82,7 +82,7 @@ static void preserve_callee_saved_registers(MacroAssembler* _masm, const ABIDesc
}
}

__ block_comment("} preserve_callee_saved_regs ");
__ block_comment("} preserve_callee_saved_regs");
}

static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescriptor& abi, int reg_save_area_offset) {
Expand All @@ -92,7 +92,7 @@ static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescr

int offset = reg_save_area_offset;

__ block_comment("{ restore_callee_saved_regs ");
__ block_comment("restore_callee_saved_regs {");
for (int i = 0; i < Register::number_of_registers; i++) {
Register reg = as_Register(i);
// Z_SP saved/restored by prologue/epilogue
Expand All @@ -111,7 +111,7 @@ static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescr
}
}

__ block_comment("} restore_callee_saved_regs ");
__ block_comment("} restore_callee_saved_regs");
}

static const int upcall_stub_code_base_size = 1024;
Expand Down Expand Up @@ -203,7 +203,7 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry,
// Java methods won't preserve them, so save them here:
preserve_callee_saved_registers(_masm, abi, reg_save_area_offset);

__ block_comment("{ on_entry");
__ block_comment("on_entry {");
__ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_entry));
__ z_aghik(Z_ARG1, Z_SP, frame_data_offset);
__ load_const_optimized(Z_ARG2, (intptr_t)receiver);
Expand All @@ -212,13 +212,13 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry,
__ block_comment("} on_entry");

arg_spiller.generate_fill(_masm, arg_save_area_offset);
__ block_comment("{ argument shuffle");
__ block_comment("argument_shuffle {");
arg_shuffle.generate(_masm, shuffle_reg, abi._shadow_space_bytes, frame::z_jit_out_preserve_size);
__ block_comment("} argument shuffle");
__ block_comment("} argument_shuffle");

__ block_comment("{ receiver ");
__ block_comment("receiver {");
__ get_vm_result(Z_ARG1);
__ block_comment("} receiver ");
__ block_comment("} receiver");

__ load_const_optimized(Z_method, (intptr_t)entry);
__ z_stg(Z_method, Address(Z_thread, in_bytes(JavaThread::callee_target_offset())));
Expand Down Expand Up @@ -254,7 +254,7 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry,

result_spiller.generate_spill(_masm, res_save_area_offset);

__ block_comment("{ on_exit");
__ block_comment("on_exit {");
__ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_exit));
__ z_aghik(Z_ARG1, Z_SP, frame_data_offset);
__ call(call_target_address);
Expand Down

1 comment on commit bde0fad

@openjdk-notifier
Copy link

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.