#ifndef ParserArena_h
#define ParserArena_h
+#include "CommonIdentifiers.h"
#include "Identifier.h"
+#include <array>
#include <wtf/SegmentedVector.h>
namespace JSC {
private:
IdentifierVector m_identifiers;
- FixedArray<Identifier*, MaximumCachableCharacter> m_shortIdentifiers;
- FixedArray<Identifier*, MaximumCachableCharacter> m_recentIdentifiers;
+ std::array<Identifier*, MaximumCachableCharacter> m_shortIdentifiers;
+ std::array<Identifier*, MaximumCachableCharacter> m_recentIdentifiers;
};
template <typename T>
ALWAYS_INLINE const Identifier& IdentifierArena::makeIdentifier(VM* vm, const T* characters, size_t length)
{
+ if (!length)
+ return vm->propertyNames->emptyIdentifier;
if (characters[0] >= MaximumCachableCharacter) {
m_identifiers.append(Identifier(vm, characters, length));
return m_identifiers.last();
ALWAYS_INLINE const Identifier& IdentifierArena::makeIdentifierLCharFromUChar(VM* vm, const UChar* characters, size_t length)
{
+ if (!length)
+ return vm->propertyNames->emptyIdentifier;
if (characters[0] >= MaximumCachableCharacter) {
m_identifiers.append(Identifier::createLCharFromUChar(vm, characters, length));
return m_identifiers.last();
OwnPtr<IdentifierArena> m_identifierArena;
Vector<void*> m_freeablePools;
Vector<ParserArenaDeletable*> m_deletableObjects;
- Vector<RefPtr<ParserArenaRefCounted> > m_refCountedObjects;
+ Vector<RefPtr<ParserArenaRefCounted>> m_refCountedObjects;
};
}