Changeset 145945 in webkit


Ignore:
Timestamp:
Mar 15, 2013 2:52:35 PM (11 years ago)
Author:
mhahnenberg@apple.com
Message:

Roll out r145838
https://bugs.webkit.org/show_bug.cgi?id=112458

Unreviewed. Requested by Filip Pizlo.

Source/JavaScriptCore:

  • CMakeLists.txt:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • dfg/DFGOperations.cpp:
  • interpreter/CallFrame.h:

(JSC::ExecState::objectPrototypeTable):

  • jit/JITStubs.cpp:

(JSC::getByVal):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::getByVal):

  • runtime/CommonIdentifiers.h:
  • runtime/JSCell.cpp:

(JSC):

  • runtime/JSCell.h:

(JSCell):

  • runtime/JSCellInlines.h:

(JSC):
(JSC::JSCell::fastGetOwnProperty):

  • runtime/JSGlobalData.cpp:

(JSC):
(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::~JSGlobalData):

  • runtime/JSGlobalData.h:

(JSGlobalData):

  • runtime/JSObject.cpp:

(JSC):

  • runtime/JSObject.h:

(JSObject):
(JSC):

  • runtime/Lookup.cpp:

(JSC::setUpStaticFunctionSlot):

  • runtime/ObjectPrototype.cpp:

(JSC):
(JSC::ObjectPrototype::finishCreation):
(JSC::ObjectPrototype::getOwnPropertySlot):
(JSC::ObjectPrototype::getOwnPropertyDescriptor):

  • runtime/ObjectPrototype.h:

(JSC::ObjectPrototype::create):
(ObjectPrototype):

  • runtime/PropertyMapHashTable.h:

(JSC::PropertyTable::findWithString):

  • runtime/Structure.h:

(Structure):

  • runtime/StructureInlines.h:

(JSC::Structure::get):

LayoutTests:

  • fast/js/regress/script-tests/string-lookup-hit-identifier.js: Removed.
  • fast/js/regress/script-tests/string-lookup-hit.js: Removed.
  • fast/js/regress/script-tests/string-lookup-miss.js: Removed.
  • fast/js/regress/string-lookup-hit-expected.txt: Removed.
  • fast/js/regress/string-lookup-hit-identifier-expected.txt: Removed.
  • fast/js/regress/string-lookup-hit-identifier.html: Removed.
  • fast/js/regress/string-lookup-hit.html: Removed.
  • fast/js/regress/string-lookup-miss-expected.txt: Removed.
  • fast/js/regress/string-lookup-miss.html: Removed.
