Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 26e4466590c1772af86a7a2c296ca02c8c7492ac..832a958a5b159da4b5f3a90fb261397a32a18846 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -12848,10 +12848,20 @@ void ICData::AddTarget(const Function& target) const { |
} |
+bool ICData::ValidateInterceptor(const Function& target) const { |
+ ObjectStore* store = Isolate::Current()->object_store(); |
+ ASSERT((target.raw() == store->simple_instance_of_true_function()) || |
+ (target.raw() == store->simple_instance_of_false_function())); |
+ const String& instance_of_name = String::Handle( |
+ Library::PrivateCoreLibName(Symbols::_simpleInstanceOf()).raw()); |
+ ASSERT(target_name() == instance_of_name.raw()); |
+ return true; |
+} |
+ |
void ICData::AddCheck(const GrowableArray<intptr_t>& class_ids, |
const Function& target) const { |
ASSERT(!target.IsNull()); |
- ASSERT(target.name() == target_name()); |
+ ASSERT((target.name() == target_name()) || ValidateInterceptor(target)); |
DEBUG_ASSERT(!HasCheck(class_ids)); |
ASSERT(NumArgsTested() > 1); // Otherwise use 'AddReceiverCheck'. |
ASSERT(class_ids.length() == NumArgsTested()); |