- JSString* emptyString(JSGlobalData* globalData)
- {
- if (!m_emptyString)
- createEmptyString(globalData);
- return m_emptyString;
- }
- JSString* singleCharacterString(JSGlobalData* globalData, unsigned char character)
- {
- if (!m_singleCharacterStrings[character])
- createSingleCharacterString(globalData, character);
- return m_singleCharacterStrings[character];
+ JSString* emptyString()
+ {
+ return m_emptyString;
+ }
+
+ JSString* singleCharacterString(unsigned char character)
+ {
+ return m_singleCharacterStrings[character];
+ }
+
+ JS_EXPORT_PRIVATE WTF::StringImpl* singleCharacterStringRep(unsigned char character);
+
+ JSString** singleCharacterStrings() { return &m_singleCharacterStrings[0]; }
+
+ void initializeCommonStrings(VM&);
+ void visitStrongReferences(SlotVisitor&);
+
+#define JSC_COMMON_STRINGS_ACCESSOR_DEFINITION(name) \
+ JSString* name##String() const \
+ { \
+ return m_##name; \
+ }
+ JSC_COMMON_STRINGS_EACH_NAME(JSC_COMMON_STRINGS_ACCESSOR_DEFINITION)
+#undef JSC_COMMON_STRINGS_ACCESSOR_DEFINITION
+
+ JSString* typeString(TypeofType type) const
+ {
+ switch (type) {
+ case TypeofType::Undefined:
+ return undefinedString();
+ case TypeofType::Boolean:
+ return booleanString();
+ case TypeofType::Number:
+ return numberString();
+ case TypeofType::String:
+ return stringString();
+ case TypeofType::Symbol:
+ return symbolString();
+ case TypeofType::Object:
+ return objectString();
+ case TypeofType::Function:
+ return functionString();