Index: src/allocation-site-scopes.cc |
diff --git a/src/allocation-site-scopes.cc b/src/allocation-site-scopes.cc |
index 31120b902531a4c5bd54c9f010e0d74ea67a0329..bbfb39b122c336ad7e8df8846550fb5fec85d831 100644 |
--- a/src/allocation-site-scopes.cc |
+++ b/src/allocation-site-scopes.cc |
@@ -82,4 +82,21 @@ void AllocationSiteCreationContext::ExitScope( |
} |
} |
+ |
+bool AllocationSiteUsageContext::ShouldCreateMemento(Handle<JSObject> object) { |
+ if (activated_ && AllocationSite::CanTrack(object->map()->instance_type())) { |
+ if (FLAG_allocation_site_pretenuring || |
+ AllocationSite::GetMode(object->GetElementsKind()) == |
+ TRACK_ALLOCATION_SITE) { |
+ if (FLAG_trace_creation_allocation_sites) { |
+ PrintF("*** Creating Memento for %s %p\n", |
+ object->IsJSArray() ? "JSArray" : "JSObject", |
+ static_cast<void*>(*object)); |
+ } |
+ return true; |
+ } |
+ } |
+ return false; |
+} |
+ |
} } // namespace v8::internal |