Index: src/globals.h |
diff --git a/src/globals.h b/src/globals.h |
index 9466c57f750d64e9e4ae226327bc66d890fdcbda..03b64f073f468139149a2b7369e895cd3cccbdb8 100644 |
--- a/src/globals.h |
+++ b/src/globals.h |
@@ -1234,6 +1234,27 @@ enum LiveEditFrameDropMode { |
LIVE_EDIT_CURRENTLY_SET_MODE |
}; |
+enum class UnicodeEncoding : uint8_t { |
+ // Different unicode encodings in a |word32|: |
+ UTF16, // hi 16bits -> trailing surrogate or 0, low 16bits -> lead surrogate |
+ UTF32, // full UTF32 code unit / Unicode codepoint |
+}; |
+ |
+inline size_t hash_value(UnicodeEncoding encoding) { |
+ return static_cast<uint8_t>(encoding); |
+} |
+ |
+inline std::ostream& operator<<(std::ostream& os, UnicodeEncoding encoding) { |
+ switch (encoding) { |
+ case UnicodeEncoding::UTF16: |
+ return os << "UTF16"; |
+ case UnicodeEncoding::UTF32: |
+ return os << "UTF32"; |
+ } |
+ UNREACHABLE(); |
+ return os; |
+} |
+ |
} // namespace internal |
} // namespace v8 |