Index: src/ic/ic.cc |
diff --git a/src/ic/ic.cc b/src/ic/ic.cc |
index 63c37992e18a52b946440f1518509ae21f3064f5..801f597f1588959d3b34df72501aec160af2f2f3 100644 |
--- a/src/ic/ic.cc |
+++ b/src/ic/ic.cc |
@@ -511,10 +511,16 @@ void IC::Clear(Isolate* isolate, Address address, |
void KeyedLoadIC::Clear(Isolate* isolate, Address address, Code* target, |
ConstantPoolArray* constant_pool) { |
if (IsCleared(target)) return; |
- // Make sure to also clear the map used in inline fast cases. If we |
- // do not clear these maps, cached code can keep objects alive |
- // through the embedded maps. |
- SetTargetAtAddress(address, *pre_monomorphic_stub(isolate), constant_pool); |
+ |
+ // If the target is the string_stub, then don't clear it. It is the |
+ // perfect stub if we continue to see strings. Holding this |
+ // state is not preventing learning new information. |
+ if (target != *isolate->builtins()->KeyedLoadIC_String()) { |
+ // Make sure to also clear the map used in inline fast cases. If we |
+ // do not clear these maps, cached code can keep objects alive |
+ // through the embedded maps. |
+ SetTargetAtAddress(address, *pre_monomorphic_stub(isolate), constant_pool); |
+ } |
} |