-IdentifierTable* createIdentifierTable()
-{
- return new IdentifierTable;
-}
-
-void deleteIdentifierTable(IdentifierTable* table)
-{
- delete table;
-}
-
-struct IdentifierASCIIStringTranslator {
- static unsigned hash(const LChar* c)
- {
- return StringHasher::computeHashAndMaskTop8Bits(c);
- }
-
- static bool equal(StringImpl* r, const LChar* s)
- {
- return Identifier::equal(r, s);
- }
-
- static void translate(StringImpl*& location, const LChar* c, unsigned hash)
- {
- size_t length = strlen(reinterpret_cast<const char*>(c));
- location = StringImpl::createFromLiteral(reinterpret_cast<const char*>(c), length).leakRef();
- location->setHash(hash);
- }
-};
-
-struct IdentifierLCharFromUCharTranslator {
- static unsigned hash(const CharBuffer<UChar>& buf)
- {
- return StringHasher::computeHashAndMaskTop8Bits(buf.s, buf.length);
- }
-
- static bool equal(StringImpl* str, const CharBuffer<UChar>& buf)
- {
- return Identifier::equal(str, buf.s, buf.length);
- }
-
- static void translate(StringImpl*& location, const CharBuffer<UChar>& buf, unsigned hash)
- {
- LChar* d;
- StringImpl* r = StringImpl::createUninitialized(buf.length, d).leakRef();
- WTF::copyLCharsFromUCharSource(d, buf.s, buf.length);
- r->setHash(hash);
- location = r;
- }
-};
-
-PassRefPtr<StringImpl> Identifier::add(VM* vm, const char* c)