[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-dev
Subject:    Integrated: 8263582: WB_IsMethodCompilable ignores compiler directives
From:       Christian Hagedorn <chagedorn () openjdk ! java ! net>
Date:       2021-03-31 6:37:20
Message-ID: 9i4F0Rh6cNhPdKc1ogTnAnensKAv0gGGJKzgysDanuk=.c6bbd27e-0ee7-4ab9-b07e-0bc877267d0c () github ! com
[Download RAW message or body]

On Thu, 25 Mar 2021 15:00:39 GMT, Christian Hagedorn <chagedorn@openjdk.org> wrote:

> While playing around with `WB_IsMethodCompilable` together with `compileonly` I ran \
> into some surprising results for methods that should never be compiled (not part of \
> `compileonly`): `isMethodCompilable` returns true instead of false when such an \
> excluded method was not yet tried to be compiled.  
> The reason for it is that `WB_IsMethodCompilable` directly checks \
> `CompilationPolicy::can_be_compiled()` which calls `Method::is_not_compilable()`. \
> However, the `ExcludeOption` compiler directive is only evaluated lazily upon a \
> compilation attempt. Therefore, if a method was not tried to be compiled, yet, \
> `Method::is_not_compilable()` always returns false, regardless of any set compiler \
> directive. 
> I therefore suggest to additionally check the `ExcludeOption` in \
> `WB_IsMethodCompilable`. I also cleaned up some wrong use of `CompLevel_any` and \
> `CompLevel_all` as suggested by @veresov: `CompLevel_any` should only be used to \
> query the state as in `is_*()` methods and `CompLevel_all` when changing the state \
> is in `set_*()` methods. 
> Thanks,
> Christian

This pull request has now been integrated.

Changeset: ab6faa60
Author:    Christian Hagedorn <chagedorn@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/ab6faa60
Stats:     141 lines in 5 files changed: 128 ins; 0 del; 13 mod

8263582: WB_IsMethodCompilable ignores compiler directives

Reviewed-by: iveresov, kvn, neliasso

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic