RFR: 8285378: Remove unnecessary nop for C1 exception and deopt handler

Boris Ulasevich bulasevich at openjdk.java.net
Mon May 2 20:22:23 UTC 2022


On Fri, 29 Apr 2022 20:54:43 GMT, Dean Long <dlong at openjdk.org> wrote:

> @bulasevich , are you sure the code pattern described in the comment is no longer a problem?
> call [...]
> [Exception Handler]
> (PC from call will be here, inside exception handler)

Yes, I am pretty sure. I followed the description provided for the nop. These nops (see the assembly listing above) are actually placed not before the [Exception Handler] as expected, but in the C1 code section, in between [[slow case stubs + optionally(exception adapters)]](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/c1/c1_Compilation.cpp#L290) and the [unwind handler]. I did not found the assertion mentioned in the description either by eye or by running tests on different platforms.

> Now that 8172844 has relaxed a related assert, it is probably safe to remove these NOPs now.

I believe JDK-8172844 was a C2 issue. Looking to [that change](http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/c576bd949a9d), I think it would be good to remove the unused methods:
- [CompiledMethod::insts_contains](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/code/compiledMethod.hpp#L268)
- [nmethod::is_patchable_at](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/code/nmethod.cpp#L2301)
- [CodeBuffer::insts_contains, CodeBuffer::insts_contains2](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/asm/codeBuffer.hpp#L599)

though, I feel it should be a separate change.

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

PR: https://git.openjdk.java.net/jdk/pull/8341


More information about the hotspot-compiler-dev mailing list