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

Unified Diff: src/objects.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/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 2b38b1dab096bd495ba7531868ebc91be4691a0e..311bf1923a0f7e3a126bc7fb78b87625b3bf6cf4 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -5715,10 +5715,7 @@ class JSObjectCopyVisitor: public JSObjectWalkVisitor {
// 2) the elements kind is palatable
// 3) allow_mementos is true
Handle<JSObject> copy;
- if (site_context()->activated() &&
- AllocationSite::CanTrack(object->map()->instance_type()) &&
- AllocationSite::GetMode(object->GetElementsKind()) ==
- TRACK_ALLOCATION_SITE) {
+ if (site_context()->ShouldCreateMemento(object)) {
copy = JSObject::Copy(object, site_context()->current());
} else {
copy = JSObject::Copy(object);
@@ -9234,7 +9231,9 @@ AllocationMemento* AllocationMemento::FindForJSObject(JSObject* object,
object->GetHeap()->allocation_memento_map()) {
AllocationMemento* memento = AllocationMemento::cast(
reinterpret_cast<Object*>(ptr_end + kHeapObjectTag));
- return memento;
+ if (memento->IsValid()) {
+ return memento;
+ }
}
}
}
@@ -12810,6 +12809,9 @@ void JSObject::TransitionElementsKind(Handle<JSObject> object,
}
+const double AllocationSite::kPretenureRatio = 0.60;
+
+
bool AllocationSite::IsNestedSite() {
ASSERT(FLAG_trace_track_allocation_sites);
Object* current = GetHeap()->allocation_sites_list();
« src/allocation-site-scopes.cc ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698