| Index: runtime/vm/code_generator.cc
|
| diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
|
| index 4bbb77e9397b0246e3b6eaddb610cfaede774ff6..60413f33564ed2c450c5630cc2461f49665ee644 100644
|
| --- a/runtime/vm/code_generator.cc
|
| +++ b/runtime/vm/code_generator.cc
|
| @@ -1014,8 +1014,9 @@ DEFINE_RUNTIME_ENTRY(MegamorphicCacheMissHandler, 3) {
|
| const MegamorphicCache& cache = MegamorphicCache::Handle(
|
| isolate->megamorphic_cache_table()->Lookup(name, descriptor));
|
| Class& cls = Class::Handle(receiver.clazz());
|
| + const bool is_null = cls.IsNullClass();
|
| // For lookups treat null as an instance of class Object.
|
| - if (cls.IsNullClass()) {
|
| + if (is_null) {
|
| cls = isolate->object_store()->object_class();
|
| }
|
| ASSERT(!cls.IsNull());
|
| @@ -1049,7 +1050,7 @@ DEFINE_RUNTIME_ENTRY(MegamorphicCacheMissHandler, 3) {
|
| if (instructions.IsNull()) return;
|
|
|
| cache.EnsureCapacity();
|
| - const Smi& class_id = Smi::Handle(Smi::New(cls.id()));
|
| + const Smi& class_id = Smi::Handle(Smi::New(is_null ? kNullCid : cls.id()));
|
| cache.Insert(class_id, target);
|
| return;
|
| }
|
|
|