Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 627d371142e768a93ec1475e55bd08e185d395c6..2e60bb40944d95e10a02b919784c3f1c71f577e2 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -5714,10 +5714,7 @@ class JSObjectCopyVisitor: public JSObjectWalkVisitor { |
// 2) the elements kind is palatable |
// 3) allow_mementos is true |
Handle<JSObject> copy; |
- if (site_context()->activated() && |
- AllocationSite::CanTrack(object->map()->instance_type()) && |
- AllocationSite::GetMode(object->GetElementsKind()) == |
- TRACK_ALLOCATION_SITE) { |
+ if (site_context()->ShouldCreateMemento(object)) { |
copy = JSObject::Copy(object, site_context()->current()); |
} else { |
copy = JSObject::Copy(object); |
@@ -9233,7 +9230,9 @@ AllocationMemento* AllocationMemento::FindForJSObject(JSObject* object, |
object->GetHeap()->allocation_memento_map()) { |
AllocationMemento* memento = AllocationMemento::cast( |
reinterpret_cast<Object*>(ptr_end + kHeapObjectTag)); |
- return memento; |
+ if (memento->IsValid()) { |
+ return memento; |
+ } |
} |
} |
} |