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

Unified Diff: src/globals.h

Issue 1084243005: [turbofan] Sanitize language mode for javascript operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index e8384722aef6a852546b4187803930e1b5d513aa..e71314f9c1af9558e6e249e16cdaab7dca870397 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -8,6 +8,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <ostream>
+
#include "src/base/build_config.h"
#include "src/base/logging.h"
#include "src/base/macros.h"
@@ -238,6 +240,20 @@ enum LanguageMode {
};
+inline std::ostream& operator<<(std::ostream& os, LanguageMode mode) {
+ switch (mode) {
+ case SLOPPY:
+ return os << "sloppy";
+ case STRICT:
+ return os << "strict";
+ case STRONG:
+ return os << "strong";
+ default:
+ return os << "unknown";
+ }
+}
+
+
inline bool is_sloppy(LanguageMode language_mode) {
return (language_mode & STRICT_BIT) == 0;
}

Powered by Google App Engine
This is Rietveld 408576698