Chromium Code Reviews| 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); |