Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 823d8d060f42b60ebe51377e5b3154ae1662857e..64f8e9ea3baed75f847339dafe2bfa03f1e5b60f 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -7339,11 +7339,10 @@ MaybeObject* CodeCache::UpdateNormalTypeCache(Name* name, Code* code) { |
Object* CodeCache::Lookup(Name* name, Code::Flags flags) { |
- if (Code::ExtractTypeFromFlags(flags) == Code::NORMAL) { |
- return LookupNormalTypeCache(name, flags); |
- } else { |
- return LookupDefaultCache(name, flags); |
- } |
+ flags = Code::RemoveTypeFromFlags(flags); |
+ Object* result = LookupDefaultCache(name, flags); |
+ if (result->IsCode()) return result; |
+ return LookupNormalTypeCache(name, flags); |
} |
@@ -7357,7 +7356,7 @@ Object* CodeCache::LookupDefaultCache(Name* name, Code::Flags flags) { |
if (key->IsUndefined()) return key; |
if (name->Equals(Name::cast(key))) { |
Code* code = Code::cast(cache->get(i + kCodeCacheEntryCodeOffset)); |
- if (code->flags() == flags) { |
+ if (Code::RemoveTypeFromFlags(code->flags()) == flags) { |
return code; |
} |
} |
@@ -7421,9 +7420,7 @@ class CodeCacheHashTableKey : public HashTableKey { |
: name_(name), flags_(flags), code_(NULL) { } |
CodeCacheHashTableKey(Name* name, Code* code) |
- : name_(name), |
- flags_(code->flags()), |
- code_(code) { } |
+ : name_(name), flags_(code->flags()), code_(code) { } |
bool IsMatch(Object* other) { |