Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: runtime/vm/code_generator.cc

Issue 13951007: Fix bug in MegamorphicCacheMissHandler: put kNullCid into the cache when receiver is null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698