RFR: 8280473: CI: Support unresolved JVM_CONSTANT_Dynamic constant pool entries

Vladimir Ivanov vlivanov at openjdk.java.net
Fri Feb 11 10:34:05 UTC 2022


On Thu, 10 Feb 2022 22:50:56 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Properly support unresolved CONSTANT_Dynamic CP entries in C1/C2.
>> 
>> Right now, both compilers bail out the compilation when they encounter a single unresolved dynamic constant. It forces users to do eager resolution which defeats the whole purpose of using dynamic constants. 
>> 
>> The patch is focused on C1 and enables code patching for dynamic constants, but there are minor C2-specific changes to avoid compilation bailouts there. 
>> 
>> Testing: hs-tier1 - hs-tier4
>
> src/hotspot/share/c1/c1_InstructionPrinter.cpp line 265:
> 
>> 263: 
>> 264: void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) {
>> 265:   output()->print("%s(", name);
> 
> Do we need a matching ')' somewhere?

It's already there (but on the caller side):

void InstructionPrinter::do_UnsafeGet(UnsafeGet* x) {
  print_unsafe_op(x, x->is_raw() ? "UnsafeGet (raw)" : "UnsafeGet");
  output()->put(')');
}

> src/hotspot/share/ci/ciEnv.cpp line 760:
> 
>> 758:     }
>> 759:     ciInstance* constant = get_object(string)->as_instance();
>> 760:     return ciConstant(T_OBJECT, constant);
> 
> Please explain what happens for array constants now.

It is part of `JVM_CONSTANT_String` resolution, so string constant is expected here.

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

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


More information about the hotspot-compiler-dev mailing list