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

[MVT] Enable compilation of lambda forms with value type arguments

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • hotspot

      Roland's description:
      "Compilation of lambda forms as root of compilation is currently
      disabled.

      If we have a value type:

      class Point {
        double x;
        double y;
      }

      and some method is called:

      foo(Point p)

      when that method is JIT'ed, we use a special calling convention that
      doesn't pass a reference to p but the fields:

      foo(double x, double y)

      If foo is called with a method handle call and the method handle is not
      constant, foo won't be inlined in a caller, it will be called from a
      lambda form. That lambda form is specialized to the value type supertype
      so it's not aware that the value type argument is a Point. It passes a
      reference to a value type as an argument to foo but foo expects a pair
      of doubles. If the call is from an interpreted lambda form, the i2c
      takes care of loading the fields from the value type. If the call is
      from a compiled method, this would cause the compiled method foo to see
      garbage in x and y. The current workaround is to disable compilation of
      lambda forms. The correct fix I think is to have a special entry point
      in the compiled method."

            thartmann Tobias Hartmann
            thartmann Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: