[aot] Add types from the method header even for gshared methods.