diff options
Diffstat (limited to 'JavaScriptCore/runtime/Lookup.h')
| -rw-r--r-- | JavaScriptCore/runtime/Lookup.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/JavaScriptCore/runtime/Lookup.h b/JavaScriptCore/runtime/Lookup.h index e673c09..9bc81d4 100644 --- a/JavaScriptCore/runtime/Lookup.h +++ b/JavaScriptCore/runtime/Lookup.h @@ -37,13 +37,15 @@ #endif namespace JSC { - // Hash table generated by the create_hash_table script. struct HashTableValue { const char* key; // property name unsigned char attributes; // JSObject attributes intptr_t value1; intptr_t value2; +#if ENABLE(JIT) + ThunkGenerator generator; +#endif }; // FIXME: There is no reason this get function can't be simpler. @@ -53,20 +55,30 @@ namespace JSC { class HashEntry : public FastAllocBase { public: - void initialize(UString::Rep* key, unsigned char attributes, intptr_t v1, intptr_t v2) + void initialize(StringImpl* key, unsigned char attributes, intptr_t v1, intptr_t v2 +#if ENABLE(JIT) + , ThunkGenerator generator = 0 +#endif + ) { m_key = key; m_attributes = attributes; m_u.store.value1 = v1; m_u.store.value2 = v2; +#if ENABLE(JIT) + m_u.function.generator = generator; +#endif m_next = 0; } - void setKey(UString::Rep* key) { m_key = key; } - UString::Rep* key() const { return m_key; } + void setKey(StringImpl* key) { m_key = key; } + StringImpl* key() const { return m_key; } unsigned char attributes() const { return m_attributes; } +#if ENABLE(JIT) && ENABLE(JIT_OPTIMIZE_NATIVE_CALL) + ThunkGenerator generator() const { ASSERT(m_attributes & Function); return m_u.function.generator; } +#endif NativeFunction function() const { ASSERT(m_attributes & Function); return m_u.function.functionValue; } unsigned char functionLength() const { ASSERT(m_attributes & Function); return static_cast<unsigned char>(m_u.function.length); } @@ -79,7 +91,7 @@ namespace JSC { HashEntry* next() const { return m_next; } private: - UString::Rep* m_key; + StringImpl* m_key; unsigned char m_attributes; // JSObject attributes union { @@ -90,6 +102,9 @@ namespace JSC { struct { NativeFunction functionValue; intptr_t length; // number of arguments for function +#if ENABLE(JIT) + ThunkGenerator generator; +#endif } function; struct { GetFunction get; @@ -144,13 +159,13 @@ namespace JSC { { ASSERT(table); - const HashEntry* entry = &table[identifier.ustring().rep()->existingHash() & compactHashSizeMask]; + const HashEntry* entry = &table[identifier.impl()->existingHash() & compactHashSizeMask]; if (!entry->key()) return 0; do { - if (entry->key() == identifier.ustring().rep()) + if (entry->key() == identifier.impl()) return entry; entry = entry->next(); } while (entry); @@ -181,7 +196,7 @@ namespace JSC { if (entry->attributes() & Function) setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot); else - slot.setCustom(thisObj, entry->propertyGetter()); + slot.setCacheableCustom(thisObj, entry->propertyGetter()); return true; } @@ -258,7 +273,7 @@ namespace JSC { ASSERT(!(entry->attributes() & Function)); - slot.setCustom(thisObj, entry->propertyGetter()); + slot.setCacheableCustom(thisObj, entry->propertyGetter()); return true; } |
