Index: src/ic/ic-compiler.cc |
diff --git a/src/ic/ic-compiler.cc b/src/ic/ic-compiler.cc |
index 396eb23038d73b01881cd944e770f62f1b5eb935..f74c69e50d431ab75a449059c7a776ecf5fb396d 100644 |
--- a/src/ic/ic-compiler.cc |
+++ b/src/ic/ic-compiler.cc |
@@ -129,6 +129,29 @@ |
FillCache(isolate, code); |
return code; |
+} |
+ |
+ |
+Handle<Code> PropertyICCompiler::ComputeCompareNil(Handle<Map> receiver_map, |
+ CompareNilICStub* stub) { |
+ Isolate* isolate = receiver_map->GetIsolate(); |
+ Handle<String> name(isolate->heap()->empty_string()); |
+ if (!receiver_map->is_dictionary_map()) { |
+ Handle<Code> cached_ic = |
+ Find(name, receiver_map, Code::COMPARE_NIL_IC, stub->GetExtraICState()); |
+ if (!cached_ic.is_null()) return cached_ic; |
+ } |
+ |
+ Code::FindAndReplacePattern pattern; |
+ Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); |
+ pattern.Add(isolate->factory()->meta_map(), cell); |
+ Handle<Code> ic = stub->GetCodeCopy(pattern); |
+ |
+ if (!receiver_map->is_dictionary_map()) { |
+ Map::UpdateCodeCache(receiver_map, name, ic); |
+ } |
+ |
+ return ic; |
} |