Changeset 77269 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Feb 1, 2011, 12:17:21 PM (14 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r77260 r77269 1 2011-01-31 Oliver Hunt <[email protected]> 2 3 Reviewed by Geoffrey Garen. 4 5 Update JSObject storage for new marking API 6 https://bugs.webkit.org/show_bug.cgi?id=53467 7 8 JSObject no longer uses EncodedJSValue for its property storage. 9 This produces a stream of mechanical changes to PropertySlot and 10 anonymous storage APIs. 11 12 * JavaScriptCore.exp: 13 * runtime/ArrayPrototype.cpp: 14 (JSC::ArrayPrototype::ArrayPrototype): 15 * runtime/BooleanConstructor.cpp: 16 (JSC::constructBoolean): 17 (JSC::constructBooleanFromImmediateBoolean): 18 * runtime/BooleanObject.cpp: 19 (JSC::BooleanObject::BooleanObject): 20 * runtime/BooleanObject.h: 21 * runtime/BooleanPrototype.cpp: 22 (JSC::BooleanPrototype::BooleanPrototype): 23 * runtime/DateInstance.cpp: 24 (JSC::DateInstance::DateInstance): 25 * runtime/DatePrototype.cpp: 26 (JSC::DatePrototype::DatePrototype): 27 * runtime/JSActivation.cpp: 28 (JSC::JSActivation::getOwnPropertySlot): 29 * runtime/JSArray.cpp: 30 (JSC::JSArray::getOwnPropertySlot): 31 * runtime/JSFunction.cpp: 32 (JSC::JSFunction::getOwnPropertySlot): 33 * runtime/JSGlobalObject.h: 34 (JSC::JSGlobalObject::JSGlobalObject): 35 * runtime/JSObject.cpp: 36 (JSC::JSObject::fillGetterPropertySlot): 37 * runtime/JSObject.h: 38 (JSC::JSObject::getDirectLocation): 39 (JSC::JSObject::offsetForLocation): 40 (JSC::JSObject::putAnonymousValue): 41 (JSC::JSObject::clearAnonymousValue): 42 (JSC::JSObject::getAnonymousValue): 43 (JSC::JSObject::putThisToAnonymousValue): 44 (JSC::JSObject::locationForOffset): 45 (JSC::JSObject::inlineGetOwnPropertySlot): 46 * runtime/JSObjectWithGlobalObject.cpp: 47 (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject): 48 * runtime/JSWrapperObject.h: 49 (JSC::JSWrapperObject::JSWrapperObject): 50 (JSC::JSWrapperObject::setInternalValue): 51 * runtime/Lookup.cpp: 52 (JSC::setUpStaticFunctionSlot): 53 * runtime/NumberConstructor.cpp: 54 (JSC::constructWithNumberConstructor): 55 * runtime/NumberObject.cpp: 56 (JSC::NumberObject::NumberObject): 57 (JSC::constructNumber): 58 * runtime/NumberObject.h: 59 * runtime/NumberPrototype.cpp: 60 (JSC::NumberPrototype::NumberPrototype): 61 * runtime/PropertySlot.h: 62 (JSC::PropertySlot::getValue): 63 (JSC::PropertySlot::setValue): 64 (JSC::PropertySlot::setRegisterSlot): 65 * runtime/StringObject.cpp: 66 (JSC::StringObject::StringObject): 67 * runtime/StringPrototype.cpp: 68 (JSC::StringPrototype::StringPrototype): 69 * runtime/WriteBarrier.h: 70 (JSC::WriteBarrierBase::setWithoutWriteBarrier): 71 1 72 2011-02-01 Daniel Bates <[email protected]> 2 73 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r77151 r77269 296 296 __ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE 297 297 __ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 298 __ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_ 7JSValueE298 __ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE 299 299 __ZN3JSC8JSObject23allocatePropertyStorageEmm 300 300 __ZN3JSC8JSObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r77151 r77269 157 157 ?fastStrDup@WTF@@YAPADPBD@Z 158 158 ?fastZeroedMalloc@WTF@@YAPAXI@Z 159 ?fillGetterPropertySlot@JSObject@JSC@@QAEXAAVPropertySlot@2@PAV JSValue@2@@Z159 ?fillGetterPropertySlot@JSObject@JSC@@QAEXAAVPropertySlot@2@PAV?$WriteBarrierBase@W4Unknown@JSC@@@2@@Z 160 160 ?focus@Profile@JSC@@QAEXPBVProfileNode@2@@Z 161 161 ?free@WeakGCHandlePool@JSC@@QAEXPAVWeakGCHandle@2@@Z -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r77151 r77269 118 118 : JSArray(structure) 119 119 { 120 putAnonymousValue( 0, globalObject);120 putAnonymousValue(globalObject->globalData(), 0, globalObject); 121 121 } 122 122 -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
r77151 r77269 41 41 JSObject* constructBoolean(ExecState* exec, const ArgList& args) 42 42 { 43 BooleanObject* obj = new (exec) BooleanObject(exec-> lexicalGlobalObject()->booleanObjectStructure());43 BooleanObject* obj = new (exec) BooleanObject(exec->globalData(), exec->lexicalGlobalObject()->booleanObjectStructure()); 44 44 obj->setInternalValue(exec->globalData(), jsBoolean(args.at(0).toBoolean(exec))); 45 45 return obj; … … 72 72 JSObject* constructBooleanFromImmediateBoolean(ExecState* exec, JSValue immediateBooleanValue) 73 73 { 74 BooleanObject* obj = new (exec) BooleanObject(exec-> lexicalGlobalObject()->booleanObjectStructure());74 BooleanObject* obj = new (exec) BooleanObject(exec->globalData(), exec->lexicalGlobalObject()->booleanObjectStructure()); 75 75 obj->setInternalValue(exec->globalData(), immediateBooleanValue); 76 76 return obj; -
trunk/Source/JavaScriptCore/runtime/BooleanObject.cpp
r48836 r77269 28 28 const ClassInfo BooleanObject::info = { "Boolean", 0, 0, 0 }; 29 29 30 BooleanObject::BooleanObject( NonNullPassRefPtr<Structure> structure)31 : JSWrapperObject( structure)30 BooleanObject::BooleanObject(JSGlobalData& globalData, NonNullPassRefPtr<Structure> structure) 31 : JSWrapperObject(globalData, structure) 32 32 { 33 33 } -
trunk/Source/JavaScriptCore/runtime/BooleanObject.h
r54022 r77269 28 28 class BooleanObject : public JSWrapperObject { 29 29 public: 30 explicit BooleanObject( NonNullPassRefPtr<Structure>);30 explicit BooleanObject(JSGlobalData& globalData, NonNullPassRefPtr<Structure>); 31 31 32 32 virtual const ClassInfo* classInfo() const { return &info; } -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r77151 r77269 40 40 41 41 BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure) 42 : BooleanObject( structure)42 : BooleanObject(exec->globalData(), structure) 43 43 { 44 44 setInternalValue(exec->globalData(), jsBoolean(false)); -
trunk/Source/JavaScriptCore/runtime/DateInstance.cpp
r77151 r77269 36 36 37 37 DateInstance::DateInstance(ExecState* exec, NonNullPassRefPtr<Structure> structure) 38 : JSWrapperObject( structure)38 : JSWrapperObject(exec->globalData(), structure) 39 39 { 40 40 setInternalValue(exec->globalData(), jsNaN()); … … 42 42 43 43 DateInstance::DateInstance(ExecState* exec, NonNullPassRefPtr<Structure> structure, double time) 44 : JSWrapperObject( structure)44 : JSWrapperObject(exec->globalData(), structure) 45 45 { 46 46 setInternalValue(exec->globalData(), jsNumber(timeClip(time))); … … 48 48 49 49 DateInstance::DateInstance(ExecState* exec, double time) 50 : JSWrapperObject(exec-> lexicalGlobalObject()->dateStructure())50 : JSWrapperObject(exec->globalData(), exec->lexicalGlobalObject()->dateStructure()) 51 51 { 52 52 setInternalValue(exec->globalData(), jsNumber(timeClip(time))); -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r77151 r77269 434 434 { 435 435 // The constructor will be added later, after DateConstructor has been built. 436 putAnonymousValue( 0, globalObject);436 putAnonymousValue(exec->globalData(), 0, globalObject); 437 437 } 438 438 -
trunk/Source/JavaScriptCore/runtime/JSActivation.cpp
r77151 r77269 133 133 return true; 134 134 135 if ( JSValue* location = getDirectLocation(propertyName)) {136 slot.setValue Slot(location);135 if (WriteBarrierBase<Unknown>* location = getDirectLocation(propertyName)) { 136 slot.setValue(location->get()); 137 137 return true; 138 138 } -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r77151 r77269 258 258 259 259 if (i < m_vectorLength) { 260 WriteBarrier<Unknown>& valueSlot = storage->m_vector[i];261 if (value Slot) {262 slot.setValue Slot(valueSlot.slot());260 JSValue value = storage->m_vector[i].get(); 261 if (value) { 262 slot.setValue(value); 263 263 return true; 264 264 } … … 267 267 SparseArrayValueMap::iterator it = map->find(i); 268 268 if (it != map->end()) { 269 slot.setValue Slot(it->second.slot());269 slot.setValue(it->second.get()); 270 270 return true; 271 271 } -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r77151 r77269 204 204 205 205 if (propertyName == exec->propertyNames().prototype) { 206 JSValue* location = getDirectLocation(propertyName);206 WriteBarrierBase<Unknown>* location = getDirectLocation(propertyName); 207 207 208 208 if (!location) { … … 213 213 } 214 214 215 slot.setValue Slot(this, location, offsetForLocation(location));215 slot.setValue(this, location->get(), offsetForLocation(location)); 216 216 } 217 217 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r77151 r77269 148 148 { 149 149 COMPILE_ASSERT(JSGlobalObject::AnonymousSlotCount == 1, JSGlobalObject_has_only_a_single_slot); 150 put AnonymousValue(0, this);150 putThisToAnonymousValue(0); 151 151 init(this); 152 152 } … … 156 156 { 157 157 COMPILE_ASSERT(JSGlobalObject::AnonymousSlotCount == 1, JSGlobalObject_has_only_a_single_slot); 158 put AnonymousValue(0, this);158 putThisToAnonymousValue(0); 159 159 init(this); 160 160 } … … 165 165 { 166 166 COMPILE_ASSERT(JSGlobalObject::AnonymousSlotCount == 1, JSGlobalObject_has_only_a_single_slot); 167 put AnonymousValue(0, this);167 putThisToAnonymousValue(0); 168 168 init(thisValue); 169 169 } -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r77151 r77269 543 543 } 544 544 545 NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValue* location)546 { 547 if (JSObject* getterFunction = asGetterSetter( *location)->getter()) {545 NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, WriteBarrierBase<Unknown>* location) 546 { 547 if (JSObject* getterFunction = asGetterSetter(location->get())->getter()) { 548 548 if (!structure()->isDictionary()) 549 549 slot.setCacheableGetterSlot(this, getterFunction, offsetForLocation(location)); -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r77151 r77269 156 156 } 157 157 158 JSValue* getDirectLocation(const Identifier& propertyName)158 WriteBarrierBase<Unknown>* getDirectLocation(const Identifier& propertyName) 159 159 { 160 160 size_t offset = m_structure->get(propertyName); … … 162 162 } 163 163 164 JSValue* getDirectLocation(const Identifier& propertyName, unsigned& attributes)164 WriteBarrierBase<Unknown>* getDirectLocation(const Identifier& propertyName, unsigned& attributes) 165 165 { 166 166 JSCell* specificFunction; … … 169 169 } 170 170 171 size_t offsetForLocation( JSValue* location) const172 { 173 return location - reinterpret_cast<const JSValue*>(propertyStorage());171 size_t offsetForLocation(WriteBarrierBase<Unknown>* location) const 172 { 173 return location - propertyStorage(); 174 174 } 175 175 … … 199 199 void putUndefinedAtDirectOffset(size_t offset) { propertyStorage()[offset].setUndefined(); } 200 200 201 void fillGetterPropertySlot(PropertySlot&, JSValue* location);201 void fillGetterPropertySlot(PropertySlot&, WriteBarrierBase<Unknown>* location); 202 202 203 203 virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes = 0); … … 232 232 } 233 233 234 void putAnonymousValue( unsigned index, JSValue value)234 void putAnonymousValue(JSGlobalData& globalData, unsigned index, JSValue value) 235 235 { 236 236 ASSERT(index < m_structure->anonymousSlotCount()); 237 *locationForOffset(index) = value; 237 locationForOffset(index)->set(globalData, this, value); 238 } 239 void clearAnonymousValue(unsigned index) 240 { 241 ASSERT(index < m_structure->anonymousSlotCount()); 242 locationForOffset(index)->clear(); 238 243 } 239 244 JSValue getAnonymousValue(unsigned index) const 240 245 { 241 246 ASSERT(index < m_structure->anonymousSlotCount()); 242 return *locationForOffset(index);247 return locationForOffset(index)->get(); 243 248 } 244 249 245 250 protected: 246 251 static const unsigned StructureFlags = 0; 252 253 void putThisToAnonymousValue(unsigned index) 254 { 255 locationForOffset(index)->setWithoutWriteBarrier(this); 256 } 247 257 248 258 private: … … 255 265 void isObject(); 256 266 void isString(); 257 267 258 268 ConstPropertyStorage propertyStorage() const { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); } 259 269 PropertyStorage propertyStorage() { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); } 260 270 261 const JSValue* locationForOffset(size_t offset) const262 { 263 return reinterpret_cast<const JSValue*>(&propertyStorage()[offset]);264 } 265 266 JSValue* locationForOffset(size_t offset)267 { 268 return reinterpret_cast<JSValue*>(&propertyStorage()[offset]);271 const WriteBarrierBase<Unknown>* locationForOffset(size_t offset) const 272 { 273 return &propertyStorage()[offset]; 274 } 275 276 WriteBarrierBase<Unknown>* locationForOffset(size_t offset) 277 { 278 return &propertyStorage()[offset]; 269 279 } 270 280 … … 374 384 ALWAYS_INLINE bool JSObject::inlineGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 375 385 { 376 if ( JSValue* location = getDirectLocation(propertyName)) {377 if (m_structure->hasGetterSetterProperties() && location [0].isGetterSetter())386 if (WriteBarrierBase<Unknown>* location = getDirectLocation(propertyName)) { 387 if (m_structure->hasGetterSetterProperties() && location->isGetterSetter()) 378 388 fillGetterPropertySlot(slot, location); 379 389 else 380 slot.setValue Slot(this, location, offsetForLocation(location));390 slot.setValue(this, location->get(), offsetForLocation(location)); 381 391 return true; 382 392 } -
trunk/Source/JavaScriptCore/runtime/JSObjectWithGlobalObject.cpp
r60057 r77269 36 36 COMPILE_ASSERT(AnonymousSlotCount == 1, AnonymousSlotCount_must_be_one); 37 37 ASSERT(!globalObject || globalObject->isGlobalObject()); 38 putAnonymousValue(GlobalObjectSlot, globalObject); 38 if (!globalObject) 39 clearAnonymousValue(GlobalObjectSlot); 40 else 41 putAnonymousValue(globalObject->globalData(), GlobalObjectSlot, globalObject); 39 42 } 40 43 -
trunk/Source/JavaScriptCore/runtime/JSWrapperObject.h
r77151 r77269 31 31 class JSWrapperObject : public JSObject { 32 32 protected: 33 explicit JSWrapperObject( NonNullPassRefPtr<Structure>);33 explicit JSWrapperObject(JSGlobalData&, NonNullPassRefPtr<Structure>); 34 34 35 35 public: … … 51 51 }; 52 52 53 inline JSWrapperObject::JSWrapperObject( NonNullPassRefPtr<Structure> structure)53 inline JSWrapperObject::JSWrapperObject(JSGlobalData& globalData, NonNullPassRefPtr<Structure> structure) 54 54 : JSObject(structure) 55 55 { 56 putAnonymousValue( 0, jsNull());56 putAnonymousValue(globalData, 0, jsNull()); 57 57 } 58 58 … … 62 62 ASSERT(!value.isObject()); 63 63 m_internalValue.set(globalData, this, value); 64 putAnonymousValue( 0, value);64 putAnonymousValue(globalData, 0, value); 65 65 } 66 66 -
trunk/Source/JavaScriptCore/runtime/Lookup.cpp
r77151 r77269 75 75 ASSERT(thisObj->getAnonymousValue(0).isCell() && asObject(thisObj->getAnonymousValue(0).asCell())->isGlobalObject()); 76 76 ASSERT(entry->attributes() & Function); 77 JSValue* location = thisObj->getDirectLocation(propertyName);77 WriteBarrierBase<Unknown>* location = thisObj->getDirectLocation(propertyName); 78 78 79 79 if (!location) { … … 91 91 } 92 92 93 slot.setValue Slot(thisObj, location, thisObj->offsetForLocation(location));93 slot.setValue(thisObj, location->get(), thisObj->offsetForLocation(location)); 94 94 } 95 95 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r77151 r77269 103 103 static EncodedJSValue JSC_HOST_CALL constructWithNumberConstructor(ExecState* exec) 104 104 { 105 NumberObject* object = new (exec) NumberObject(exec-> lexicalGlobalObject()->numberObjectStructure());105 NumberObject* object = new (exec) NumberObject(exec->globalData(), exec->lexicalGlobalObject()->numberObjectStructure()); 106 106 double n = exec->argumentCount() ? exec->argument(0).toNumber(exec) : 0; 107 107 object->setInternalValue(exec->globalData(), jsNumber(n)); -
trunk/Source/JavaScriptCore/runtime/NumberObject.cpp
r77151 r77269 32 32 const ClassInfo NumberObject::info = { "Number", 0, 0, 0 }; 33 33 34 NumberObject::NumberObject( NonNullPassRefPtr<Structure> structure)35 : JSWrapperObject( structure)34 NumberObject::NumberObject(JSGlobalData& globalData, NonNullPassRefPtr<Structure> structure) 35 : JSWrapperObject(globalData, structure) 36 36 { 37 37 } … … 44 44 NumberObject* constructNumber(ExecState* exec, JSValue number) 45 45 { 46 NumberObject* object = new (exec) NumberObject(exec-> lexicalGlobalObject()->numberObjectStructure());46 NumberObject* object = new (exec) NumberObject(exec->globalData(), exec->lexicalGlobalObject()->numberObjectStructure()); 47 47 object->setInternalValue(exec->globalData(), number); 48 48 return object; -
trunk/Source/JavaScriptCore/runtime/NumberObject.h
r70111 r77269 28 28 class NumberObject : public JSWrapperObject { 29 29 public: 30 explicit NumberObject( NonNullPassRefPtr<Structure>);30 explicit NumberObject(JSGlobalData&, NonNullPassRefPtr<Structure>); 31 31 32 32 static const ClassInfo info; -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r77151 r77269 48 48 49 49 NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure) 50 : NumberObject( structure)50 : NumberObject(exec->globalData(), structure) 51 51 { 52 52 setInternalValue(exec->globalData(), jsNumber(0)); -
trunk/Source/JavaScriptCore/runtime/PropertySlot.h
r55564 r77269 33 33 class JSObject; 34 34 35 #define JSC_VALUE_SLOT_MARKER 0 36 #define JSC_REGISTER_SLOT_MARKER reinterpret_cast<GetValueFunc>(1) 35 #define JSC_VALUE_MARKER 0 37 36 #define INDEX_GETTER_MARKER reinterpret_cast<GetValueFunc>(2) 38 37 #define GETTER_FUNCTION_MARKER reinterpret_cast<GetValueFunc>(3) … … 68 67 JSValue getValue(ExecState* exec, const Identifier& propertyName) const 69 68 { 70 if (m_getValue == JSC_VALUE_SLOT_MARKER) 71 return *m_data.valueSlot; 72 if (m_getValue == JSC_REGISTER_SLOT_MARKER) 73 return (*m_data.registerSlot).jsValue(); 69 if (m_getValue == JSC_VALUE_MARKER) 70 return m_value; 74 71 if (m_getValue == INDEX_GETTER_MARKER) 75 72 return m_getIndexValue(exec, slotBase(), index()); … … 81 78 JSValue getValue(ExecState* exec, unsigned propertyName) const 82 79 { 83 if (m_getValue == JSC_VALUE_SLOT_MARKER) 84 return *m_data.valueSlot; 85 if (m_getValue == JSC_REGISTER_SLOT_MARKER) 86 return (*m_data.registerSlot).jsValue(); 80 if (m_getValue == JSC_VALUE_MARKER) 81 return m_value; 87 82 if (m_getValue == INDEX_GETTER_MARKER) 88 83 return m_getIndexValue(exec, m_slotBase, m_data.index); … … 101 96 } 102 97 103 void setValue Slot(JSValue* valueSlot)104 { 105 ASSERT(value Slot);106 clear Base();107 clearOffset();108 m_ getValue = JSC_VALUE_SLOT_MARKER;109 m_ data.valueSlot = valueSlot;98 void setValue(JSValue slotBase, JSValue value) 99 { 100 ASSERT(value); 101 clearOffset(); 102 m_getValue = JSC_VALUE_MARKER; 103 m_slotBase = slotBase; 104 m_value = value; 110 105 } 111 106 112 void setValueSlot(JSValue slotBase, JSValue* valueSlot) 113 { 114 ASSERT(valueSlot); 115 m_getValue = JSC_VALUE_SLOT_MARKER; 116 m_slotBase = slotBase; 117 m_data.valueSlot = valueSlot; 118 } 119 120 void setValueSlot(JSValue slotBase, JSValue* valueSlot, size_t offset) 121 { 122 ASSERT(valueSlot); 123 m_getValue = JSC_VALUE_SLOT_MARKER; 124 m_slotBase = slotBase; 125 m_data.valueSlot = valueSlot; 107 void setValue(JSValue slotBase, JSValue value, size_t offset) 108 { 109 ASSERT(value); 110 m_getValue = JSC_VALUE_MARKER; 111 m_slotBase = slotBase; 112 m_value = value; 126 113 m_offset = offset; 127 114 m_cachedPropertyType = Value; 128 115 } 129 116 130 117 void setValue(JSValue value) 131 118 { … … 133 120 clearBase(); 134 121 clearOffset(); 135 m_getValue = JSC_VALUE_ SLOT_MARKER;122 m_getValue = JSC_VALUE_MARKER; 136 123 m_value = value; 137 m_data.valueSlot = &m_value;138 124 } 139 125 … … 143 129 clearBase(); 144 130 clearOffset(); 145 m_getValue = JSC_ REGISTER_SLOT_MARKER;146 m_ data.registerSlot = registerSlot;131 m_getValue = JSC_VALUE_MARKER; 132 m_value = registerSlot->jsValue(); 147 133 } 148 134 … … 252 238 union { 253 239 JSObject* getterFunc; 254 JSValue* valueSlot;255 Register* registerSlot;256 240 unsigned index; 257 241 } m_data; -
trunk/Source/JavaScriptCore/runtime/StringObject.cpp
r77151 r77269 31 31 32 32 StringObject::StringObject(ExecState* exec, NonNullPassRefPtr<Structure> structure) 33 : JSWrapperObject( structure)33 : JSWrapperObject(exec->globalData(), structure) 34 34 { 35 35 setInternalValue(exec->globalData(), jsEmptyString(exec)); … … 37 37 38 38 StringObject::StringObject(JSGlobalData& globalData, NonNullPassRefPtr<Structure> structure, JSString* string) 39 : JSWrapperObject( structure)39 : JSWrapperObject(globalData, structure) 40 40 { 41 41 setInternalValue(globalData, string); … … 43 43 44 44 StringObject::StringObject(ExecState* exec, NonNullPassRefPtr<Structure> structure, const UString& string) 45 : JSWrapperObject( structure)45 : JSWrapperObject(exec->globalData(), structure) 46 46 { 47 47 setInternalValue(exec->globalData(), jsString(exec, string)); -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r77151 r77269 135 135 : StringObject(exec, structure) 136 136 { 137 putAnonymousValue( 0, globalObject);137 putAnonymousValue(exec->globalData(), 0, globalObject); 138 138 // The constructor will be added later, after StringConstructor has been built 139 139 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum); -
trunk/Source/JavaScriptCore/runtime/WriteBarrier.h
r77151 r77269 98 98 bool operator!() const { return !m_cell; } 99 99 100 void setWithoutWriteBarrier(T* value) { this->m_cell = reinterpret_cast<JSCell*>(value); } 101 100 102 protected: 101 103 JSCell* m_cell; … … 120 122 void setUndefined() { m_value = JSValue::encode(jsUndefined()); } 121 123 bool isNumber() const { return get().isNumber(); } 124 bool isGetterSetter() const { return get().isGetterSetter(); } 125 122 126 JSValue* slot() 123 127 {
Note:
See TracChangeset
for help on using the changeset viewer.