Index: src/flags.cc |
diff --git a/src/flags.cc b/src/flags.cc |
index e53c45e69d3a35e904f6853035cf6f7c24826f12..2aa4e6bd48587e2a267f4eb1563c7a1fb428d6d5 100644 |
--- a/src/flags.cc |
+++ b/src/flags.cc |
@@ -9,6 +9,7 @@ |
#include "src/v8.h" |
#include "src/assembler.h" |
+#include "src/base/functional.h" |
#include "src/base/platform/platform.h" |
#include "src/ostreams.h" |
@@ -549,4 +550,17 @@ void FlagList::EnforceFlagImplications() { |
#undef FLAG_MODE_DEFINE_IMPLICATIONS |
} |
+ |
+uint32_t FlagList::Hash() { |
+ std::ostringstream modified_args_as_string; |
+ for (size_t i = 0; i < num_flags; ++i) { |
+ Flag* current = &flags[i]; |
+ if (!current->IsDefault()) { |
+ modified_args_as_string << *current; |
+ } |
+ } |
+ std::string args(modified_args_as_string.str()); |
+ return static_cast<uint32_t>( |
+ base::hash_range(args.c_str(), args.c_str() + args.length())); |
+} |
} } // namespace v8::internal |