Index: src/ic/x87/handler-compiler-x87.cc |
diff --git a/src/ic/x87/handler-compiler-x87.cc b/src/ic/x87/handler-compiler-x87.cc |
index 5eca3dc0cb7bc0d07d9943f0d2dd4e359d5c17c5..02a782a75b0ac4d868db1cd73a975a7353300ac3 100644 |
--- a/src/ic/x87/handler-compiler-x87.cc |
+++ b/src/ic/x87/handler-compiler-x87.cc |
@@ -491,8 +491,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); |
@@ -511,7 +512,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. |