RFR: 8365047: Remove exception handler stub code in C2 [v4]

Ruben duke at openjdk.org
Wed Sep 24 23:13:30 UTC 2025


On Wed, 24 Sep 2025 09:13:44 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> Ruben has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Offset the deoptimization handler entry point
>>    
>>    Change-Id: I596317ec6a364b341e4642636fa5cf08f87ed722
>>  - Revert "Ensure stub code is not adjacent to a call"
>
> Right, it works after adapting C1 deopt handler (see below). So, you convinced me that your new solution is better. Please don't add Copyright headers everywhere. Arm has contributed less than 1% of ppc.ad. I don't think that justifies a Copyright for the whole file. We don't want everyone's Copyright in every file.
> 
> Thanks a lot for debugging the issue!
> 
> 
> diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
> index 3ca75305eca..fe735c8831b 100644
> --- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
> +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
> @@ -263,13 +263,17 @@ int LIR_Assembler::emit_deopt_handler() {
>      return -1;
>    }
>  
> -  int offset = code_offset();
> +  Label start;
> +
> +  __ bind(start);
>    __ bl64_patchable(SharedRuntime::deopt_blob()->unpack(), relocInfo::runtime_call_type);
> +  int entry_point = __ offset();
> +  __ b(start);
>  
> -  guarantee(code_offset() - offset <= deopt_handler_size(), "overflow");
> +  guarantee(code_offset() - entry_point <= deopt_handler_size(), "overflow");
>    __ end_a_stub();
>  
> -  return offset;
> +  return entry_point;
>  }
>  
>  
> diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad
> index 1f6819c4bf6..9473dd3d57b 100644
> --- a/src/hotspot/cpu/ppc/ppc.ad
> +++ b/src/hotspot/cpu/ppc/ppc.ad
> @@ -1,7 +1,6 @@
>  //
>  // Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
>  // Copyright (c) 2012, 2025 SAP SE. All rights reserved.
> -// Copyright 2025 Arm Limited and/or its affiliates.
>  // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
>  //
>  // This code is free software; you can redistribute it and/or modify it
> diff --git a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
> index ced1b38541b..3d037540766 100644
> --- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
> +++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
> @@ -2965,7 +2965,6 @@ void SharedRuntime::generate_deopt_blob() {
>    // The return_pc has been stored in the frame of the deoptee and
>    // will replace the address of the deopt_handler in the call
>    // to Deoptimization::fetch_unroll_info below.
> -  const int return_pc_adjustment_no_exception = -MacroAssembler::bl64_patchable_size;
>  
>    // Push the "unpack frame"
>    // Save everything in sight.

Thank you @TheRealMDoerr, @offamitkumar, @bulasevich, @adinn,

I think, in my local version the `nmethod::scope_desc_at` issues are solved. I'm planning to share it soon - after some more testing.

@TheRealMDoerr, I will update the patch as you suggested.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3330979850


More information about the hotspot-dev mailing list