| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index 5cde67d7e97e17560c8e22553a0909eb20f38532..a263012dec8a4e91b58b556dcc8ca2e0f123188b 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -1297,6 +1297,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();
|
| @@ -3671,12 +3709,13 @@ void Code::set_major_key(int major) {
|
|
|
|
|
| bool Code::is_pregenerated() {
|
| - return kind() == STUB && IsPregeneratedField::decode(flags());
|
| + return (kind() == STUB || kind() == COMPILED_STUB)
|
| + && IsPregeneratedField::decode(flags());
|
| }
|
|
|
|
|
| void Code::set_is_pregenerated(bool value) {
|
| - ASSERT(kind() == STUB);
|
| + ASSERT(kind() == STUB || kind() == COMPILED_STUB);
|
| Flags f = flags();
|
| f = static_cast<Flags>(IsPregeneratedField::update(f, value));
|
| set_flags(f);
|
|
|