In the type system which controls the C2 parser and optimizer, unverified interfaces are freely mixed with verified classes. The result is that the code which makes decisions based on statically predicted reference types must always have a cutout which disables the decision if the type in question is an interface instead of a class. If such a cutout is missing, there will be a bug, but only in rare cases where a class is recompiled without an interface, and client classes continue to assume it has the interface.
Our system has a more or less complete set of such cutouts, because we have fixed a number of historical bugs involving interface paradoxes. However, there may be remaining bugs in the system, and new code involving reference type checks will always be somewhat buggy until the proper interface cutouts are coded.
One reason we do not perform certain optimizations, such as CHA on interfaces and recognition of unique implementors, is that the new code to do this would have to "undo" some of the interface cutouts, and would therefore be risky. C1 has one such optimization, at the cost of inserting a local 'instanceof' check guarding the optimized 'invokeinterface'. Such an optimization in C2 is best done by the type system, which is impossible as long as type system assertions about interfaces are untrustworthy.
- clones
-
JDK-6312651 Compiler should only use verified interface types for optimization
- Closed
- relates to
-
JDK-8300040 TypeOopPtr::make_from_klass_common calls itself with args in wrong order
- Resolved
-
JDK-8300113 C2: Single-bit fields with signed type in TypePtr after JDK-8297933
- Resolved
-
JDK-8321974 Crash in ciKlass::is_subtype_of because TypeAryPtr::_klass is not initialized
- Closed
-
JDK-8328702 C2: Crash during parsing because sub type check is not folded
- Closed
-
JDK-8305103 Regression > 4% on KeyAgreementBench.XDH
- Closed
-
JDK-8309203 C2: remove copy-by-value of GrowableArray for InterfaceSet
- Resolved
-
JDK-8340214 C2 compilation asserts with "no node with a side effect" in PhaseIdealLoop::try_sink_out_of_loop
- Resolved
-
JDK-8298848 C2: clone all of (CmpP (LoadKlass (AddP down at split if
- Resolved
-
JDK-8303512 Race condition when computing is_loaded property of TypePtr::InterfaceSet
- Resolved
-
JDK-8303737 C2: Load can bypass subtype check that enforces it's from the right object type
- Resolved
-
JDK-8301630 C2: 8297933 broke type speculation in some cases
- Resolved
-
JDK-8312980 C2: "malformed control flow" created during incremental inlining
- Resolved
-
JDK-8308583 SIGSEGV in GraphKit::gen_checkcast
- Closed
-
JDK-8316533 C2 compilation fails with assert(verify(phase)) failed: missing Value() optimization
- Closed
-
JDK-8280469 No CHA for interface calls when inlining through method handle linker
- Open