RFR: 8336874: WhiteBoxAPI: assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native())) failed: cannot compile abstract/native methods

Leonid Mesnik lmesnik at openjdk.org
Mon Sep 16 15:39:04 UTC 2024


On Thu, 12 Sep 2024 19:47:47 GMT, Sonia Zaldana Calles <szaldana at openjdk.org> wrote:

> Hi all, 
> 
> This PR addresses [8336874](https://bugs.openjdk.org/browse/JDK-8336874) ensuring enqueuing an abstract method for compilation doesn't hit an assert with WhiteBox. 
> 
> Testing: 
> - [x] Added test case passes. 
> 
> Thanks, 
> Sonia

The overall fix looks good, see small test suggestion in comment.

test/hotspot/jtreg/compiler/whitebox/TestCompileAbstractMethod.java line 48:

> 46:         assert m1 != null;
> 47:         WHITE_BOX.enqueueMethodForCompilation(m1, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
> 48:         if (WHITE_BOX.isMethodCompiled(m1)) {

I think it is better to check that 'enqueueMethodForCompilation' returns false for abstract method additionally.
The isMethodCompiled should always returns true even if WB try to push abstract method but it is rejected on later steps.

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

Marked as reviewed by lmesnik (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20973#pullrequestreview-2307026060
PR Review Comment: https://git.openjdk.org/jdk/pull/20973#discussion_r1761390168


More information about the hotspot-dev mailing list