| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index f3a029ee340c79b043bbc7d239fb22cb6e4039b9..aec40d36416ef73eac56ac05519557c4f917bcce 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -1299,6 +1299,44 @@ void JSObject::ValidateElements() {
|
| }
|
|
|
|
|
| +bool JSObject::ShouldTrackAllocationInfo() {
|
| + if (map()->CanTrackAllocationSite()) {
|
| + if (!IsJSArray()) {
|
| + return true;
|
| + }
|
| +
|
| + return AllocationSiteInfo::GetMode(GetElementsKind()) ==
|
| + TRACK_ALLOCATION_SITE;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +
|
| +// Heuristic: We only need to create allocation site info if the boilerplate
|
| +// elements kind is the initial elements kind.
|
| +AllocationSiteMode AllocationSiteInfo::GetMode(
|
| + ElementsKind boilerplate_elements_kind) {
|
| + if (FLAG_track_allocation_sites &&
|
| + IsFastSmiElementsKind(boilerplate_elements_kind)) {
|
| + return TRACK_ALLOCATION_SITE;
|
| + }
|
| +
|
| + return DONT_TRACK_ALLOCATION_SITE;
|
| +}
|
| +
|
| +
|
| +AllocationSiteMode AllocationSiteInfo::GetMode(ElementsKind from,
|
| + ElementsKind to) {
|
| + if (FLAG_track_allocation_sites &&
|
| + IsFastSmiElementsKind(from) &&
|
| + (IsFastObjectElementsKind(to) || IsFastDoubleElementsKind(to))) {
|
| + return TRACK_ALLOCATION_SITE;
|
| + }
|
| +
|
| + return DONT_TRACK_ALLOCATION_SITE;
|
| +}
|
| +
|
| +
|
| MaybeObject* JSObject::EnsureCanContainHeapObjectElements() {
|
| ValidateElements();
|
| ElementsKind elements_kind = map()->elements_kind();
|
| @@ -3689,7 +3727,7 @@ void Code::set_major_key(int major) {
|
|
|
|
|
| bool Code::is_pregenerated() {
|
| - return kind() == STUB && IsPregeneratedField::decode(flags());
|
| + return (kind() == STUB && IsPregeneratedField::decode(flags()));
|
| }
|
|
|
|
|
|
|