Disallow null {class, func, record, ...}-constant types
Summary:
We sometimes create null class-constant types in the JIT, for the class context of certain ops. There's no reason to do this! Instead, we should correctly type these ops as taking Cls|Nullptr as input, and we should validate that constant types never have a null value. To do this validation, we can just extend the existing Type::checkValid logic, but we need to call it in one more place (the return type of Type::cns).
The ops that now take Cls|Nullptr are all implemented via native calls that check the type of the SSATmp at JIT time and then pass only the value. However, pointer | null unions are explicitly allowed by our JIT -> Native ABI bindings (see CallSpec::verifySignature), so expanding the type of these ops' inputs is safe.
We also need to adjust the type-check logic for constant inputs to check admitsSingleVal instead of hasConstVal for TNullptr (which I still maintain is weird).
Reviewed By: jjgriego
Differential Revision:
D19209543
fbshipit-source-id:
220f8013586939a8b00fcf24549aa1cf64877294