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

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: 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/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 627d371142e768a93ec1475e55bd08e185d395c6..2e60bb40944d95e10a02b919784c3f1c71f577e2 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -5714,10 +5714,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);
@@ -9233,7 +9230,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;
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698