Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8280473

CI: Support unresolved JVM_CONSTANT_Dynamic constant pool entries

    XMLWordPrintable

Details

    • b10

    Description

      Support unresolved dynamic constants in CI.

      ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
                                                   int pool_index, int cache_index,
                                                   ciInstanceKlass* accessor) {
      ...
        } else if (tag.is_dynamic_constant()) {
          return ciConstant();
      ...

      Right now, unresolved JVM_CONSTANT_Dynamic CP entries bail out compilations (both C1 and C2):

         201 410 91 b 1 compiler.runtime.TestConstantsInError$Test_CD_9/0x0000000800c11000::test (3 bytes)
         202 compilation bailout: could not resolve a constant
         203 410 91 b 1 compiler.runtime.TestConstantsInError$Test_CD_9/0x0000000800c11000::test (3 bytes) COMPILE SKIPPED: could not resolve a constant (retry at different tier)


          296 64 b Test_CD/0x0000000800c0a400::test (3 bytes)
          296 64 b Test_CD/0x0000000800c0a400::test (3 bytes) COMPILE SKIPPED: cannot parse method (retry at different tier)


      src/hotspot/share/c1/c1_GraphBuilder.cpp:
      void GraphBuilder::load_constant() {
        ciConstant con = stream()->get_constant();
        if (con.basic_type() == T_ILLEGAL) {
          // FIXME: an unresolved Dynamic constant can get here,
          // and that should not terminate the whole compilation.
          BAILOUT("could not resolve a constant");

      src/hotspot/share/ci/ciTypeFlow.cpp:
      // ciTypeFlow::StateVector::do_ldc
      void ciTypeFlow::StateVector::do_ldc(ciBytecodeStream* str) {
        ciConstant con = str->get_constant();
        if (con.is_valid()) {
          ...
        } else {
          if (str->is_unresolved_klass_in_error()) {
            trap(str, NULL, Deoptimization::make_trap_request(Deoptimization::Reason_unhandled,
                                                              Deoptimization::Action_none));
          } else {
            // OutOfMemoryError in the CI while loading constant
            push_null();
            outer()->record_failure("ldc did not link");
          }

       

      Attachments

        Issue Links

          Activity

            People

              vlivanov Vladimir Ivanov
              vlivanov Vladimir Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: