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

Unified Diff: src/flags.cc

Issue 718043002: Add a version tag for cached data. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Final rebase. Created 6 years, 1 month 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') | no next file » | 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 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
« no previous file with comments | « src/flags.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698