@@ -133,7 +133,7 @@ DEFINE_NATIVE_ENTRY(Object_haveSameRuntimeType, 0, 2) {
133133 .raw ();
134134}
135135
136- DEFINE_NATIVE_ENTRY (Object_instanceOf, 0 , 5 ) {
136+ DEFINE_NATIVE_ENTRY (Object_instanceOf, 0 , 4 ) {
137137 const Instance& instance =
138138 Instance::CheckedHandle (zone, arguments->NativeArgAt (0 ));
139139 const TypeArguments& instantiator_type_arguments =
@@ -142,11 +142,9 @@ DEFINE_NATIVE_ENTRY(Object_instanceOf, 0, 5) {
142142 TypeArguments::CheckedHandle (zone, arguments->NativeArgAt (2 ));
143143 const AbstractType& type =
144144 AbstractType::CheckedHandle (zone, arguments->NativeArgAt (3 ));
145- const NNBDMode nnbd_mode = static_cast <NNBDMode>(
146- Smi::CheckedHandle (zone, arguments->NativeArgAt (4 )).Value ());
147145 ASSERT (type.IsFinalized ());
148146 const bool is_instance_of = instance.IsInstanceOf (
149- nnbd_mode, type, instantiator_type_arguments, function_type_arguments);
147+ type, instantiator_type_arguments, function_type_arguments);
150148 if (FLAG_trace_type_checks) {
151149 const char * result_str = is_instance_of ? " true" : " false" ;
152150 OS::PrintErr (" Native Object.instanceOf: result %s\n " , result_str);
@@ -169,18 +167,8 @@ DEFINE_NATIVE_ENTRY(Object_simpleInstanceOf, 0, 2) {
169167 AbstractType::CheckedHandle (zone, arguments->NativeArgAt (1 ));
170168 ASSERT (type.IsFinalized ());
171169 ASSERT (type.IsInstantiated ());
172- // If the instance is not null, the result of _simpleInstanceOf does not
173- // depend on the nnbd mode, because we only check against a rare type,
174- // i.e. a class. However, we need to determine the correct nnbd mode when
175- // the instance is null.
176- // Since type literals are not imported, a legacy type indicates that the
177- // call originated in a legacy library. Note that the type test against a
178- // non-legacy type (even in a legacy library) such as dynamic, void, or Null
179- // yield the same result independently of the mode used.
180- NNBDMode mode =
181- type.IsLegacy () ? NNBDMode::kLegacyLib : NNBDMode::kOptedInLib ;
182170 const bool is_instance_of = instance.IsInstanceOf (
183- mode, type, Object::null_type_arguments (), Object::null_type_arguments ());
171+ type, Object::null_type_arguments (), Object::null_type_arguments ());
184172 return Bool::Get (is_instance_of).raw ();
185173}
186174
@@ -247,8 +235,8 @@ static bool ExtractInterfaceTypeArgs(Zone* zone,
247235 if (!cur_interface_type_args.IsNull () &&
248236 !cur_interface_type_args.IsInstantiated ()) {
249237 cur_interface_type_args = cur_interface_type_args.InstantiateFrom (
250- cur_cls. nnbd_mode (), instance_type_args ,
251- Object::null_type_arguments (), kNoneFree , NULL , Heap::kNew );
238+ instance_type_args, Object::null_type_arguments (), kNoneFree , NULL ,
239+ Heap::kNew );
252240 }
253241 if (ExtractInterfaceTypeArgs (zone, cur_interface_cls,
254242 cur_interface_type_args, interface_cls,
@@ -401,10 +389,8 @@ DEFINE_NATIVE_ENTRY(Internal_boundsCheckForPartialInstantiation, 0, 2) {
401389 ASSERT (!supertype.IsNull ());
402390
403391 // The supertype may not be instantiated.
404- // TODO(regis): What is the correct nnbd mode to use here?
405392 if (!AbstractType::InstantiateAndTestSubtype (
406- NNBDMode::kLegacyLib , &subtype, &supertype, instantiator_type_args,
407- function_type_args)) {
393+ &subtype, &supertype, instantiator_type_args, function_type_args)) {
408394 // Throw a dynamic type error.
409395 TokenPosition location;
410396 {
0 commit comments