Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: src/allocation-site-scopes.cc

Issue 40063002: Bookkeeping for allocation site pretenuring (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressin comments. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_);
« no previous file with comments | « src/allocation-site-scopes.h ('k') | src/arm/full-codegen-arm.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698