Commit eee40ea6 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Fix printing of GVN flags.

R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/142253003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19185 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5b890419
...@@ -439,7 +439,7 @@ void HGlobalValueNumberingPhase::ComputeBlockSideEffects() { ...@@ -439,7 +439,7 @@ void HGlobalValueNumberingPhase::ComputeBlockSideEffects() {
SmartArrayPointer<char> GetGVNFlagsString(GVNFlagSet flags) { SmartArrayPointer<char> GetGVNFlagsString(GVNFlagSet flags) {
char underlying_buffer[kLastFlag * 128]; char underlying_buffer[kNumberOfFlags * 128];
Vector<char> buffer(underlying_buffer, sizeof(underlying_buffer)); Vector<char> buffer(underlying_buffer, sizeof(underlying_buffer));
#if DEBUG #if DEBUG
int offset = 0; int offset = 0;
...@@ -448,7 +448,7 @@ SmartArrayPointer<char> GetGVNFlagsString(GVNFlagSet flags) { ...@@ -448,7 +448,7 @@ SmartArrayPointer<char> GetGVNFlagsString(GVNFlagSet flags) {
buffer[0] = 0; buffer[0] = 0;
uint32_t set_depends_on = 0; uint32_t set_depends_on = 0;
uint32_t set_changes = 0; uint32_t set_changes = 0;
for (int bit = 0; bit < kLastFlag; ++bit) { for (int bit = 0; bit < kNumberOfFlags; ++bit) {
if (flags.Contains(static_cast<GVNFlag>(bit))) { if (flags.Contains(static_cast<GVNFlag>(bit))) {
if (bit % 2 == 0) { if (bit % 2 == 0) {
set_changes++; set_changes++;
...@@ -457,15 +457,15 @@ SmartArrayPointer<char> GetGVNFlagsString(GVNFlagSet flags) { ...@@ -457,15 +457,15 @@ SmartArrayPointer<char> GetGVNFlagsString(GVNFlagSet flags) {
} }
} }
} }
bool positive_changes = set_changes < (kLastFlag / 2); bool positive_changes = set_changes < (kNumberOfFlags / 2);
bool positive_depends_on = set_depends_on < (kLastFlag / 2); bool positive_depends_on = set_depends_on < (kNumberOfFlags / 2);
if (set_changes > 0) { if (set_changes > 0) {
if (positive_changes) { if (positive_changes) {
offset += OS::SNPrintF(buffer + offset, "changes ["); offset += OS::SNPrintF(buffer + offset, "changes [");
} else { } else {
offset += OS::SNPrintF(buffer + offset, "changes all except ["); offset += OS::SNPrintF(buffer + offset, "changes all except [");
} }
for (int bit = 0; bit < kLastFlag; ++bit) { for (int bit = 0; bit < kNumberOfFlags; ++bit) {
if (flags.Contains(static_cast<GVNFlag>(bit)) == positive_changes) { if (flags.Contains(static_cast<GVNFlag>(bit)) == positive_changes) {
switch (static_cast<GVNFlag>(bit)) { switch (static_cast<GVNFlag>(bit)) {
#define DECLARE_FLAG(type) \ #define DECLARE_FLAG(type) \
...@@ -494,7 +494,7 @@ GVN_UNTRACKED_FLAG_LIST(DECLARE_FLAG) ...@@ -494,7 +494,7 @@ GVN_UNTRACKED_FLAG_LIST(DECLARE_FLAG)
} else { } else {
offset += OS::SNPrintF(buffer + offset, "depends on all except ["); offset += OS::SNPrintF(buffer + offset, "depends on all except [");
} }
for (int bit = 0; bit < kLastFlag; ++bit) { for (int bit = 0; bit < kNumberOfFlags; ++bit) {
if (flags.Contains(static_cast<GVNFlag>(bit)) == positive_depends_on) { if (flags.Contains(static_cast<GVNFlag>(bit)) == positive_depends_on) {
switch (static_cast<GVNFlag>(bit)) { switch (static_cast<GVNFlag>(bit)) {
#define DECLARE_FLAG(type) \ #define DECLARE_FLAG(type) \
......
...@@ -482,8 +482,7 @@ enum GVNFlag { ...@@ -482,8 +482,7 @@ enum GVNFlag {
GVN_TRACKED_FLAG_LIST(DECLARE_FLAG) GVN_TRACKED_FLAG_LIST(DECLARE_FLAG)
GVN_UNTRACKED_FLAG_LIST(DECLARE_FLAG) GVN_UNTRACKED_FLAG_LIST(DECLARE_FLAG)
#undef DECLARE_FLAG #undef DECLARE_FLAG
kAfterLastFlag, kNumberOfFlags,
kLastFlag = kAfterLastFlag - 1,
#define COUNT_FLAG(type) + 1 #define COUNT_FLAG(type) + 1
kNumberOfTrackedSideEffects = 0 GVN_TRACKED_FLAG_LIST(COUNT_FLAG) kNumberOfTrackedSideEffects = 0 GVN_TRACKED_FLAG_LIST(COUNT_FLAG)
#undef COUNT_FLAG #undef COUNT_FLAG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment