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

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: Rebase built on site fields in another CL. 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..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_);
« no previous file with comments | « src/allocation-site-scopes.h ('k') | src/flag-definitions.h » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698