Index: src/ic/x64/handler-compiler-x64.cc |
diff --git a/src/ic/x64/handler-compiler-x64.cc b/src/ic/x64/handler-compiler-x64.cc |
index f386fc5b65f418c53ad323b74868f4dd441f07a8..ef4f411656fc55604db243195b96f39cfdb48c66 100644 |
--- a/src/ic/x64/handler-compiler-x64.cc |
+++ b/src/ic/x64/handler-compiler-x64.cc |
@@ -484,8 +484,9 @@ Register PropertyHandlerCompiler::CheckPrototypes( |
NameDictionary::kNotFound); |
if (depth > 1) { |
- // TODO(jkummerow): Cache and re-use weak cell. |
- __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); |
+ Handle<WeakCell> weak_cell = |
+ Map::GetOrCreatePrototypeWeakCell(current, isolate()); |
+ __ LoadWeakValue(reg, weak_cell, miss); |
} |
GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, |
scratch2); |
@@ -504,7 +505,9 @@ Register PropertyHandlerCompiler::CheckPrototypes( |
bool return_holder = return_what == RETURN_HOLDER; |
if (return_holder && depth != 0) { |
- __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); |
+ Handle<WeakCell> weak_cell = |
+ Map::GetOrCreatePrototypeWeakCell(current, isolate()); |
+ __ LoadWeakValue(reg, weak_cell, miss); |
} |
// Return the register containing the holder. |