Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 99c160b51d5c79e93fa2675745387428fa207c31..5676811b177f8e4c41d51a967e59ae5793a83ac9 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -5563,7 +5563,13 @@ class DependentCode: public FixedArray { |
| // Group of code that depends on global property values in property cells |
| // not being changed. |
| kPropertyCellChangedGroup, |
| - kGroupCount = kPropertyCellChangedGroup + 1 |
| + // Group of code that depends on tenuring information in AllocationSites |
| + // not being changed. |
| + kAllocationSiteTenuringChangedGroup, |
| + // Group of code that depends on element transition information in |
| + // AllocationSites not being changed. |
| + kAllocationSiteTransitionChangedGroup, |
| + kGroupCount = kAllocationSiteTransitionChangedGroup + 1 |
| }; |
| // Array for holding the index of the first code object of each group. |
| @@ -8077,13 +8083,31 @@ class AllocationSite: public Struct { |
| // This method is expensive, it should only be called for reporting. |
| bool IsNestedSite(); |
| + static const int kElementsKindMask = 0xffff; |
|
Toon Verwaest
2013/11/06 16:42:44
Is there a reason why you don't use BitFields?
mvstanton
2013/11/07 16:34:05
Nope, now I do, thx!
|
| + static const int kFlagsMask = 0x7fff0000; |
| + |
| ElementsKind GetElementsKind() { |
| ASSERT(!SitePointsToLiteral()); |
| - return static_cast<ElementsKind>(Smi::cast(transition_info())->value()); |
| + int value = Smi::cast(transition_info())->value(); |
| + value = value & kElementsKindMask; |
| + return static_cast<ElementsKind>(value); |
| } |
| void SetElementsKind(ElementsKind kind) { |
| - set_transition_info(Smi::FromInt(static_cast<int>(kind))); |
| + int value = Smi::cast(transition_info())->value(); |
| + value = (value & kFlagsMask) | static_cast<int>(kind); |
| + set_transition_info(Smi::FromInt(value)); |
| + } |
| + |
| + bool DoNotInlineCall() { |
| + int value = Smi::cast(transition_info())->value(); |
| + return (value & kFlagsMask) != 0; |
| + } |
| + |
| + void SetDoNotInlineCall() { |
| + int value = Smi::cast(transition_info())->value(); |
| + value |= (1 << 16); |
| + set_transition_info(Smi::FromInt(value)); |
| } |
| bool SitePointsToLiteral() { |
| @@ -8093,6 +8117,16 @@ class AllocationSite: public Struct { |
| return transition_info()->IsJSArray() || transition_info()->IsJSObject(); |
| } |
| + MaybeObject* DigestTransitionFeedback(ElementsKind to_kind); |
| + |
| + enum Reason { |
| + TENURING, |
| + TRANSITIONS |
| + }; |
| + |
| + void AddDependentCompilationInfo(Reason reason, CompilationInfo* info); |
| + void AddDependentCode(Reason reason, Handle<Code> code); |
| + |
| DECLARE_PRINTER(AllocationSite) |
| DECLARE_VERIFIER(AllocationSite) |
| @@ -8113,6 +8147,7 @@ class AllocationSite: public Struct { |
| kSize> BodyDescriptor; |
| private: |
| + inline DependentCode::DependencyGroup ToDependencyGroup(Reason reason); |
| DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); |
| }; |