Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1898)

Side by Side Diff: src/objects.h

Issue 2529173002: [Heap] Remove concept of MarkingParity. (Closed)
Patch Set: Fix arm Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 }; 277 };
278 278
279 279
280 // Indicates whether we are only interested in the descriptors of a particular 280 // Indicates whether we are only interested in the descriptors of a particular
281 // map, or in all descriptors in the descriptor array. 281 // map, or in all descriptors in the descriptor array.
282 enum DescriptorFlag { 282 enum DescriptorFlag {
283 ALL_DESCRIPTORS, 283 ALL_DESCRIPTORS,
284 OWN_DESCRIPTORS 284 OWN_DESCRIPTORS
285 }; 285 };
286 286
287 // The GC maintains a bit of information, the MarkingParity, which toggles
288 // from odd to even and back every time marking is completed. Incremental
289 // marking can visit an object twice during a marking phase, so algorithms that
290 // that piggy-back on marking can use the parity to ensure that they only
291 // perform an operation on an object once per marking phase: they record the
292 // MarkingParity when they visit an object, and only re-visit the object when it
293 // is marked again and the MarkingParity changes.
294 enum MarkingParity {
295 NO_MARKING_PARITY,
296 ODD_MARKING_PARITY,
297 EVEN_MARKING_PARITY
298 };
299
300 // ICs store extra state in a Code object. The default extra state is 287 // ICs store extra state in a Code object. The default extra state is
301 // kNoExtraICState. 288 // kNoExtraICState.
302 typedef int ExtraICState; 289 typedef int ExtraICState;
303 static const ExtraICState kNoExtraICState = 0; 290 static const ExtraICState kNoExtraICState = 0;
304 291
305 // Instance size sentinel for objects of variable size. 292 // Instance size sentinel for objects of variable size.
306 const int kVariableSizeSentinel = 0; 293 const int kVariableSizeSentinel = 0;
307 294
308 // We may store the unsigned bit field as signed Smi value and do not 295 // We may store the unsigned bit field as signed Smi value and do not
309 // use the sign bit. 296 // use the sign bit.
(...skipping 5424 matching lines...) Expand 10 before | Expand all | Expand 10 after
5734 5721
5735 // Code aging. Indicates how many full GCs this code has survived without 5722 // Code aging. Indicates how many full GCs this code has survived without
5736 // being entered through the prologue. Used to determine when it is 5723 // being entered through the prologue. Used to determine when it is
5737 // relatively safe to flush this code object and replace it with the lazy 5724 // relatively safe to flush this code object and replace it with the lazy
5738 // compilation stub. 5725 // compilation stub.
5739 static void MakeCodeAgeSequenceYoung(byte* sequence, Isolate* isolate); 5726 static void MakeCodeAgeSequenceYoung(byte* sequence, Isolate* isolate);
5740 static void MarkCodeAsExecuted(byte* sequence, Isolate* isolate); 5727 static void MarkCodeAsExecuted(byte* sequence, Isolate* isolate);
5741 void MakeYoung(Isolate* isolate); 5728 void MakeYoung(Isolate* isolate);
5742 void PreAge(Isolate* isolate); 5729 void PreAge(Isolate* isolate);
5743 void MarkToBeExecutedOnce(Isolate* isolate); 5730 void MarkToBeExecutedOnce(Isolate* isolate);
5744 void MakeOlder(MarkingParity); 5731 void MakeOlder();
5745 static bool IsYoungSequence(Isolate* isolate, byte* sequence); 5732 static bool IsYoungSequence(Isolate* isolate, byte* sequence);
5746 bool IsOld(); 5733 bool IsOld();
5747 Age GetAge(); 5734 Age GetAge();
5748 static inline Code* GetPreAgedCodeAgeStub(Isolate* isolate) { 5735 static inline Code* GetPreAgedCodeAgeStub(Isolate* isolate) {
5749 return GetCodeAgeStub(isolate, kNotExecutedCodeAge, NO_MARKING_PARITY); 5736 return GetCodeAgeStub(isolate, kNotExecutedCodeAge);
5750 } 5737 }
5751 5738
5752 void PrintDeoptLocation(FILE* out, Address pc); 5739 void PrintDeoptLocation(FILE* out, Address pc);
5753 bool CanDeoptAt(Address pc); 5740 bool CanDeoptAt(Address pc);
5754 5741
5755 #ifdef VERIFY_HEAP 5742 #ifdef VERIFY_HEAP
5756 void VerifyEmbeddedObjectsDependency(); 5743 void VerifyEmbeddedObjectsDependency();
5757 #endif 5744 #endif
5758 5745
5759 #ifdef DEBUG 5746 #ifdef DEBUG
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
5881 5868
5882 // This constant should be encodable in an ARM instruction. 5869 // This constant should be encodable in an ARM instruction.
5883 static const int kFlagsNotUsedInLookup = CacheHolderField::kMask; 5870 static const int kFlagsNotUsedInLookup = CacheHolderField::kMask;
5884 5871
5885 private: 5872 private:
5886 friend class RelocIterator; 5873 friend class RelocIterator;
5887 friend class Deoptimizer; // For FindCodeAgeSequence. 5874 friend class Deoptimizer; // For FindCodeAgeSequence.
5888 5875
5889 // Code aging 5876 // Code aging
5890 byte* FindCodeAgeSequence(); 5877 byte* FindCodeAgeSequence();
5891 static void GetCodeAgeAndParity(Code* code, Age* age, 5878 static Age GetCodeAge(Isolate* isolate, byte* sequence);
5892 MarkingParity* parity); 5879 static Age GetAgeOfCodeAgeStub(Code* code);
5893 static void GetCodeAgeAndParity(Isolate* isolate, byte* sequence, Age* age, 5880 static Code* GetCodeAgeStub(Isolate* isolate, Age age);
5894 MarkingParity* parity);
5895 static Code* GetCodeAgeStub(Isolate* isolate, Age age, MarkingParity parity);
5896 5881
5897 // Code aging -- platform-specific 5882 // Code aging -- platform-specific
5898 static void PatchPlatformCodeAge(Isolate* isolate, 5883 static void PatchPlatformCodeAge(Isolate* isolate, byte* sequence, Age age);
5899 byte* sequence, Age age,
5900 MarkingParity parity);
5901 5884
5902 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); 5885 DISALLOW_IMPLICIT_CONSTRUCTORS(Code);
5903 }; 5886 };
5904 5887
5905 class AbstractCode : public HeapObject { 5888 class AbstractCode : public HeapObject {
5906 public: 5889 public:
5907 // All code kinds and INTERPRETED_FUNCTION. 5890 // All code kinds and INTERPRETED_FUNCTION.
5908 enum Kind { 5891 enum Kind {
5909 #define DEFINE_CODE_KIND_ENUM(name) name, 5892 #define DEFINE_CODE_KIND_ENUM(name) name,
5910 CODE_KIND_LIST(DEFINE_CODE_KIND_ENUM) 5893 CODE_KIND_LIST(DEFINE_CODE_KIND_ENUM)
(...skipping 5966 matching lines...) Expand 10 before | Expand all | Expand 10 after
11877 } 11860 }
11878 return value; 11861 return value;
11879 } 11862 }
11880 }; 11863 };
11881 11864
11882 11865
11883 } // NOLINT, false-positive due to second-order macros. 11866 } // NOLINT, false-positive due to second-order macros.
11884 } // NOLINT, false-positive due to second-order macros. 11867 } // NOLINT, false-positive due to second-order macros.
11885 11868
11886 #endif // V8_OBJECTS_H_ 11869 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698