Index: src/allocation-site-scopes.cc |
diff --git a/src/allocation-site-scopes.cc b/src/allocation-site-scopes.cc |
index 8097045b27d6be89d5d5922e6f14c01668e1648f..98ca7c964da0732324517f6b600c19dcd30077b2 100644 |
--- a/src/allocation-site-scopes.cc |
+++ b/src/allocation-site-scopes.cc |
@@ -83,6 +83,30 @@ void AllocationSiteCreationContext::ExitScope( |
} |
+bool AllocationSiteUsageContext::ShouldCreateMemento(Handle<JSObject> object) { |
+ bool result = false; |
+ if (activated_ && AllocationSite::CanTrack(object->map()->instance_type())) { |
+ if (FLAG_allocation_site_pretenuring) { |
Hannes Payer (out of office)
2013/11/27 10:51:37
This method looks too complicated.
What about:
if
mvstanton
2013/11/27 13:27:58
great idea, thx.
|
+ result = true; |
+ } else { |
+ ASSERT(object->IsJSArray()); |
+ if (AllocationSite::GetMode(object->GetElementsKind()) == |
+ TRACK_ALLOCATION_SITE) { |
+ result = true; |
+ } |
+ } |
+ } |
+ |
+ if (FLAG_trace_creation_allocation_sites) { |
+ PrintF("*** Creating Memento for %s %p\n", |
+ object->IsJSArray() ? "JSArray" : "JSObject", |
+ static_cast<void*>(*object)); |
+ } |
+ |
+ return result; |
+} |
+ |
+ |
Handle<AllocationSite> AllocationSiteUsageContext::EnterNewScope() { |
if (top().is_null()) { |
InitializeTraversal(top_site_); |