Skip to content

Commit

Permalink
8330011: [s390x] update block-comments to make code consistent
Browse files Browse the repository at this point in the history
Reviewed-by: lucy
  • Loading branch information
offamitkumar committed Apr 17, 2024
1 parent 2fe2f3a commit 01bda27
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

7 comments on commit 01bda27

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@offamitkumar
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk22u

@openjdk
Copy link

@openjdk openjdk bot commented on 01bda27 Apr 17, 2024

Choose a reason for hiding this comment

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

@offamitkumar the backport was successfully created on the branch backport-offamitkumar-01bda278 in my personal fork of openjdk/jdk22u. To create a pull request with this backport targeting openjdk/jdk22u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 01bda278 from the openjdk/jdk repository.

The commit being backported was authored by Amit Kumar on 17 Apr 2024 and was reviewed by Lutz Schmidt.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk22u:

$ git fetch https://github.com/openjdk-bots/jdk22u.git backport-offamitkumar-01bda278:backport-offamitkumar-01bda278
$ git checkout backport-offamitkumar-01bda278
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk22u.git backport-offamitkumar-01bda278

⚠️ @offamitkumar You are not yet a collaborator in my fork openjdk-bots/jdk22u. An invite will be sent out and you need to accept it before you can proceed.

@offamitkumar
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 01bda27 Apr 18, 2024

Choose a reason for hiding this comment

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

@offamitkumar Could not automatically backport 01bda278 to openjdk/jdk21u-dev due to conflicts in the following files:

  • src/hotspot/cpu/s390/downcallLinker_s390.cpp
  • src/hotspot/cpu/s390/upcallLinker_s390.cpp

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk21u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk21u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b backport-offamitkumar-01bda278

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git 01bda278d6a498ca89c0bc5218680cd51a04e9d3

# Backport the commit
$ git cherry-pick --no-commit 01bda278d6a498ca89c0bc5218680cd51a04e9d3
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 01bda278d6a498ca89c0bc5218680cd51a04e9d3'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk21u-dev with the title Backport 01bda278d6a498ca89c0bc5218680cd51a04e9d3.

Below you can find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 01bda278 from the openjdk/jdk repository.

The commit being backported was authored by Amit Kumar on 17 Apr 2024 and was reviewed by Lutz Schmidt.

Thanks!

@offamitkumar
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 01bda27 Apr 27, 2024

Choose a reason for hiding this comment

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

@offamitkumar Could not automatically backport 01bda278 to openjdk/jdk21u-dev due to conflicts in the following files:

  • src/hotspot/cpu/s390/downcallLinker_s390.cpp
  • src/hotspot/cpu/s390/upcallLinker_s390.cpp

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk21u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk21u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b backport-offamitkumar-01bda278

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git 01bda278d6a498ca89c0bc5218680cd51a04e9d3

# Backport the commit
$ git cherry-pick --no-commit 01bda278d6a498ca89c0bc5218680cd51a04e9d3
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 01bda278d6a498ca89c0bc5218680cd51a04e9d3'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk21u-dev with the title Backport 01bda278d6a498ca89c0bc5218680cd51a04e9d3.

Below you can find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 01bda278 from the openjdk/jdk repository.

The commit being backported was authored by Amit Kumar on 17 Apr 2024 and was reviewed by Lutz Schmidt.

Thanks!

Please sign in to comment.