12803 {
12806 ASSERT(
value.ptr() != Object::transition_sentinel().ptr());
12807
12809 Zone* const zone = thread->zone();
12810 const TypeArguments& static_type_args =
12812
12814
12815 ASSERT(static_type.IsFinalized());
12817 GrowableArray<const Type*>
path(10);
12818
12819 bool is_super_class = true;
12820 if (!cls.FindInstantiationOf(zone, static_type, &
path,
12821 true)) {
12822 is_super_class = false;
12823 bool found_super_interface =
12824 cls.FindInstantiationOf(zone, static_type, &
path);
12825 ASSERT(found_super_interface);
12826 }
12827
12828
12829
12830 if (
path.is_empty()) {
12831 ASSERT(cls.ptr() == static_type.type_class());
12833
12834
12835
12836 if (
args.ptr() == static_type_args.ptr()) {
12838 }
12839
12840 if (print_trace) {
12841 THR_Print(
" expected %s got %s type arguments\n",
12844 }
12846 }
12847
12848
12849
12850
12851
12852
12853
12854
12855
12857 for (intptr_t
i =
path.length() - 2; (
i >= 0) && !
type.IsInstantiated();
12859 args =
path[
i]->GetInstanceTypeArguments(thread,
false);
12860 type ^=
type.InstantiateFrom(
args, TypeArguments::null_type_arguments(),
12862 }
12863
12864 if (
type.IsInstantiated()) {
12865
12866
12867 args =
type.GetInstanceTypeArguments(thread,
false);
12868 if (
args.Equals(static_type_args)) {
12871 }
12872
12873 if (print_trace) {
12874 THR_Print(
" expected %s got %s type arguments\n",
12877 }
12878
12880 }
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890 ASSERT(cls.IsGeneric());
12891 const intptr_t num_type_params = cls.NumTypeParameters();
12892 bool trivial_case =
12893 (num_type_params ==
12894 Class::Handle(zone, static_type.type_class()).NumTypeParameters()) &&
12895 (
value.GetTypeArguments() == static_type_args.ptr());
12896 if (!trivial_case && FLAG_trace_field_guards) {
12898 " type parameters, %s vs %s type arguments\n",
12899 num_type_params,
12900 Class::Handle(zone, static_type.type_class()).NumTypeParameters(),
12904 }
12905
12907 args =
type.GetInstanceTypeArguments(thread,
false);
12908 for (intptr_t
i = 0; (
i < num_type_params) && trivial_case;
i++) {
12909 type_arg =
args.TypeAt(
i);
12910 if (!type_arg.IsTypeParameter() ||
12911 (TypeParameter::Cast(type_arg).index() !=
i)) {
12912 if (FLAG_trace_field_guards) {
12913 THR_Print(
" => encountered %s at index % " Pd "\n",
12914 type_arg.ToCString(),
i);
12915 }
12916 trivial_case = false;
12917 }
12918 }
12919
12921 : StaticTypeExactnessState::
NotExact();
12922}
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