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

Unified Diff: src/globals.h

Issue 894683003: Introduce LanguageMode, drop StrictMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased (w/ conflicts) Created 5 years, 10 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/full-codegen.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index 5bc0ec2f01f4879de0ac9e018163925b5f8c3c8b..83fa2fa720e7b660034d84df15ee9a3c4a2e18cb 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -225,8 +225,26 @@ template <typename T, class P = FreeStoreAllocationPolicy> class List;
// The Strict Mode (ECMA-262 5th edition, 4.2.2).
-enum StrictMode { SLOPPY, STRICT };
+enum LanguageMode {
+ // LanguageMode is expressed as a bitmask. Descriptions of the bits:
+ STRICT = 1 << 0,
+ LANGUAGE_END,
+ // Shorthands for some common language modes.
+ SLOPPY = 0
+};
+
+inline bool is_strict(LanguageMode language_mode) {
+ return language_mode & STRICT;
+}
+
+inline bool is_sloppy(LanguageMode language_mode) {
+ return (language_mode & STRICT) == 0;
+}
+
+inline bool is_valid_language_mode(int language_mode) {
+ return language_mode == SLOPPY || language_mode == STRICT;
+}
// Mask for the sign bit in a smi.
const intptr_t kSmiSignMask = kIntptrSignBit;
« no previous file with comments | « src/full-codegen.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698