Index: src/allocation-site-scopes.cc |
diff --git a/src/allocation-site-scopes.cc b/src/allocation-site-scopes.cc |
index 8097045b27d6be89d5d5922e6f14c01668e1648f..45fc601c427eada79fc355a86eca7079d3b566e8 100644 |
--- a/src/allocation-site-scopes.cc |
+++ b/src/allocation-site-scopes.cc |
@@ -83,6 +83,33 @@ void AllocationSiteCreationContext::ExitScope( |
} |
+bool AllocationSiteUsageContext::ShouldCreateMemento(Handle<JSObject> object) { |
+ if (activated_) { |
+ if (AllocationSite::CanTrack(object->map()->instance_type())) { |
+ if (!FLAG_allocation_site_pretenuring) { |
+ ASSERT(object->IsJSArray()); |
+ if (AllocationSite::GetMode(object->GetElementsKind()) == |
+ TRACK_ALLOCATION_SITE) { |
+ if (FLAG_trace_creation_allocation_sites) { |
+ PrintF("*** Creating Memento for JSArray %p\n", |
+ static_cast<void*>(*object)); |
+ } |
+ return true; |
+ } |
+ } else { |
+ ASSERT(FLAG_allocation_site_pretenuring); |
+ if (FLAG_trace_creation_allocation_sites) { |
+ PrintF("*** Creating Memento for JSObject/JSArray %p\n", |
+ static_cast<void*>(*object)); |
+ } |
+ return true; |
+ } |
+ } |
+ } |
+ return false; |
+} |
+ |
+ |
Handle<AllocationSite> AllocationSiteUsageContext::EnterNewScope() { |
if (top().is_null()) { |
InitializeTraversal(top_site_); |