Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index c2220860b779f7f9ae710adc273046f1e7aabf82..fe931e8c4129025169159205dda53a2e930ca975 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -184,6 +184,11 @@ enum DescriptorFlag { |
| OWN_DESCRIPTORS |
| }; |
| +enum MarkingParity { |
|
Michael Starzinger
2012/09/21 09:43:19
Can we have a short comment on what the marking pa
danno
2012/10/25 10:07:23
Done.
|
| + NO_MARKING_PARITY, |
| + ODD_MARKING_PARITY, |
| + EVEN_MARKING_PARITY |
| +}; |
| // Instance size sentinel for objects of variable size. |
| const int kVariableSizeSentinel = 0; |
| @@ -4501,6 +4506,22 @@ class Code: public HeapObject { |
| void ClearInlineCaches(); |
| void ClearTypeFeedbackCells(Heap* heap); |
| +#define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, |
| + enum Age { |
| + kNoAge = 0, |
| + CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) |
| + kAfterLastCodeAge, |
| + kLastCodeAge = kAfterLastCodeAge - 1, |
| + kCodeAgeCount = kAfterLastCodeAge - 1 |
| + }; |
| +#undef DECLARE_CODE_AGE_ENUM |
| + |
| + // Code aging |
| + static void MakeCodeAgeSequenceYoung(byte* sequence); |
| + void MakeYoung(); |
| + void MakeOlder(); |
| + bool IsOld(); |
| + |
| // Max loop nesting marker used to postpose OSR. We don't take loop |
| // nesting that is deeper than 5 levels into account. |
| static const int kMaxLoopNestingMarker = 6; |
| @@ -4629,6 +4650,21 @@ class Code: public HeapObject { |
| TypeField::kMask | CacheHolderField::kMask; |
| private: |
| + friend class RelocIterator; |
| + |
| + // Code aging |
| + byte* FindCodeAgeSequence(); |
| + static void GetCodeAgeAndParity(Code* code, Age* age, |
| + MarkingParity* parity); |
| + static void GetCodeAgeAndParity(byte* sequence, Age* age, |
| + MarkingParity* parity); |
| + static Code* GetCodeAgeStub(Age age, MarkingParity parity); |
| + |
| + // Code aging -- platform-specific |
| + byte* FindPlatformCodeAgeSequence(); |
| + static void PatchPlatformCodeAge(byte* sequence, Age age, |
| + MarkingParity parity); |
| + |
| DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
| }; |
| @@ -5609,14 +5645,6 @@ class SharedFunctionInfo: public HeapObject { |
| // iteration by the debugger). |
| DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation_without_context) |
| - // Indicates how many full GCs this function has survived with assigned |
| - // code object. Used to determine when it is relatively safe to flush |
| - // this code object and replace it with lazy compilation stub. |
| - // Age is reset when GC notices that the code object is referenced |
| - // from the stack or compilation cache. |
| - inline int code_age(); |
| - inline void set_code_age(int age); |
| - |
| // Indicates whether optimizations have been disabled for this |
| // shared function info. If a function is repeatedly optimized or if |
| // we cannot optimize the function we disable optimization to avoid |
| @@ -5887,16 +5915,12 @@ class SharedFunctionInfo: public HeapObject { |
| static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
| // Bit positions in compiler_hints. |
| - static const int kCodeAgeSize = 3; |
| - static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1; |
| - |
| enum CompilerHints { |
| kHasOnlySimpleThisPropertyAssignments, |
| kAllowLazyCompilation, |
| kAllowLazyCompilationWithoutContext, |
| kLiveObjectsMayExist, |
| - kCodeAgeShift, |
| - kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize, |
| + kOptimizationDisabled, |
| kStrictModeFunction, |
| kExtendedModeFunction, |
| kUsesArguments, |
| @@ -8918,6 +8942,8 @@ class ObjectVisitor BASE_EMBEDDED { |
| // Visits a debug call target in the instruction stream. |
| virtual void VisitDebugTarget(RelocInfo* rinfo); |
| + virtual void VisitCodeAgeSequence(RelocInfo* rinfo); |
|
Michael Starzinger
2012/09/21 09:43:19
Add a comment of some sort ...
// Visits a code a
danno
2012/10/25 10:07:23
Done.
|
| + |
| // Handy shorthand for visiting a single pointer. |
| virtual void VisitPointer(Object** p) { VisitPointers(p, p + 1); } |