Bug 1553491 - Renumber MarkColor to match intuition that 'black' is more marked than 'gray' r=sfink?
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 22 May 2019 20:29:10 +0000
changeset 475174 7cce412dd61b40d0ceda37ed32a64dda7d7b5e8d
parent 475173 7286e18fbc1775558b8653bb63576a47b31a5f3e
child 475175 97fd39fe7f582ff714a56a65194bf9ca01711686
push id36057
push useraciure@mozilla.com
push dateThu, 23 May 2019 21:52:03 +0000
treeherdermozilla-central@d551d37b9ad0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1553491
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1553491 - Renumber MarkColor to match intuition that 'black' is more marked than 'gray' r=sfink? Differential Revision: https://phabricator.services.mozilla.com/D32160
js/src/gc/GCEnum.h
js/src/gc/Verifier.h
--- a/js/src/gc/GCEnum.h
+++ b/js/src/gc/GCEnum.h
@@ -11,18 +11,19 @@
 #ifndef gc_GCEnum_h
 #define gc_GCEnum_h
 
 #include <stdint.h>
 
 namespace js {
 namespace gc {
 
-// Mark colors to pass to markIfUnmarked.
-enum class MarkColor : uint32_t { Black = 0, Gray };
+// Mark colors. Order is important here: the greater value the 'more marked' a
+// cell is.
+enum class MarkColor : uint8_t { Gray = 1, Black = 2 };
 
 // The phases of an incremental GC.
 #define GCSTATES(D) \
   D(NotActive)      \
   D(MarkRoots)      \
   D(Mark)           \
   D(Sweep)          \
   D(Finalize)       \
--- a/js/src/gc/Verifier.h
+++ b/js/src/gc/Verifier.h
@@ -12,19 +12,22 @@
 #define gc_Verifier_h
 
 #include "gc/Cell.h"
 
 namespace js {
 namespace gc {
 
 // Like gc::MarkColor but allows the possibility of the cell being
-// unmarked. Order is important here, with white being 'least marked'
-// and black being 'most marked'.
-enum class CellColor : uint8_t { White = 0, Gray = 1, Black = 2 };
+// unmarked.
+enum class CellColor : uint8_t {
+  White = 0,
+  Gray = uint8_t(MarkColor::Gray),
+  Black = uint8_t(MarkColor::Black)
+};
 
 static constexpr CellColor AllCellColors[] = {
   CellColor::White, CellColor::Gray, CellColor::Black
 };
 
 static constexpr CellColor MarkedCellColors[] = {
   CellColor::Gray, CellColor::Black
 };