Index: src/globals.h |
diff --git a/src/globals.h b/src/globals.h |
index 83fa2fa720e7b660034d84df15ee9a3c4a2e18cb..761a85d011f10a43c15d0e3ef2bd1ba5d38c4eb0 100644 |
--- a/src/globals.h |
+++ b/src/globals.h |
@@ -227,25 +227,47 @@ template <typename T, class P = FreeStoreAllocationPolicy> class List; |
enum LanguageMode { |
// LanguageMode is expressed as a bitmask. Descriptions of the bits: |
- STRICT = 1 << 0, |
+ STRICT_BIT = 1 << 0, |
+ STRONG_BIT = 1 << 1, |
LANGUAGE_END, |
// Shorthands for some common language modes. |
- SLOPPY = 0 |
+ SLOPPY = 0, |
+ STRICT = STRICT_BIT, |
+ STRONG = STRICT_BIT | STRONG_BIT |
}; |
+ |
+inline bool is_sloppy(LanguageMode language_mode) { |
+ return (language_mode & STRICT_BIT) == 0; |
+} |
+ |
+ |
inline bool is_strict(LanguageMode language_mode) { |
- return language_mode & STRICT; |
+ return language_mode & STRICT_BIT; |
} |
-inline bool is_sloppy(LanguageMode language_mode) { |
- return (language_mode & STRICT) == 0; |
+ |
+inline bool is_strong(LanguageMode language_mode) { |
+ return language_mode & STRONG_BIT; |
} |
+ |
inline bool is_valid_language_mode(int language_mode) { |
- return language_mode == SLOPPY || language_mode == STRICT; |
+ return language_mode == SLOPPY || language_mode == STRICT || |
+ language_mode == STRONG; |
+} |
+ |
+ |
+inline LanguageMode construct_language_mode(bool strict_bit, bool strong_bit) { |
+ int language_mode = 0; |
+ if (strict_bit) language_mode |= STRICT_BIT; |
+ if (strong_bit) language_mode |= STRONG_BIT; |
+ DCHECK(is_valid_language_mode(language_mode)); |
+ return static_cast<LanguageMode>(language_mode); |
} |
+ |
// Mask for the sign bit in a smi. |
const intptr_t kSmiSignMask = kIntptrSignBit; |