Changeset 145945 in webkit
- Timestamp:
- Mar 15, 2013 2:52:35 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 9 deleted
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r145940 r145945 1 2013-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 1 18 2013-03-15 Rouslan Solomakhin <rouslan@chromium.org> 2 19 -
trunk/Source/JavaScriptCore/CMakeLists.txt
r145838 r145945 330 330 runtime/NumberPrototype.cpp 331 331 runtime/ObjectConstructor.cpp 332 runtime/ObjectPrototype.cpp 332 333 runtime/RegExpConstructor.cpp 333 334 runtime/RegExpObject.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r145933 r145945 1 2013-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 1 55 2013-03-15 Michael Saboff <msaboff@apple.com> 2 56 -
trunk/Source/JavaScriptCore/DerivedSources.make
r145838 r145945 51 51 NumberPrototype.lut.h \ 52 52 ObjectConstructor.lut.h \ 53 ObjectPrototype.lut.h \ 53 54 RegExpConstructor.lut.h \ 54 55 RegExpPrototype.lut.h \ -
trunk/Source/JavaScriptCore/DerivedSources.pri
r145838 r145945 21 21 runtime/NumberPrototype.cpp \ 22 22 runtime/ObjectConstructor.cpp \ 23 runtime/ObjectPrototype.cpp \ 23 24 runtime/RegExpConstructor.cpp \ 24 25 runtime/RegExpObject.cpp \ -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r145848 r145945 25 25 DerivedSources/JavaScriptCore/NumberPrototype.lut.h \ 26 26 DerivedSources/JavaScriptCore/ObjectConstructor.lut.h \ 27 DerivedSources/JavaScriptCore/ObjectPrototype.lut.h \ 27 28 DerivedSources/JavaScriptCore/RegExpConstructor.lut.h \ 28 29 DerivedSources/JavaScriptCore/RegExpObject.lut.h \ -
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r145838 r145945 425 425 JSCell* base = baseValue.asCell(); 426 426 427 if (property.isUInt32()) 427 if (property.isUInt32()) { 428 428 return getByVal(exec, base, property.asUInt32()); 429 if (property.isDouble()) {429 } else if (property.isDouble()) { 430 430 double propertyAsDouble = property.asDouble(); 431 431 uint32_t propertyAsUInt32 = static_cast<uint32_t>(propertyAsDouble); 432 432 if (propertyAsUInt32 == propertyAsDouble) 433 433 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 438 440 if (isName(property)) 439 441 return JSValue::encode(baseValue.get(exec, jsCast<NameInstance*>(property.asCell())->privateName())); … … 452 454 if (property.isUInt32()) 453 455 return getByVal(exec, base, property.asUInt32()); 454 elseif (property.isDouble()) {456 if (property.isDouble()) { 455 457 double propertyAsDouble = property.asDouble(); 456 458 uint32_t propertyAsUInt32 = static_cast<uint32_t>(propertyAsDouble); 457 459 if (propertyAsUInt32 == propertyAsDouble) 458 460 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 } 461 465 462 466 if (isName(property)) -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r145838 r145945 91 91 static const HashTable* numberPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().numberPrototypeTable; } 92 92 static const HashTable* objectConstructorTable(CallFrame* callFrame) { return callFrame->globalData().objectConstructorTable; } 93 static const HashTable* objectPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().objectPrototypeTable; } 93 94 static const HashTable* privateNamePrototypeTable(CallFrame* callFrame) { return callFrame->globalData().privateNamePrototypeTable; } 94 95 static const HashTable* regExpTable(CallFrame* callFrame) { return callFrame->globalData().regExpTable; } -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r145838 r145945 2418 2418 CallFrame* callFrame, JSValue baseValue, JSValue subscript, ReturnAddressPtr returnAddress) 2419 2419 { 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 } 2422 2424 2423 2425 if (subscript.isUInt32()) { -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r145838 r145945 1061 1061 inline JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript) 1062 1062 { 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 } 1065 1067 1066 1068 if (subscript.isUInt32()) { -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h
r145838 r145945 100 100 macro(writable) \ 101 101 macro(displayName) \ 102 macro(join) \ 103 macro(__defineGetter__) \ 104 macro(__defineSetter__) \ 105 macro(__lookupGetter__) \ 106 macro(__lookupSetter__) 102 macro(join) 107 103 108 104 #define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \ -
trunk/Source/JavaScriptCore/runtime/JSCell.cpp
r145838 r145945 228 228 } 229 229 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 236 230 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r145838 r145945 123 123 // property names, we want a similar interface with appropriate optimizations.) 124 124 bool fastGetOwnPropertySlot(ExecState*, PropertyName, PropertySlot&); 125 126 JSValue getByString(ExecState*, const String&); 125 JSValue fastGetOwnProperty(ExecState*, const String&); 127 126 128 127 static ptrdiff_t structureOffset() … … 163 162 private: 164 163 friend class LLIntOffsetsExtractor; 165 166 template<typename KeyType>167 JSValue getByStringAndKey(ExecState*, const String&, const KeyType&);168 JSValue getByStringSlow(ExecState*, const String&);169 164 170 165 WriteBarrier<Structure> m_structure; -
trunk/Source/JavaScriptCore/runtime/JSCellInlines.h
r145838 r145945 170 170 } 171 171 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 203 172 // Fast call to get a property where we may not yet have converted the string to an 204 173 // identifier. The first time we perform a property access with a given string, try 205 174 // performing the property map lookup without forming an identifier. We detect this 206 175 // case by checking whether the hash has yet been set for this string. 207 ALWAYS_INLINE JSValue JSCell:: getByString(ExecState* exec, const String& name)176 ALWAYS_INLINE JSValue JSCell::fastGetOwnProperty(ExecState* exec, const String& name) 208 177 { 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(); 212 186 } 213 187 -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r145838 r145945 94 94 extern const HashTable numberPrototypeTable; 95 95 JS_EXPORTDATA extern const HashTable objectConstructorTable; 96 extern const HashTable objectPrototypeTable; 96 97 extern const HashTable privateNamePrototypeTable; 97 98 extern const HashTable regExpTable; … … 155 156 , numberPrototypeTable(fastNew<HashTable>(JSC::numberPrototypeTable)) 156 157 , objectConstructorTable(fastNew<HashTable>(JSC::objectConstructorTable)) 158 , objectPrototypeTable(fastNew<HashTable>(JSC::objectPrototypeTable)) 157 159 , privateNamePrototypeTable(fastNew<HashTable>(JSC::privateNamePrototypeTable)) 158 160 , regExpTable(fastNew<HashTable>(JSC::regExpTable)) … … 285 287 numberPrototypeTable->deleteTable(); 286 288 objectConstructorTable->deleteTable(); 289 objectPrototypeTable->deleteTable(); 287 290 privateNamePrototypeTable->deleteTable(); 288 291 regExpTable->deleteTable(); … … 304 307 fastDelete(const_cast<HashTable*>(numberPrototypeTable)); 305 308 fastDelete(const_cast<HashTable*>(objectConstructorTable)); 309 fastDelete(const_cast<HashTable*>(objectPrototypeTable)); 306 310 fastDelete(const_cast<HashTable*>(privateNamePrototypeTable)); 307 311 fastDelete(const_cast<HashTable*>(regExpTable)); -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r145933 r145945 227 227 const HashTable* numberPrototypeTable; 228 228 const HashTable* objectConstructorTable; 229 const HashTable* objectPrototypeTable; 229 230 const HashTable* privateNamePrototypeTable; 230 231 const HashTable* regExpTable; -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r145838 r145945 2203 2203 } 2204 2204 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 2215 2205 ALWAYS_INLINE unsigned JSObject::getNewVectorLength(unsigned currentVectorLength, unsigned currentLength, unsigned desiredLength) 2216 2206 { -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r145838 r145945 566 566 void putDirectUndefined(PropertyOffset offset) { locationForOffset(offset)->setUndefined(); } 567 567 568 void putDirectNativeFunction(ExecState*, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes);569 570 568 JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow); 571 569 … … 703 701 ASSERT(classInfo()); 704 702 } 705 703 706 704 static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) 707 705 { … … 912 910 using JSCell::isAPIValueWrapper; 913 911 using JSCell::isGetterSetter; 914 915 912 void getObject(); 916 913 void getString(ExecState* exec); … … 1453 1450 COMPILE_ASSERT(!(sizeof(JSObject) % sizeof(WriteBarrierBase<Unknown>)), JSObject_inline_storage_has_correct_alignment); 1454 1451 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 assumes1457 // you've defined variables called exec, globalObject, and globalData, and they1458 // have the expected meanings. This also assumes that the function you're defining1459 // 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 1463 1452 } // namespace JSC 1464 1453 -
trunk/Source/JavaScriptCore/runtime/Lookup.cpp
r145838 r145945 78 78 return false; 79 79 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()); 83 85 offset = thisObj->getDirectOffset(exec->globalData(), propertyName); 84 86 ASSERT(isValidOffset(offset)); -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
r145838 r145945 41 41 static EncodedJSValue JSC_HOST_CALL objectProtoFuncToLocaleString(ExecState*); 42 42 43 } 44 45 #include "ObjectPrototype.lut.h" 46 47 namespace JSC { 48 43 49 ASSERT_HAS_TRIVIAL_DESTRUCTOR(ObjectPrototype); 44 50 45 const ClassInfo ObjectPrototype::s_info = { "Object", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(ObjectPrototype) }; 51 const 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 */ 46 67 47 68 ObjectPrototype::ObjectPrototype(ExecState* exec, Structure* stucture) … … 50 71 } 51 72 52 void ObjectPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject) 53 { 54 JSGlobalData& globalData = exec->globalData(); 55 73 void ObjectPrototype::finishCreation(JSGlobalData& globalData, JSGlobalObject*) 74 { 56 75 Base::finishCreation(globalData); 57 76 ASSERT(inherits(&s_info)); 58 77 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 80 bool 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 85 bool ObjectPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor) 86 { 87 return getStaticFunctionDescriptor<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), jsCast<ObjectPrototype*>(object), propertyName, descriptor); 77 88 } 78 89 -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h
r145838 r145945 30 30 typedef JSNonFinalObject Base; 31 31 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 } 33 38 34 39 static const ClassInfo s_info; … … 40 45 41 46 protected: 42 void finishCreation(ExecState*, JSGlobalObject*); 47 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSNonFinalObject::StructureFlags; 48 49 void finishCreation(JSGlobalData&, JSGlobalObject*); 43 50 44 51 private: 45 52 ObjectPrototype(ExecState*, Structure*); 53 static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&); 54 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 46 55 }; 47 56 -
trunk/Source/JavaScriptCore/runtime/PropertyMapHashTable.h
r145838 r145945 312 312 { 313 313 ASSERT(key); 314 ASSERT(!key->isIdentifier() );314 ASSERT(!key->isIdentifier() && !key->hasHash()); 315 315 unsigned hash = key->hash(); 316 316 unsigned step = 0; -
trunk/Source/JavaScriptCore/runtime/Structure.h
r145838 r145945 234 234 235 235 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); 238 237 JS_EXPORT_PRIVATE PropertyOffset get(JSGlobalData&, PropertyName, unsigned& attributes, JSCell*& specificValue); 239 238 -
trunk/Source/JavaScriptCore/runtime/StructureInlines.h
r145838 r145945 70 70 } 71 71 72 inline PropertyOffset Structure::get(JSGlobalData& globalData, PropertyName propertyName, unsigned& attributes)72 inline PropertyOffset Structure::get(JSGlobalData& globalData, const WTF::String& name) 73 73 { 74 74 ASSERT(structure()->classInfo() == &s_info); … … 77 77 return invalidOffset; 78 78 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 94 79 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; 100 81 } 101 82
Note: See TracChangeset
for help on using the changeset viewer.