]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/CommonIdentifiers.cpp
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / runtime / CommonIdentifiers.cpp
index 56df3450287ff999a38fcf4cb7150e861a5643e8..21bc4c7cefde867d8ab51c572be15979be8120f0 100644 (file)
 #include "CommonIdentifiers.h"
 
 #include "BuiltinNames.h"
+#include "IdentifierInlines.h"
 #include "JSCBuiltins.h"
 #include "PrivateName.h"
 
 namespace JSC {
 
-#define INITIALIZE_PROPERTY_NAME(name) , name(vm, #name)
-#define INITIALIZE_KEYWORD(name) , name##Keyword(vm, #name)
+#define INITIALIZE_PROPERTY_NAME(name) , name(Identifier::fromString(vm, #name))
+#define INITIALIZE_KEYWORD(name) , name##Keyword(Identifier::fromString(vm, #name))
 #define INITIALIZE_PRIVATE_NAME(name) , name##PrivateName(m_builtinNames->name##PrivateName())
+#define INITIALIZE_SYMBOL(name) , name##Symbol(m_builtinNames->name##Symbol())
 
 CommonIdentifiers::CommonIdentifiers(VM* vm)
     : nullIdentifier()
     , emptyIdentifier(Identifier::EmptyIdentifier)
-    , underscoreProto(vm, "__proto__")
-    , thisIdentifier(vm, "this")
-    , useStrictIdentifier(vm, "use strict")
+    , underscoreProto(Identifier::fromString(vm, "__proto__"))
+    , thisIdentifier(Identifier::fromString(vm, "this"))
+    , useStrictIdentifier(Identifier::fromString(vm, "use strict"))
     , m_builtinNames(new BuiltinNames(vm, this))
     JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(INITIALIZE_KEYWORD)
     JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PROPERTY_NAME)
     JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PRIVATE_NAME)
+    JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_SYMBOL)
+    , m_bytecodeIntrinsicRegistry(*this)
 {
 }
 
@@ -48,6 +52,21 @@ CommonIdentifiers::~CommonIdentifiers()
 {
 }
 
+bool CommonIdentifiers::isPrivateName(SymbolImpl& uid) const
+{
+    return m_builtinNames->isPrivateName(uid);
+}
+
+bool CommonIdentifiers::isPrivateName(UniquedStringImpl& uid) const
+{
+    return m_builtinNames->isPrivateName(uid);
+}
+
+bool CommonIdentifiers::isPrivateName(const Identifier& ident) const
+{
+    return m_builtinNames->isPrivateName(ident);
+}
+
 const Identifier* CommonIdentifiers::getPrivateName(const Identifier& ident) const
 {
     return m_builtinNames->getPrivateName(ident);