-
Enhancement
-
Resolution: Duplicate
-
P4
-
repo-valhalla
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."
"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."
- duplicates
-
JDK-8206139 [lworld] Re-enable calling convention optimizations
-
- Resolved
-
- relates to
-
JDK-8182453 [MVT] Method Handle compilation broken (even without value types)
-
- Resolved
-