Bug 1553491 - Renumber MarkColor to match intuition that 'black' is more marked than 'gray' r=sfink?

Differential Revision: https://phabricator.services.mozilla.com/D32160

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jon Coppeard 2019-05-22 20:29:10 +00:00
parent c0ba509142
commit 142265f751
2 changed files with 9 additions and 5 deletions

View File

@ -16,8 +16,9 @@
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) \

View File

@ -17,9 +17,12 @@ 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