Add dynamic to TypeStructure
commit4753a4180f32018a3219681b8a793f95fe574116
authorKunal Mehta <kunalm@fb.com>
Wed, 26 Jun 2019 04:08:11 +0000 (25 21:08 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 26 Jun 2019 04:11:32 +0000 (25 21:11 -0700)
treee0b20706b3f58a282460639f0dc05cc0eaccd440
parent716252f4e1077f5fe5a59f4db1da5b0172382539
Add dynamic to TypeStructure

Summary:
For the purposes of reified generics, we need `dynamic` to be distinct from `mixed`.

Previously, `dynamic` was an alias to `mixed` in the compiler. Now, it has a distinct type structure representation, but the typehints are still emitted as `mixed`. This way, we don't have to add a whole new type to HHVM. The same optimizations for `is` expressions carry over from `mixed`.

Reviewed By: oulgen

Differential Revision: D15908205

fbshipit-source-id: e8e70a53fbf541478e1b63878922c6ee58e9fd31
15 files changed:
hphp/hack/src/hhbc/emit_type_constant.ml
hphp/hack/src/parser/hh_autoimport.ml
hphp/hhbbc/interp.cpp
hphp/hhbbc/type-system.cpp
hphp/runtime/base/type-structure-helpers.cpp
hphp/runtime/base/type-structure.cpp
hphp/runtime/base/type-structure.h
hphp/runtime/ext/reflection/ext_reflection-classes.php
hphp/runtime/vm/jit/irgen-types.cpp
hphp/runtime/vm/jit/prof-data-serialize.cpp
hphp/test/slow/hack_mode/hack_dynamic_type.php
hphp/test/slow/reified_generics/dynamic.php [new file with mode: 0644]
hphp/test/slow/reified_generics/dynamic.php.expect [new file with mode: 0644]
hphp/test/slow/type_annotation/type_annotation_dynamic.php [new file with mode: 0644]
hphp/test/slow/type_annotation/type_annotation_dynamic.php.expect [new file with mode: 0644]