[vm] Specialize TTS stubs only for legacy types

This is a follow-up to 62835950d which was using the condition
`type.IsNullable()` for determining whether to generate TTS stubs.

It turns out `type.IsNullable()` is false for legacy types (for whatever
reason, because legacy types are nulable).

Instead we'll change the condition to `type.IsLegacy()`.

Issue https://github.com/flutter/flutter/issues/49893

Change-Id: I4c8a728382c7b7c65ddb6bff41778b384634d83d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134164
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Martin Kustermann 2020-02-03 14:07:55 +00:00 committed by commit-bot@chromium.org
parent 3210109ccf
commit ce27d1a539

View file

@ -113,7 +113,7 @@ RawCode* TypeTestingStubGenerator::DefaultCodeForType(
if (type.IsType() || type.IsTypeParameter()) {
// TODO(dartbug.com/39755): Add support for specialized NNBD TTS.
const bool should_specialize =
!FLAG_precompiled_mode && lazy_specialize && type.IsNullable();
!FLAG_precompiled_mode && lazy_specialize && type.IsLegacy();
return should_specialize ? StubCode::LazySpecializeTypeTest().raw()
: StubCode::DefaultTypeTest().raw();
}