RFR: 8308583: SIGSEGV in GraphKit::gen_checkcast

Vladimir Kozlov kvn at openjdk.org
Thu May 25 15:54:56 UTC 2023


On Wed, 24 May 2023 12:31:37 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> At an `instanceof`, a node of type `bottom[int:>=0]` is checked to be of type `cc$Word` and on the success a `CheckCastPP` is inserted to change the node type. That `CheckCastPP` constant folds to `top` but the type check doesn't fold. The reason is that the type check loads the klass from the node with a `LoadNKlass` and the type of that node is `java/lang/Object`  when it should be `bottom[int:>=0]` but logic in `LoadNKlass::Value()` gets in the way.

In addition to normal mach5 testing we need to run our stress testing too for this changes to run with `StressReflectiveCode` on.

src/hotspot/share/opto/graphKit.cpp line 3525:

> 3523:   if (!StressReflectiveCode && inst_klass != nullptr) {
> 3524:     bool    xklass = inst_klass->klass_is_exact();
> 3525:     if (xklass || (inst_klass->isa_aryklassptr() && inst_klass->is_aryklassptr()->elem() != Type::BOTTOM)) {

Can you rename `inst_klass` to `klass_ptr` because it is general klass. It is weird to see a check like `inst_klass->isa_aryklassptr()`.

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

PR Review: https://git.openjdk.org/jdk/pull/14123#pullrequestreview-1444202237
PR Review Comment: https://git.openjdk.org/jdk/pull/14123#discussion_r1205715640


More information about the hotspot-compiler-dev mailing list