Location:
trunk
Files:
9 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r145940 r145945  
     12013-03-15  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Roll out r145838
     4        https://bugs.webkit.org/show_bug.cgi?id=112458
     5
     6        Unreviewed. Requested by Filip Pizlo.
     7
     8        * fast/js/regress/script-tests/string-lookup-hit-identifier.js: Removed.
     9        * fast/js/regress/script-tests/string-lookup-hit.js: Removed.
     10        * fast/js/regress/script-tests/string-lookup-miss.js: Removed.
     11        * fast/js/regress/string-lookup-hit-expected.txt: Removed.
     12        * fast/js/regress/string-lookup-hit-identifier-expected.txt: Removed.
     13        * fast/js/regress/string-lookup-hit-identifier.html: Removed.
     14        * fast/js/regress/string-lookup-hit.html: Removed.
     15        * fast/js/regress/string-lookup-miss-expected.txt: Removed.
     16        * fast/js/regress/string-lookup-miss.html: Removed.
     17
    1182013-03-15  Rouslan Solomakhin  <rouslan@chromium.org>
    219
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r145838 r145945  
    330330    runtime/NumberPrototype.cpp
    331331    runtime/ObjectConstructor.cpp
     332    runtime/ObjectPrototype.cpp
    332333    runtime/RegExpConstructor.cpp
    333334    runtime/RegExpObject.cpp
  • trunk/Source/JavaScriptCore/ChangeLog

    r145933 r145945  
     12013-03-15  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Roll out r145838
     4        https://bugs.webkit.org/show_bug.cgi?id=112458
     5
     6        Unreviewed. Requested by Filip Pizlo.
     7
     8        * CMakeLists.txt:
     9        * DerivedSources.make:
     10        * DerivedSources.pri:
     11        * GNUmakefile.list.am:
     12        * dfg/DFGOperations.cpp:
     13        * interpreter/CallFrame.h:
     14        (JSC::ExecState::objectPrototypeTable):
     15        * jit/JITStubs.cpp:
     16        (JSC::getByVal):
     17        * llint/LLIntSlowPaths.cpp:
     18        (JSC::LLInt::getByVal):
     19        * runtime/CommonIdentifiers.h:
     20        * runtime/JSCell.cpp:
     21        (JSC):
     22        * runtime/JSCell.h:
     23        (JSCell):
     24        * runtime/JSCellInlines.h:
     25        (JSC):
     26        (JSC::JSCell::fastGetOwnProperty):
     27        * runtime/JSGlobalData.cpp:
     28        (JSC):
     29        (JSC::JSGlobalData::JSGlobalData):
     30        (JSC::JSGlobalData::~JSGlobalData):
     31        * runtime/JSGlobalData.h:
     32        (JSGlobalData):
     33        * runtime/JSObject.cpp:
     34        (JSC):
     35        * runtime/JSObject.h:
     36        (JSObject):
     37        (JSC):
     38        * runtime/Lookup.cpp:
     39        (JSC::setUpStaticFunctionSlot):
     40        * runtime/ObjectPrototype.cpp:
     41        (JSC):
     42        (JSC::ObjectPrototype::finishCreation):
     43        (JSC::ObjectPrototype::getOwnPropertySlot):
     44        (JSC::ObjectPrototype::getOwnPropertyDescriptor):
     45        * runtime/ObjectPrototype.h:
     46        (JSC::ObjectPrototype::create):
     47        (ObjectPrototype):
     48        * runtime/PropertyMapHashTable.h:
     49        (JSC::PropertyTable::findWithString):
     50        * runtime/Structure.h:
     51        (Structure):
     52        * runtime/StructureInlines.h:
     53        (JSC::Structure::get):
     54
    1552013-03-15  Michael Saboff  <msaboff@apple.com>
    256
  • trunk/Source/JavaScriptCore/DerivedSources.make

    r145838 r145945  
    5151    NumberPrototype.lut.h \
    5252    ObjectConstructor.lut.h \
     53    ObjectPrototype.lut.h \
    5354    RegExpConstructor.lut.h \
    5455    RegExpPrototype.lut.h \
  • trunk/Source/JavaScriptCore/DerivedSources.pri

    r145838 r145945  
    2121    runtime/NumberPrototype.cpp \
    2222    runtime/ObjectConstructor.cpp \
     23    runtime/ObjectPrototype.cpp \
    2324    runtime/RegExpConstructor.cpp \
    2425    runtime/RegExpObject.cpp \
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r145848 r145945  
    2525        DerivedSources/JavaScriptCore/NumberPrototype.lut.h \
    2626        DerivedSources/JavaScriptCore/ObjectConstructor.lut.h \
     27   DerivedSources/JavaScriptCore/ObjectPrototype.lut.h \
    2728        DerivedSources/JavaScriptCore/RegExpConstructor.lut.h \
    2829        DerivedSources/JavaScriptCore/RegExpObject.lut.h \
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r145838 r145945  
    425425        JSCell* base = baseValue.asCell();
    426426
    427         if (property.isUInt32())
     427        if (property.isUInt32()) {
    428428            return getByVal(exec, base, property.asUInt32());
    429         if (property.isDouble()) {
     429        } else if (property.isDouble()) {
    430430            double propertyAsDouble = property.asDouble();
    431431            uint32_t propertyAsUInt32 = static_cast<uint32_t>(propertyAsDouble);
    432432            if (propertyAsUInt32 == propertyAsDouble)
    433433                return getByVal(exec, base, propertyAsUInt32);
    434         } else if (property.isString())
    435             return JSValue::encode(base->getByString(exec, asString(property)->value(exec)));
    436     }
    437    
     434        } else if (property.isString()) {
     435            if (JSValue result = base->fastGetOwnProperty(exec, asString(property)->value(exec)))
     436                return JSValue::encode(result);
     437        }
     438    }
     439
    438440    if (isName(property))
    439441        return JSValue::encode(baseValue.get(exec, jsCast<NameInstance*>(property.asCell())->privateName()));
     
    452454    if (property.isUInt32())
    453455        return getByVal(exec, base, property.asUInt32());
    454     else if (property.isDouble()) {
     456    if (property.isDouble()) {
    455457        double propertyAsDouble = property.asDouble();
    456458        uint32_t propertyAsUInt32 = static_cast<uint32_t>(propertyAsDouble);
    457459        if (propertyAsUInt32 == propertyAsDouble)
    458460            return getByVal(exec, base, propertyAsUInt32);
    459     } else if (property.isString())
    460         return JSValue::encode(base->getByString(exec, asString(property)->value(exec)));
     461    } else if (property.isString()) {
     462        if (JSValue result = base->fastGetOwnProperty(exec, asString(property)->value(exec)))
     463            return JSValue::encode(result);
     464    }
    461465
    462466    if (isName(property))
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r145838 r145945  
    9191        static const HashTable* numberPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().numberPrototypeTable; }
    9292        static const HashTable* objectConstructorTable(CallFrame* callFrame) { return callFrame->globalData().objectConstructorTable; }
     93        static const HashTable* objectPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().objectPrototypeTable; }
    9394        static const HashTable* privateNamePrototypeTable(CallFrame* callFrame) { return callFrame->globalData().privateNamePrototypeTable; }
    9495        static const HashTable* regExpTable(CallFrame* callFrame) { return callFrame->globalData().regExpTable; }
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r145838 r145945  
    24182418    CallFrame* callFrame, JSValue baseValue, JSValue subscript, ReturnAddressPtr returnAddress)
    24192419{
    2420     if (LIKELY(baseValue.isCell() && subscript.isString()))
    2421         return baseValue.asCell()->getByString(callFrame, asString(subscript)->value(callFrame));
     2420    if (LIKELY(baseValue.isCell() && subscript.isString())) {
     2421        if (JSValue result = baseValue.asCell()->fastGetOwnProperty(callFrame, asString(subscript)->value(callFrame)))
     2422            return result;
     2423    }
    24222424
    24232425    if (subscript.isUInt32()) {
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r145838 r145945  
    10611061inline JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript)
    10621062{
    1063     if (LIKELY(baseValue.isCell() && subscript.isString()))
    1064         return baseValue.asCell()->getByString(exec, asString(subscript)->value(exec));
     1063    if (LIKELY(baseValue.isCell() && subscript.isString())) {
     1064        if (JSValue result = baseValue.asCell()->fastGetOwnProperty(exec, asString(subscript)->value(exec)))
     1065            return result;
     1066    }
    10651067   
    10661068    if (subscript.isUInt32()) {
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r145838 r145945  
    100100    macro(writable) \
    101101    macro(displayName) \
    102     macro(join) \
    103     macro(__defineGetter__) \
    104     macro(__defineSetter__) \
    105     macro(__lookupGetter__) \
    106     macro(__lookupSetter__)
     102    macro(join)
    107103
    108104#define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
  • trunk/Source/JavaScriptCore/runtime/JSCell.cpp

    r145838 r145945  
    228228}
    229229
    230 JSValue JSCell::getByStringSlow(ExecState* exec, const String& name)
    231 {
    232     Identifier ident(&exec->globalData(), name);
    233     return JSValue(this).get(exec, ident);
    234 }
    235 
    236230} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r145838 r145945  
    123123    // property names, we want a similar interface with appropriate optimizations.)
    124124    bool fastGetOwnPropertySlot(ExecState*, PropertyName, PropertySlot&);
    125    
    126     JSValue getByString(ExecState*, const String&);
     125    JSValue fastGetOwnProperty(ExecState*, const String&);
    127126
    128127    static ptrdiff_t structureOffset()
     
    163162private:
    164163    friend class LLIntOffsetsExtractor;
    165    
    166     template<typename KeyType>
    167     JSValue getByStringAndKey(ExecState*, const String&, const KeyType&);
    168     JSValue getByStringSlow(ExecState*, const String&);
    169164       
    170165    WriteBarrier<Structure> m_structure;
  • trunk/Source/JavaScriptCore/runtime/JSCellInlines.h

    r145838 r145945  
    170170}
    171171
    172 template<typename KeyType>
    173 ALWAYS_INLINE JSValue JSCell::getByStringAndKey(ExecState* exec, const String& name, const KeyType& key)
    174 {
    175     JSCell* cell = this;
    176    
    177     while (true) {
    178         if (UNLIKELY(cell->structure()->typeInfo().overridesGetOwnPropertySlot()))
    179             return getByStringSlow(exec, name);
    180        
    181         unsigned attributes;
    182         PropertyOffset offset = cell->structure()->get(exec->globalData(), key, attributes);
    183         if (offset != invalidOffset) {
    184             if (attributes & Accessor)
    185                 return cell->getByStringSlow(exec, name);
    186             return asObject(cell)->getDirect(offset);
    187         }
    188        
    189         JSValue prototype = cell->structure()->storedPrototype();
    190         if (!prototype.isObject())
    191             break;
    192         cell = asObject(prototype);
    193     }
    194    
    195     // Make sure we aren't going after indexed storage, and if we are, then just use that.
    196     unsigned index = toUInt32FromStringImpl(name.impl());
    197     if (index == PropertyName::NotAnIndex)
    198         return jsUndefined();
    199    
    200     return JSValue(this).get(exec, index);
    201 }
    202 
    203172// Fast call to get a property where we may not yet have converted the string to an
    204173// identifier. The first time we perform a property access with a given string, try
    205174// performing the property map lookup without forming an identifier. We detect this
    206175// case by checking whether the hash has yet been set for this string.
    207 ALWAYS_INLINE JSValue JSCell::getByString(ExecState* exec, const String& name)
     176ALWAYS_INLINE JSValue JSCell::fastGetOwnProperty(ExecState* exec, const String& name)
    208177{
    209     if (name.impl()->hasHash())
    210         return getByStringAndKey(exec, name, Identifier(exec, name));
    211     return getByStringAndKey(exec, name, name);
     178    if (!structure()->typeInfo().overridesGetOwnPropertySlot() && !structure()->hasGetterSetterProperties()) {
     179        PropertyOffset offset = name.impl()->hasHash()
     180            ? structure()->get(exec->globalData(), Identifier(exec, name))
     181            : structure()->get(exec->globalData(), name);
     182        if (offset != invalidOffset)
     183            return asObject(this)->locationForOffset(offset)->get();
     184    }
     185    return JSValue();
    212186}
    213187
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r145838 r145945  
    9494extern const HashTable numberPrototypeTable;
    9595JS_EXPORTDATA extern const HashTable objectConstructorTable;
     96extern const HashTable objectPrototypeTable;
    9697extern const HashTable privateNamePrototypeTable;
    9798extern const HashTable regExpTable;
     
    155156    , numberPrototypeTable(fastNew<HashTable>(JSC::numberPrototypeTable))
    156157    , objectConstructorTable(fastNew<HashTable>(JSC::objectConstructorTable))
     158    , objectPrototypeTable(fastNew<HashTable>(JSC::objectPrototypeTable))
    157159    , privateNamePrototypeTable(fastNew<HashTable>(JSC::privateNamePrototypeTable))
    158160    , regExpTable(fastNew<HashTable>(JSC::regExpTable))
     
    285287    numberPrototypeTable->deleteTable();
    286288    objectConstructorTable->deleteTable();
     289    objectPrototypeTable->deleteTable();
    287290    privateNamePrototypeTable->deleteTable();
    288291    regExpTable->deleteTable();
     
    304307    fastDelete(const_cast<HashTable*>(numberPrototypeTable));
    305308    fastDelete(const_cast<HashTable*>(objectConstructorTable));
     309    fastDelete(const_cast<HashTable*>(objectPrototypeTable));
    306310    fastDelete(const_cast<HashTable*>(privateNamePrototypeTable));
    307311    fastDelete(const_cast<HashTable*>(regExpTable));
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.h

    r145933 r145945  
    227227        const HashTable* numberPrototypeTable;
    228228        const HashTable* objectConstructorTable;
     229        const HashTable* objectPrototypeTable;
    229230        const HashTable* privateNamePrototypeTable;
    230231        const HashTable* regExpTable;
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r145838 r145945  
    22032203}
    22042204
    2205 void JSObject::putDirectNativeFunction(ExecState* exec, JSGlobalObject* globalObject, const PropertyName& propertyName, unsigned functionLength, NativeFunction nativeFunction, Intrinsic intrinsic, unsigned attributes)
    2206 {
    2207     StringImpl* name = propertyName.publicName();
    2208     ASSERT(name);
    2209    
    2210     JSFunction* function =
    2211         JSFunction::create(exec, globalObject, functionLength, name, nativeFunction, intrinsic);
    2212     putDirect(exec->globalData(), propertyName, function, attributes);
    2213 }
    2214 
    22152205ALWAYS_INLINE unsigned JSObject::getNewVectorLength(unsigned currentVectorLength, unsigned currentLength, unsigned desiredLength)
    22162206{
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r145838 r145945  
    566566    void putDirectUndefined(PropertyOffset offset) { locationForOffset(offset)->setUndefined(); }
    567567
    568     void putDirectNativeFunction(ExecState*, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes);
    569 
    570568    JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
    571569
     
    703701        ASSERT(classInfo());
    704702    }
    705    
     703
    706704    static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
    707705    {
     
    912910    using JSCell::isAPIValueWrapper;
    913911    using JSCell::isGetterSetter;
    914 
    915912    void getObject();
    916913    void getString(ExecState* exec);
     
    14531450COMPILE_ASSERT(!(sizeof(JSObject) % sizeof(WriteBarrierBase<Unknown>)), JSObject_inline_storage_has_correct_alignment);
    14541451
    1455 // Helper for defining native functions, if you're not using a static hash table.
    1456 // Use this macro from within finishCreation() methods in prototypes. This assumes
    1457 // you've defined variables called exec, globalObject, and globalData, and they
    1458 // have the expected meanings. This also assumes that the function you're defining
    1459 // doesn't have an intrinsic.
    1460 #define JSC_NATIVE_FUNCTION(jsName, cppName, attributes, length) \
    1461     putDirectNativeFunction(exec, globalObject, globalData.propertyNames->jsName, (length), cppName, NoIntrinsic, (attributes))
    1462 
    14631452} // namespace JSC
    14641453
  • trunk/Source/JavaScriptCore/runtime/Lookup.cpp

    r145838 r145945  
    7878            return false;
    7979   
    80         thisObj->putDirectNativeFunction(
    81             exec, thisObj->globalObject(), propertyName, entry->functionLength(),
    82             entry->function(), entry->intrinsic(), entry->attributes());
     80        StringImpl* name = propertyName.publicName();
     81        ASSERT(name);
     82       
     83        JSFunction* function = JSFunction::create(exec, thisObj->globalObject(), entry->functionLength(), name, entry->function(), entry->intrinsic());
     84        thisObj->putDirect(exec->globalData(), propertyName, function, entry->attributes());
    8385        offset = thisObj->getDirectOffset(exec->globalData(), propertyName);
    8486        ASSERT(isValidOffset(offset));
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp

    r145838 r145945  
    4141static EncodedJSValue JSC_HOST_CALL objectProtoFuncToLocaleString(ExecState*);
    4242
     43}
     44
     45#include "ObjectPrototype.lut.h"
     46
     47namespace JSC {
     48
    4349ASSERT_HAS_TRIVIAL_DESTRUCTOR(ObjectPrototype);
    4450
    45 const ClassInfo ObjectPrototype::s_info = { "Object", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(ObjectPrototype) };
     51const ClassInfo ObjectPrototype::s_info = { "Object", &JSNonFinalObject::s_info, 0, ExecState::objectPrototypeTable, CREATE_METHOD_TABLE(ObjectPrototype) };
     52
     53/* Source for ObjectPrototype.lut.h
     54@begin objectPrototypeTable
     55  toString              objectProtoFuncToString                 DontEnum|Function 0
     56  toLocaleString        objectProtoFuncToLocaleString           DontEnum|Function 0
     57  valueOf               objectProtoFuncValueOf                  DontEnum|Function 0
     58  hasOwnProperty        objectProtoFuncHasOwnProperty           DontEnum|Function 1
     59  propertyIsEnumerable  objectProtoFuncPropertyIsEnumerable     DontEnum|Function 1
     60  isPrototypeOf         objectProtoFuncIsPrototypeOf            DontEnum|Function 1
     61  __defineGetter__      objectProtoFuncDefineGetter             DontEnum|Function 2
     62  __defineSetter__      objectProtoFuncDefineSetter             DontEnum|Function 2
     63  __lookupGetter__      objectProtoFuncLookupGetter             DontEnum|Function 1
     64  __lookupSetter__      objectProtoFuncLookupSetter             DontEnum|Function 1
     65@end
     66*/
    4667
    4768ObjectPrototype::ObjectPrototype(ExecState* exec, Structure* stucture)
     
    5071}
    5172
    52 void ObjectPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
    53 {
    54     JSGlobalData& globalData = exec->globalData();
    55    
     73void ObjectPrototype::finishCreation(JSGlobalData& globalData, JSGlobalObject*)
     74{
    5675    Base::finishCreation(globalData);
    5776    ASSERT(inherits(&s_info));
    5877    globalData.prototypeMap.addPrototype(this);
    59    
    60     JSC_NATIVE_FUNCTION(toString, objectProtoFuncToString, DontEnum, 0);
    61     JSC_NATIVE_FUNCTION(toLocaleString, objectProtoFuncToLocaleString, DontEnum, 0);
    62     JSC_NATIVE_FUNCTION(valueOf, objectProtoFuncValueOf, DontEnum, 0);
    63     JSC_NATIVE_FUNCTION(hasOwnProperty, objectProtoFuncHasOwnProperty, DontEnum, 1);
    64     JSC_NATIVE_FUNCTION(propertyIsEnumerable, objectProtoFuncPropertyIsEnumerable, DontEnum, 1);
    65     JSC_NATIVE_FUNCTION(isPrototypeOf, objectProtoFuncIsPrototypeOf, DontEnum, 1);
    66     JSC_NATIVE_FUNCTION(__defineGetter__, objectProtoFuncDefineGetter, DontEnum, 2);
    67     JSC_NATIVE_FUNCTION(__defineSetter__, objectProtoFuncDefineSetter, DontEnum, 2);
    68     JSC_NATIVE_FUNCTION(__lookupGetter__, objectProtoFuncLookupGetter, DontEnum, 1);
    69     JSC_NATIVE_FUNCTION(__lookupSetter__, objectProtoFuncLookupSetter, DontEnum, 1);
    70 }
    71 
    72 ObjectPrototype* ObjectPrototype::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    73 {
    74     ObjectPrototype* prototype = new (NotNull, allocateCell<ObjectPrototype>(*exec->heap())) ObjectPrototype(exec, structure);
    75     prototype->finishCreation(exec, globalObject);
    76     return prototype;
     78}
     79
     80bool ObjectPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     81{
     82    return getStaticFunctionSlot<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), jsCast<ObjectPrototype*>(cell), propertyName, slot);
     83}
     84
     85bool ObjectPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
     86{
     87    return getStaticFunctionDescriptor<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), jsCast<ObjectPrototype*>(object), propertyName, descriptor);
    7788}
    7889
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h

    r145838 r145945  
    3030        typedef JSNonFinalObject Base;
    3131
    32         static ObjectPrototype* create(ExecState*, JSGlobalObject*, Structure*);
     32        static ObjectPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     33        {
     34            ObjectPrototype* prototype = new (NotNull, allocateCell<ObjectPrototype>(*exec->heap())) ObjectPrototype(exec, structure);
     35            prototype->finishCreation(exec->globalData(), globalObject);
     36            return prototype;
     37        }
    3338
    3439        static const ClassInfo s_info;
     
    4045
    4146    protected:
    42         void finishCreation(ExecState*, JSGlobalObject*);
     47        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSNonFinalObject::StructureFlags;
     48
     49        void finishCreation(JSGlobalData&, JSGlobalObject*);
    4350
    4451    private:
    4552        ObjectPrototype(ExecState*, Structure*);
     53        static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     54        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    4655    };
    4756
  • trunk/Source/JavaScriptCore/runtime/PropertyMapHashTable.h

    r145838 r145945  
    312312{
    313313    ASSERT(key);
    314     ASSERT(!key->isIdentifier());
     314    ASSERT(!key->isIdentifier() && !key->hasHash());
    315315    unsigned hash = key->hash();
    316316    unsigned step = 0;
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r145838 r145945  
    234234
    235235    PropertyOffset get(JSGlobalData&, PropertyName);
    236     PropertyOffset get(JSGlobalData&, PropertyName, unsigned& attributes);
    237     PropertyOffset get(JSGlobalData&, const WTF::String& name, unsigned& attributes);
     236    PropertyOffset get(JSGlobalData&, const WTF::String& name);
    238237    JS_EXPORT_PRIVATE PropertyOffset get(JSGlobalData&, PropertyName, unsigned& attributes, JSCell*& specificValue);
    239238
  • trunk/Source/JavaScriptCore/runtime/StructureInlines.h

    r145838 r145945  
    7070}
    7171
    72 inline PropertyOffset Structure::get(JSGlobalData& globalData, PropertyName propertyName, unsigned& attributes)
     72inline PropertyOffset Structure::get(JSGlobalData& globalData, const WTF::String& name)
    7373{
    7474    ASSERT(structure()->classInfo() == &s_info);
     
    7777        return invalidOffset;
    7878
    79     PropertyMapEntry* entry = propertyTable()->find(propertyName.uid()).first;
    80     if (!entry)
    81         return invalidOffset;
    82    
    83     attributes = entry->attributes;
    84     return entry->offset;
    85 }
    86 
    87 inline PropertyOffset Structure::get(JSGlobalData& globalData, const WTF::String& name, unsigned& attributes)
    88 {
    89     ASSERT(structure()->classInfo() == &s_info);
    90     materializePropertyMapIfNecessary(globalData);
    91     if (!propertyTable())
    92         return invalidOffset;
    93 
    9479    PropertyMapEntry* entry = propertyTable()->findWithString(name.impl()).first;
    95     if (!entry)
    96         return invalidOffset;
    97 
    98     attributes = entry->attributes;
    99     return entry->offset;
     80    return entry ? entry->offset : invalidOffset;
    10081}
    10182   
Note: See TracChangeset for help on using the changeset viewer.