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

[lworld] Further optimize acmp on inline types in C2

XMLWordPrintable

      We currently always allocate when performing acmp on inline types and delegate to ValueBootstrapMethods::isSubstitutable() if the klasses are equal. We should try to check for substitutability at compile time or even emit optimized code for the substitutability check (for example, directly compare memory if there are no oop fields).

      With all the branching in Parse::do_acmp, we should also make sure that profile information is correctly used to set branch probabilities (Tobias: I checked while working on JDK-8325417 but we should double-check and maybe add an IR framework test to verify that the traps are at the correct branch. TestAcmpWithUnstableIf could be used/converted, TestLWorldProfiling already contains some tests for acmp profiling).

      ValueBootstrapMethods::isSubstitutable() is currently special cased in the JIT to avoid recursion. Should it use unsafe for pointer comparison?

      The runtime call to isSubstitutable might end up with both arguments referring to the same inline type. We should remove it in that case.

            chagedorn Christian Hagedorn
            thartmann Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: