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

Unified Diff: src/objects.cc

Issue 23463047: Add field nested_sites to AllocationSite. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A few more changes Created 7 years, 3 months 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 f45dd4c0f70f3e33b4efbf98a3c37db27efe19d8..592c37fea7f5938035ee143b309c4b8b98dae411 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -8953,6 +8953,24 @@ Handle<String> SeqString::Truncate(Handle<SeqString> string, int new_length) {
}
+AllocationSite* AllocationSite::GetLastNestedSite() {
+ AllocationSite* current_site = this;
+ while (current_site->nested_sites() != Smi::FromInt(0)) {
+ current_site = AllocationSite::cast(current_site->nested_sites());
+ }
+ return current_site == this ? NULL : current_site;
+}
+
+
+void AllocationSite::AppendNestedSite(AllocationSite* nested_site) {
+ AllocationSite* last_nested_site = GetLastNestedSite();
+ AllocationSite* append_to = last_nested_site == NULL
+ ? this
+ : last_nested_site;
+ append_to->set_nested_sites(nested_site);
+}
+
+
AllocationMemento* AllocationMemento::FindForJSObject(JSObject* object) {
// Currently, AllocationMemento objects are only allocated immediately
// after JSArrays in NewSpace, and detecting whether a JSArray has one

Powered by Google App Engine
This is Rietveld 408576698