12850 {
12853 ASSERT(
value.ptr() != Object::transition_sentinel().ptr());
12854
12856 Zone* const zone = thread->zone();
12857 const TypeArguments& static_type_args =
12859
12861
12862 ASSERT(static_type.IsFinalized());
12864 GrowableArray<const Type*>
path(10);
12865
12866 bool is_super_class = true;
12867 if (!cls.FindInstantiationOf(zone, static_type, &path,
12868 true)) {
12869 is_super_class = false;
12870 bool found_super_interface =
12871 cls.FindInstantiationOf(zone, static_type, &path);
12872 ASSERT(found_super_interface);
12873 }
12874
12875
12876
12877 if (
path.is_empty()) {
12878 ASSERT(cls.ptr() == static_type.type_class());
12880
12881
12882
12883 if (
args.ptr() == static_type_args.ptr()) {
12885 }
12886
12887 if (print_trace) {
12888 THR_Print(
" expected %s got %s type arguments\n",
12891 }
12893 }
12894
12895
12896
12897
12898
12899
12900
12901
12902
12904 for (intptr_t i =
path.length() - 2; (i >= 0) && !
type.IsInstantiated();
12905 i--) {
12906 args =
path[i]->GetInstanceTypeArguments(thread,
false);
12907 type ^=
type.InstantiateFrom(
args, TypeArguments::null_type_arguments(),
12909 }
12910
12911 if (
type.IsInstantiated()) {
12912
12913
12914 args =
type.GetInstanceTypeArguments(thread,
false);
12915 if (
args.Equals(static_type_args)) {
12918 }
12919
12920 if (print_trace) {
12921 THR_Print(
" expected %s got %s type arguments\n",
12924 }
12925
12927 }
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937 ASSERT(cls.IsGeneric());
12938 const intptr_t num_type_params = cls.NumTypeParameters();
12939 bool trivial_case =
12940 (num_type_params ==
12941 Class::Handle(zone, static_type.type_class()).NumTypeParameters()) &&
12942 (
value.GetTypeArguments() == static_type_args.ptr());
12943 if (!trivial_case && FLAG_trace_field_guards) {
12945 " type parameters, %s vs %s type arguments\n",
12946 num_type_params,
12947 Class::Handle(zone, static_type.type_class()).NumTypeParameters(),
12951 }
12952
12954 args =
type.GetInstanceTypeArguments(thread,
false);
12955 for (intptr_t i = 0; (i < num_type_params) && trivial_case; i++) {
12956 type_arg =
args.TypeAt(i);
12957 if (!type_arg.IsTypeParameter() ||
12958 (TypeParameter::Cast(type_arg).index() != i)) {
12959 if (FLAG_trace_field_guards) {
12960 THR_Print(
" => encountered %s at index % " Pd "\n",
12961 type_arg.ToCString(), i);
12962 }
12963 trivial_case = false;
12964 }
12965 }
12966
12968 : StaticTypeExactnessState::
NotExact();
12969}
static StaticTypeExactnessState NotExact()
static StaticTypeExactnessState HasExactSuperClass()
static Thread * Current()
#define THR_Print(format,...)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static StaticTypeExactnessState TrivialTypeExactnessFor(const Class &cls)
static const char * SafeTypeArgumentsToCString(const TypeArguments &args)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path