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

Unified Diff: src/objects-inl.h

Issue 12114054: Supporting AllocationSiteInfo for Nested arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some updates Created 7 years, 10 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-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 18894c1d56123f99fe02df5967ea06ffdac8a857..6b4e68acd971b27a93f9f25e044be0ebb0270005 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1461,6 +1461,13 @@ MaybeObject* JSObject::ResetElements() {
}
+bool JSObject::ShouldTrackAllocationInfo() {
danno 2013/02/11 15:05:21 How abound adding: if (!IsJSArray()) return true;
mvstanton 2013/02/15 07:36:43 Done.
+ if (map()->CanTrackAllocationSite()) {
+ return true;
+ }
+ return false;
+}
+
MaybeObject* JSObject::AddFastPropertyUsingMap(Map* map) {
ASSERT(this->map()->NumberOfOwnDescriptors() + 1 ==
map->NumberOfOwnDescriptors());
@@ -5625,6 +5632,13 @@ void JSArray::EnsureSize(int required_size) {
}
+bool JSArray::ShouldTrackAllocationInfo() {
danno 2013/02/11 15:05:21 I'm a little confused how JSArray::ShouldTrackAllo
mvstanton 2013/02/15 07:36:43 I was thinking in terms of virtual overrides, wher
+ ASSERT(map()->CanTrackAllocationSite());
+ AllocationSiteMode mode = AllocationSiteInfo::GetMode(GetElementsKind());
+ return mode == TRACK_ALLOCATION_SITE;
+}
+
+
void JSArray::set_length(Smi* length) {
// Don't need a write barrier for a Smi.
set_length(static_cast<Object*>(length), SKIP_WRITE_BARRIER);

Powered by Google App Engine
This is Rietveld 408576698