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

Unified Diff: src/flags.cc

Issue 1011703003: Serializer: Cache FlagList::Hash result. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test case Created 5 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flags.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/flags.cc
diff --git a/src/flags.cc b/src/flags.cc
index d498c28240488916d96ce8e7560328682981d31a..7386238090237386154987c7c3c86a89d48d7b68 100644
--- a/src/flags.cc
+++ b/src/flags.cc
@@ -543,15 +543,10 @@ void FlagList::PrintHelp() {
}
-// static
-void FlagList::EnforceFlagImplications() {
-#define FLAG_MODE_DEFINE_IMPLICATIONS
-#include "src/flag-definitions.h"
-#undef FLAG_MODE_DEFINE_IMPLICATIONS
-}
+static uint32_t flag_hash = 0;
-uint32_t FlagList::Hash() {
+void ComputeFlagListHash() {
std::ostringstream modified_args_as_string;
#ifdef DEBUG
modified_args_as_string << "debug";
@@ -564,7 +559,19 @@ uint32_t FlagList::Hash() {
}
}
std::string args(modified_args_as_string.str());
- return static_cast<uint32_t>(
+ flag_hash = static_cast<uint32_t>(
base::hash_range(args.c_str(), args.c_str() + args.length()));
}
+
+
+// static
+void FlagList::EnforceFlagImplications() {
+#define FLAG_MODE_DEFINE_IMPLICATIONS
+#include "src/flag-definitions.h"
+#undef FLAG_MODE_DEFINE_IMPLICATIONS
+ ComputeFlagListHash();
+}
+
+
+uint32_t FlagList::Hash() { return flag_hash; }
} } // namespace v8::internal
« no previous file with comments | « src/flags.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698