Changeset 77098 in webkit
- Timestamp:
- Jan 30, 2011, 5:13:10 PM (15 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 125 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r77044 r77098 55 55 } 56 56 57 void setPrivateProperty( const Identifier& propertyName, JSValue value)57 void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value) 58 58 { 59 59 if (!m_privateProperties) 60 60 m_privateProperties = adoptPtr(new JSPrivatePropertyMap); 61 m_privateProperties->setPrivateProperty( propertyName, value);61 m_privateProperties->setPrivateProperty(globalData, owner, propertyName, value); 62 62 } 63 63 … … 84 84 if (location == m_propertyMap.end()) 85 85 return JSValue(); 86 return location->second ;86 return location->second.get(); 87 87 } 88 88 89 void setPrivateProperty(const Identifier& propertyName, JSValue value) 90 { 91 m_propertyMap.set(propertyName.impl(), value); 89 void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value) 90 { 91 WriteBarrier<Unknown> empty; 92 m_propertyMap.add(propertyName.impl(), empty).first->second.set(globalData, owner, value); 92 93 } 93 94 … … 101 102 for (PrivatePropertyMap::iterator ptr = m_propertyMap.begin(); ptr != m_propertyMap.end(); ++ptr) { 102 103 if (ptr->second) 103 markStack.append( ptr->second);104 markStack.append(&ptr->second); 104 105 } 105 106 } 106 107 107 108 private: 108 typedef HashMap<RefPtr<StringImpl>, JSValue, IdentifierRepHash> PrivatePropertyMap;109 typedef HashMap<RefPtr<StringImpl>, WriteBarrier<Unknown>, IdentifierRepHash> PrivatePropertyMap; 109 110 PrivatePropertyMap m_propertyMap; 110 111 }; … … 138 139 } 139 140 140 void setPrivateProperty( const Identifier& propertyName, JSValue value)141 { 142 m_callbackObjectData->setPrivateProperty( propertyName, value);141 void setPrivateProperty(JSGlobalData& globalData, const Identifier& propertyName, JSValue value) 142 { 143 m_callbackObjectData->setPrivateProperty(globalData, this, propertyName, value); 143 144 } 144 145 -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r77044 r77098 239 239 if (entry->attributes & kJSPropertyAttributeReadOnly) 240 240 return; 241 JSCallbackObject<Base>::putDirect( propertyName, value); // put as override property241 JSCallbackObject<Base>::putDirect(exec->globalData(), propertyName, value); // put as override property 242 242 return; 243 243 } … … 566 566 567 567 JSObject* o = new (exec) JSCallbackFunction(exec, asGlobalObject(thisObj->getAnonymousValue(0)), callAsFunction, propertyName); 568 thisObj->putDirect( propertyName, o, entry->attributes);568 thisObj->putDirect(exec->globalData(), propertyName, o, entry->attributes); 569 569 return o; 570 570 } -
trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
r77044 r77098 109 109 110 110 JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor); 111 constructor->putDirect(exec-> propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly);111 constructor->putDirect(exec->globalData(), exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly); 112 112 return toRef(constructor); 113 113 } … … 386 386 Identifier name(propertyName->identifier(&exec->globalData())); 387 387 if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::info)) { 388 static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivateProperty( name, jsValue);388 static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue); 389 389 return true; 390 390 } 391 391 if (jsObject->inherits(&JSCallbackObject<JSObjectWithGlobalObject>::info)) { 392 static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(jsObject)->setPrivateProperty( name, jsValue);392 static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue); 393 393 return true; 394 394 } -
trunk/Source/JavaScriptCore/API/JSWeakObjectMapRefInternal.h
r77044 r77098 38 38 typedef void (*JSWeakMapDestroyedCallback)(struct OpaqueJSWeakObjectMap*, void*); 39 39 40 typedef JSC::WeakGCMap<void*, JSC::JSObject *> WeakMapType;40 typedef JSC::WeakGCMap<void*, JSC::JSObject> WeakMapType; 41 41 42 42 struct OpaqueJSWeakObjectMap : public RefCounted<OpaqueJSWeakObjectMap> { -
trunk/Source/JavaScriptCore/ChangeLog
r77094 r77098 1 2011-01-30 Oliver Hunt <[email protected]> 2 3 Convert markstack to a slot visitor API 4 https://bugs.webkit.org/show_bug.cgi?id=53219 5 6 rolling r77006 and r77020 back in. 7 8 * API/JSCallbackObject.h: 9 (JSC::JSCallbackObjectData::setPrivateProperty): 10 (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty): 11 (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): 12 (JSC::JSCallbackObjectData::JSPrivatePropertyMap::markChildren): 13 (JSC::JSCallbackObject::setPrivateProperty): 14 * API/JSCallbackObjectFunctions.h: 15 (JSC::::put): 16 (JSC::::staticFunctionGetter): 17 * API/JSObjectRef.cpp: 18 (JSObjectMakeConstructor): 19 (JSObjectSetPrivateProperty): 20 * API/JSWeakObjectMapRefInternal.h: 21 * JavaScriptCore.exp: 22 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 23 * JavaScriptCore.xcodeproj/project.pbxproj: 24 * bytecode/CodeBlock.cpp: 25 (JSC::CodeBlock::markAggregate): 26 * bytecode/CodeBlock.h: 27 (JSC::CodeBlock::globalObject): 28 * bytecompiler/BytecodeGenerator.cpp: 29 (JSC::BytecodeGenerator::BytecodeGenerator): 30 (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall): 31 (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply): 32 (JSC::BytecodeGenerator::findScopedProperty): 33 * debugger/Debugger.cpp: 34 (JSC::evaluateInGlobalCallFrame): 35 * debugger/DebuggerActivation.cpp: 36 (JSC::DebuggerActivation::DebuggerActivation): 37 (JSC::DebuggerActivation::markChildren): 38 * debugger/DebuggerActivation.h: 39 * debugger/DebuggerCallFrame.cpp: 40 (JSC::DebuggerCallFrame::evaluate): 41 * interpreter/CallFrame.h: 42 (JSC::ExecState::exception): 43 * interpreter/Interpreter.cpp: 44 (JSC::Interpreter::resolve): 45 (JSC::Interpreter::resolveSkip): 46 (JSC::Interpreter::resolveGlobal): 47 (JSC::Interpreter::resolveGlobalDynamic): 48 (JSC::Interpreter::resolveBaseAndProperty): 49 (JSC::Interpreter::unwindCallFrame): 50 (JSC::appendSourceToError): 51 (JSC::Interpreter::execute): 52 (JSC::Interpreter::tryCacheGetByID): 53 (JSC::Interpreter::privateExecute): 54 * jit/JITStubs.cpp: 55 (JSC::JITThunks::tryCacheGetByID): 56 (JSC::DEFINE_STUB_FUNCTION): 57 * jsc.cpp: 58 (GlobalObject::GlobalObject): 59 * runtime/ArgList.cpp: 60 (JSC::MarkedArgumentBuffer::markLists): 61 * runtime/Arguments.cpp: 62 (JSC::Arguments::markChildren): 63 (JSC::Arguments::getOwnPropertySlot): 64 (JSC::Arguments::getOwnPropertyDescriptor): 65 (JSC::Arguments::put): 66 * runtime/Arguments.h: 67 (JSC::Arguments::setActivation): 68 (JSC::Arguments::Arguments): 69 * runtime/ArrayConstructor.cpp: 70 (JSC::ArrayConstructor::ArrayConstructor): 71 (JSC::constructArrayWithSizeQuirk): 72 * runtime/ArrayPrototype.cpp: 73 (JSC::arrayProtoFuncSplice): 74 * runtime/BatchedTransitionOptimizer.h: 75 (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer): 76 (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer): 77 * runtime/BooleanConstructor.cpp: 78 (JSC::BooleanConstructor::BooleanConstructor): 79 (JSC::constructBoolean): 80 (JSC::constructBooleanFromImmediateBoolean): 81 * runtime/BooleanPrototype.cpp: 82 (JSC::BooleanPrototype::BooleanPrototype): 83 * runtime/ConservativeSet.cpp: 84 (JSC::ConservativeSet::grow): 85 * runtime/ConservativeSet.h: 86 (JSC::ConservativeSet::~ConservativeSet): 87 (JSC::ConservativeSet::mark): 88 * runtime/DateConstructor.cpp: 89 (JSC::DateConstructor::DateConstructor): 90 * runtime/DateInstance.cpp: 91 (JSC::DateInstance::DateInstance): 92 * runtime/DatePrototype.cpp: 93 (JSC::dateProtoFuncSetTime): 94 (JSC::setNewValueFromTimeArgs): 95 (JSC::setNewValueFromDateArgs): 96 (JSC::dateProtoFuncSetYear): 97 * runtime/ErrorConstructor.cpp: 98 (JSC::ErrorConstructor::ErrorConstructor): 99 * runtime/ErrorInstance.cpp: 100 (JSC::ErrorInstance::ErrorInstance): 101 * runtime/ErrorPrototype.cpp: 102 (JSC::ErrorPrototype::ErrorPrototype): 103 * runtime/FunctionConstructor.cpp: 104 (JSC::FunctionConstructor::FunctionConstructor): 105 * runtime/FunctionPrototype.cpp: 106 (JSC::FunctionPrototype::FunctionPrototype): 107 * runtime/GetterSetter.cpp: 108 (JSC::GetterSetter::markChildren): 109 * runtime/GetterSetter.h: 110 (JSC::GetterSetter::GetterSetter): 111 (JSC::GetterSetter::getter): 112 (JSC::GetterSetter::setGetter): 113 (JSC::GetterSetter::setter): 114 (JSC::GetterSetter::setSetter): 115 * runtime/GlobalEvalFunction.cpp: 116 (JSC::GlobalEvalFunction::GlobalEvalFunction): 117 (JSC::GlobalEvalFunction::markChildren): 118 * runtime/GlobalEvalFunction.h: 119 (JSC::GlobalEvalFunction::cachedGlobalObject): 120 * runtime/Heap.cpp: 121 (JSC::Heap::markProtectedObjects): 122 (JSC::Heap::markTempSortVectors): 123 (JSC::Heap::markRoots): 124 * runtime/InternalFunction.cpp: 125 (JSC::InternalFunction::InternalFunction): 126 * runtime/JSAPIValueWrapper.h: 127 (JSC::JSAPIValueWrapper::value): 128 (JSC::JSAPIValueWrapper::JSAPIValueWrapper): 129 * runtime/JSActivation.cpp: 130 (JSC::JSActivation::markChildren): 131 (JSC::JSActivation::put): 132 * runtime/JSArray.cpp: 133 (JSC::JSArray::JSArray): 134 (JSC::JSArray::getOwnPropertySlot): 135 (JSC::JSArray::getOwnPropertyDescriptor): 136 (JSC::JSArray::put): 137 (JSC::JSArray::putSlowCase): 138 (JSC::JSArray::deleteProperty): 139 (JSC::JSArray::increaseVectorLength): 140 (JSC::JSArray::setLength): 141 (JSC::JSArray::pop): 142 (JSC::JSArray::push): 143 (JSC::JSArray::unshiftCount): 144 (JSC::JSArray::sort): 145 (JSC::JSArray::fillArgList): 146 (JSC::JSArray::copyToRegisters): 147 (JSC::JSArray::compactForSorting): 148 * runtime/JSArray.h: 149 (JSC::JSArray::getIndex): 150 (JSC::JSArray::setIndex): 151 (JSC::JSArray::uncheckedSetIndex): 152 (JSC::JSArray::markChildrenDirect): 153 * runtime/JSByteArray.cpp: 154 (JSC::JSByteArray::JSByteArray): 155 * runtime/JSCell.h: 156 (JSC::JSCell::MarkStack::append): 157 (JSC::JSCell::MarkStack::internalAppend): 158 (JSC::JSCell::MarkStack::deprecatedAppend): 159 * runtime/JSFunction.cpp: 160 (JSC::JSFunction::JSFunction): 161 (JSC::JSFunction::getOwnPropertySlot): 162 * runtime/JSGlobalData.h: 163 * runtime/JSGlobalObject.cpp: 164 (JSC::markIfNeeded): 165 (JSC::JSGlobalObject::reset): 166 (JSC::JSGlobalObject::resetPrototype): 167 (JSC::JSGlobalObject::markChildren): 168 * runtime/JSGlobalObject.h: 169 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): 170 (JSC::JSGlobalObject::regExpConstructor): 171 (JSC::JSGlobalObject::errorConstructor): 172 (JSC::JSGlobalObject::evalErrorConstructor): 173 (JSC::JSGlobalObject::rangeErrorConstructor): 174 (JSC::JSGlobalObject::referenceErrorConstructor): 175 (JSC::JSGlobalObject::syntaxErrorConstructor): 176 (JSC::JSGlobalObject::typeErrorConstructor): 177 (JSC::JSGlobalObject::URIErrorConstructor): 178 (JSC::JSGlobalObject::evalFunction): 179 (JSC::JSGlobalObject::objectPrototype): 180 (JSC::JSGlobalObject::functionPrototype): 181 (JSC::JSGlobalObject::arrayPrototype): 182 (JSC::JSGlobalObject::booleanPrototype): 183 (JSC::JSGlobalObject::stringPrototype): 184 (JSC::JSGlobalObject::numberPrototype): 185 (JSC::JSGlobalObject::datePrototype): 186 (JSC::JSGlobalObject::regExpPrototype): 187 (JSC::JSGlobalObject::methodCallDummy): 188 (JSC::Structure::prototypeForLookup): 189 (JSC::constructArray): 190 * runtime/JSONObject.cpp: 191 (JSC::Stringifier::Holder::object): 192 (JSC::Stringifier::Holder::objectSlot): 193 (JSC::Stringifier::markAggregate): 194 (JSC::Stringifier::stringify): 195 (JSC::Stringifier::Holder::appendNextProperty): 196 (JSC::Walker::callReviver): 197 (JSC::Walker::walk): 198 * runtime/JSObject.cpp: 199 (JSC::JSObject::defineGetter): 200 (JSC::JSObject::defineSetter): 201 (JSC::JSObject::removeDirect): 202 (JSC::JSObject::putDirectFunction): 203 (JSC::JSObject::putDirectFunctionWithoutTransition): 204 (JSC::putDescriptor): 205 (JSC::JSObject::defineOwnProperty): 206 * runtime/JSObject.h: 207 (JSC::JSObject::getDirectOffset): 208 (JSC::JSObject::putDirectOffset): 209 (JSC::JSObject::putUndefinedAtDirectOffset): 210 (JSC::JSObject::flattenDictionaryObject): 211 (JSC::JSObject::putDirectInternal): 212 (JSC::JSObject::putDirect): 213 (JSC::JSObject::putDirectFunction): 214 (JSC::JSObject::putDirectWithoutTransition): 215 (JSC::JSObject::putDirectFunctionWithoutTransition): 216 (JSC::JSValue::putDirect): 217 (JSC::JSObject::allocatePropertyStorageInline): 218 (JSC::JSObject::markChildrenDirect): 219 * runtime/JSPropertyNameIterator.cpp: 220 (JSC::JSPropertyNameIterator::JSPropertyNameIterator): 221 (JSC::JSPropertyNameIterator::get): 222 * runtime/JSPropertyNameIterator.h: 223 * runtime/JSStaticScopeObject.cpp: 224 (JSC::JSStaticScopeObject::markChildren): 225 * runtime/JSString.cpp: 226 (JSC::StringObject::create): 227 * runtime/JSValue.h: 228 * runtime/JSWrapperObject.cpp: 229 (JSC::JSWrapperObject::markChildren): 230 * runtime/JSWrapperObject.h: 231 (JSC::JSWrapperObject::internalValue): 232 (JSC::JSWrapperObject::setInternalValue): 233 * runtime/LiteralParser.cpp: 234 (JSC::LiteralParser::parse): 235 * runtime/Lookup.cpp: 236 (JSC::setUpStaticFunctionSlot): 237 * runtime/Lookup.h: 238 (JSC::lookupPut): 239 * runtime/MarkStack.h: 240 (JSC::MarkStack::MarkStack): 241 (JSC::MarkStack::deprecatedAppendValues): 242 (JSC::MarkStack::appendValues): 243 * runtime/MathObject.cpp: 244 (JSC::MathObject::MathObject): 245 * runtime/NativeErrorConstructor.cpp: 246 (JSC::NativeErrorConstructor::NativeErrorConstructor): 247 * runtime/NativeErrorPrototype.cpp: 248 (JSC::NativeErrorPrototype::NativeErrorPrototype): 249 * runtime/NumberConstructor.cpp: 250 (JSC::NumberConstructor::NumberConstructor): 251 (JSC::constructWithNumberConstructor): 252 * runtime/NumberObject.cpp: 253 (JSC::constructNumber): 254 * runtime/NumberPrototype.cpp: 255 (JSC::NumberPrototype::NumberPrototype): 256 * runtime/ObjectConstructor.cpp: 257 (JSC::ObjectConstructor::ObjectConstructor): 258 (JSC::objectConstructorGetOwnPropertyDescriptor): 259 * runtime/Operations.h: 260 (JSC::normalizePrototypeChain): 261 (JSC::resolveBase): 262 * runtime/PrototypeFunction.cpp: 263 (JSC::PrototypeFunction::PrototypeFunction): 264 * runtime/PutPropertySlot.h: 265 (JSC::PutPropertySlot::setExistingProperty): 266 (JSC::PutPropertySlot::setNewProperty): 267 (JSC::PutPropertySlot::base): 268 * runtime/RegExpConstructor.cpp: 269 (JSC::RegExpConstructor::RegExpConstructor): 270 * runtime/ScopeChain.cpp: 271 (JSC::ScopeChainNode::print): 272 * runtime/ScopeChain.h: 273 (JSC::ScopeChainNode::~ScopeChainNode): 274 (JSC::ScopeChainIterator::operator*): 275 (JSC::ScopeChainIterator::operator->): 276 (JSC::ScopeChain::top): 277 * runtime/ScopeChainMark.h: 278 (JSC::ScopeChain::markAggregate): 279 * runtime/SmallStrings.cpp: 280 (JSC::isMarked): 281 (JSC::SmallStrings::markChildren): 282 * runtime/SmallStrings.h: 283 (JSC::SmallStrings::emptyString): 284 (JSC::SmallStrings::singleCharacterString): 285 (JSC::SmallStrings::singleCharacterStrings): 286 * runtime/StringConstructor.cpp: 287 (JSC::StringConstructor::StringConstructor): 288 * runtime/StringObject.cpp: 289 (JSC::StringObject::StringObject): 290 * runtime/StringObject.h: 291 * runtime/StringPrototype.cpp: 292 (JSC::StringPrototype::StringPrototype): 293 * runtime/Structure.cpp: 294 (JSC::Structure::Structure): 295 (JSC::Structure::addPropertyTransition): 296 (JSC::Structure::toDictionaryTransition): 297 (JSC::Structure::flattenDictionaryStructure): 298 * runtime/Structure.h: 299 (JSC::Structure::storedPrototype): 300 (JSC::Structure::storedPrototypeSlot): 301 * runtime/WeakGCMap.h: 302 (JSC::WeakGCMap::uncheckedGet): 303 (JSC::WeakGCMap::uncheckedGetSlot): 304 (JSC::WeakGCMap::isValid): 305 (JSC::::get): 306 (JSC::::take): 307 (JSC::::set): 308 (JSC::::uncheckedRemove): 309 * runtime/WriteBarrier.h: Added. 310 (JSC::DeprecatedPtr::DeprecatedPtr): 311 (JSC::DeprecatedPtr::get): 312 (JSC::DeprecatedPtr::operator*): 313 (JSC::DeprecatedPtr::operator->): 314 (JSC::DeprecatedPtr::slot): 315 (JSC::DeprecatedPtr::operator UnspecifiedBoolType*): 316 (JSC::DeprecatedPtr::operator!): 317 (JSC::WriteBarrierBase::set): 318 (JSC::WriteBarrierBase::get): 319 (JSC::WriteBarrierBase::operator*): 320 (JSC::WriteBarrierBase::operator->): 321 (JSC::WriteBarrierBase::slot): 322 (JSC::WriteBarrierBase::operator UnspecifiedBoolType*): 323 (JSC::WriteBarrierBase::operator!): 324 (JSC::WriteBarrier::WriteBarrier): 325 (JSC::operator==): 326 1 327 2011-01-30 Geoffrey Garen <[email protected]> 2 328 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r77083 r77098 183 183 __ZN3JSC17constructFunctionEPNS_9ExecStateERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi 184 184 __ZN3JSC17createSyntaxErrorEPNS_9ExecStateERKNS_7UStringE 185 __ZN3JSC18DebuggerActivationC1E PNS_8JSObjectE185 __ZN3JSC18DebuggerActivationC1ERNS_12JSGlobalDataEPNS_8JSObjectE 186 186 __ZN3JSC18PropertyDescriptor11setWritableEb 187 187 __ZN3JSC18PropertyDescriptor12setUndefinedEv … … 251 251 __ZN3JSC7JSArray9setLengthEj 252 252 __ZN3JSC7JSArrayC1EN3WTF17NonNullPassRefPtrINS_9StructureEEE 253 __ZN3JSC7JSArrayC1E N3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_7ArgListE253 __ZN3JSC7JSArrayC1ERNS_12JSGlobalDataEN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_7ArgListE 254 254 __ZN3JSC7JSArrayC2EN3WTF17NonNullPassRefPtrINS_9StructureEEE 255 255 __ZN3JSC7JSArrayD2Ev -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r77077 r77098 11 11 ??0InternalFunction@JSC@@IAE@PAVJSGlobalData@1@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVIdentifier@1@@Z 12 12 ??0JSArray@JSC@@QAE@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@@Z 13 ??0JSArray@JSC@@QAE@ V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVArgList@1@@Z13 ??0JSArray@JSC@@QAE@AAVJSGlobalData@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVArgList@1@@Z 14 14 ??0JSByteArray@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@PAVByteArray@4@PBUClassInfo@1@@Z 15 15 ??0JSFunction@JSC@@QAE@PAVExecState@1@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@HABVIdentifier@1@P6I_J0@Z@Z -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r77062 r77098 374 374 A7C530E4102A3813005BC741 /* MarkStackPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */; }; 375 375 A7D649AA1015224E009B2E1B /* PossiblyNull.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D649A91015224E009B2E1B /* PossiblyNull.h */; settings = {ATTRIBUTES = (Private, ); }; }; 376 A7DCB97312E5193F00911940 /* WriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A7DCB77912E3D90500911940 /* WriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; }; 376 377 A7E2EA6B0FB460CF00601F06 /* LiteralParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E2EA690FB460CF00601F06 /* LiteralParser.h */; }; 377 378 A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */; }; … … 1045 1046 A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkStackPosix.cpp; sourceTree = "<group>"; }; 1046 1047 A7D649A91015224E009B2E1B /* PossiblyNull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PossiblyNull.h; sourceTree = "<group>"; }; 1048 A7DCB77912E3D90500911940 /* WriteBarrier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WriteBarrier.h; sourceTree = "<group>"; }; 1047 1049 A7E2EA690FB460CF00601F06 /* LiteralParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiteralParser.h; sourceTree = "<group>"; }; 1048 1050 A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralParser.cpp; sourceTree = "<group>"; }; … … 1907 1909 14035DB010DBFB2A00FFFFE7 /* WeakGCPtr.h */, 1908 1910 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */, 1911 A7DCB77912E3D90500911940 /* WriteBarrier.h */, 1909 1912 ); 1910 1913 path = runtime; … … 2432 2435 5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */, 2433 2436 451539B912DC994500EF7AC4 /* Yarr.h in Headers */, 2437 A7DCB97312E5193F00911940 /* WriteBarrier.h in Headers */, 2434 2438 E49DC16C12EF294E00184A1F /* SourceProviderCache.h in Headers */, 2435 2439 E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */, -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r77044 r77098 1530 1530 { 1531 1531 for (size_t i = 0; i < m_constantRegisters.size(); ++i) 1532 markStack. append(m_constantRegisters[i].jsValue());1532 markStack.deprecatedAppend(&m_constantRegisters[i]); 1533 1533 for (size_t i = 0; i < m_functionExprs.size(); ++i) 1534 1534 m_functionExprs[i]->markAggregate(markStack); 1535 1535 for (size_t i = 0; i < m_functionDecls.size(); ++i) 1536 1536 m_functionDecls[i]->markAggregate(markStack); 1537 markStack.append( m_globalObject);1537 markStack.append(&m_globalObject); 1538 1538 } 1539 1539 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r77044 r77098 249 249 CodeBlock(ScriptExecutable* ownerExecutable, CodeType, JSGlobalObject*, PassRefPtr<SourceProvider>, unsigned sourceOffset, SymbolTable* symbolTable, bool isConstructor); 250 250 251 JSGlobalObject*m_globalObject;251 DeprecatedPtr<JSGlobalObject> m_globalObject; 252 252 253 253 public: … … 486 486 RegExp* regexp(int index) const { ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); } 487 487 488 JSGlobalObject* globalObject() { return m_globalObject ; }488 JSGlobalObject* globalObject() { return m_globalObject.get(); } 489 489 490 490 // Jump Tables -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r77044 r77098 252 252 registerFor(it->second.getIndex()).setIndex(it->second.getIndex() + m_globalVarStorageOffset); 253 253 254 BatchedTransitionOptimizer optimizer( globalObject);254 BatchedTransitionOptimizer optimizer(*m_globalData, globalObject); 255 255 256 256 const VarStack& varStack = programNode->varStack(); … … 904 904 emitOpcode(op_jneq_ptr); 905 905 instructions().append(cond->index()); 906 instructions().append(m_scopeChain->globalObject()->d()->callFunction );906 instructions().append(m_scopeChain->globalObject()->d()->callFunction.get()); 907 907 instructions().append(target->bind(begin, instructions().size())); 908 908 return target; … … 915 915 emitOpcode(op_jneq_ptr); 916 916 instructions().append(cond->index()); 917 instructions().append(m_scopeChain->globalObject()->d()->applyFunction );917 instructions().append(m_scopeChain->globalObject()->d()->applyFunction.get()); 918 918 instructions().append(target->bind(begin, instructions().size())); 919 919 return target; … … 1118 1118 if (shouldOptimizeLocals() && m_codeType == GlobalCode) { 1119 1119 ScopeChainIterator iter = m_scopeChain->begin(); 1120 globalObject = *iter;1120 globalObject = iter->get(); 1121 1121 ASSERT((++iter) == m_scopeChain->end()); 1122 1122 } … … 1129 1129 ScopeChainIterator end = m_scopeChain->end(); 1130 1130 for (; iter != end; ++iter, ++depth) { 1131 JSObject* currentScope = *iter;1131 JSObject* currentScope = iter->get(); 1132 1132 if (!currentScope->isVariableObject()) 1133 1133 break; … … 1158 1158 stackDepth = depth + m_codeBlock->needsFullScopeChain(); 1159 1159 index = missingSymbolMarker(); 1160 JSObject* scope = *iter;1160 JSObject* scope = iter->get(); 1161 1161 if (++iter == end) 1162 1162 globalObject = scope; -
trunk/Source/JavaScriptCore/debugger/Debugger.cpp
r77044 r77098 110 110 JSValue result = globalData.interpreter->execute(eval.get(), globalCallFrame, globalObject, globalCallFrame->scopeChain()); 111 111 if (globalData.exception) { 112 exception = globalData.exception ;112 exception = globalData.exception.get(); 113 113 globalData.exception = JSValue(); 114 114 } -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
r77044 r77098 31 31 namespace JSC { 32 32 33 DebuggerActivation::DebuggerActivation(JS Object* activation)33 DebuggerActivation::DebuggerActivation(JSGlobalData& globalData, JSObject* activation) 34 34 : JSObject(DebuggerActivation::createStructure(jsNull())) 35 35 { 36 36 ASSERT(activation); 37 37 ASSERT(activation->isActivationObject()); 38 m_activation = static_cast<JSActivation*>(activation);38 m_activation.set(globalData, this, static_cast<JSActivation*>(activation)); 39 39 } 40 40 … … 44 44 45 45 if (m_activation) 46 markStack.append( m_activation);46 markStack.append(&m_activation); 47 47 } 48 48 -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h
r77044 r77098 35 35 class DebuggerActivation : public JSObject { 36 36 public: 37 DebuggerActivation(JS Object*);37 DebuggerActivation(JSGlobalData&, JSObject*); 38 38 39 39 virtual void markChildren(MarkStack&); … … 59 59 60 60 private: 61 JSActivation*m_activation;61 WriteBarrier<JSActivation> m_activation; 62 62 }; 63 63 -
trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
r77044 r77098 97 97 JSValue result = globalData.interpreter->execute(eval.get(), m_callFrame, thisObject(), m_callFrame->scopeChain()); 98 98 if (globalData.exception) { 99 exception = globalData.exception ;99 exception = globalData.exception.get(); 100 100 globalData.exception = JSValue(); 101 101 } -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r77044 r77098 76 76 77 77 void clearException() { globalData().exception = JSValue(); } 78 JSValue exception() const { return globalData().exception ; }78 JSValue exception() const { return globalData().exception.get(); } 79 79 bool hadException() const { return globalData().exception; } 80 80 -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r77044 r77098 104 104 Identifier& ident = codeBlock->identifier(property); 105 105 do { 106 JSObject* o = *iter;106 JSObject* o = iter->get(); 107 107 PropertySlot slot(o); 108 108 if (o->getPropertySlot(callFrame, ident, slot)) { 109 109 JSValue result = slot.getValue(callFrame, ident); 110 exceptionValue = callFrame->globalData().exception ;110 exceptionValue = callFrame->globalData().exception.get(); 111 111 if (exceptionValue) 112 112 return false; … … 143 143 Identifier& ident = codeBlock->identifier(property); 144 144 do { 145 JSObject* o = *iter;145 JSObject* o = iter->get(); 146 146 PropertySlot slot(o); 147 147 if (o->getPropertySlot(callFrame, ident, slot)) { 148 148 JSValue result = slot.getValue(callFrame, ident); 149 exceptionValue = callFrame->globalData().exception ;149 exceptionValue = callFrame->globalData().exception.get(); 150 150 if (exceptionValue) 151 151 return false; … … 188 188 } 189 189 190 exceptionValue = callFrame->globalData().exception ;190 exceptionValue = callFrame->globalData().exception.get(); 191 191 if (exceptionValue) 192 192 return false; … … 221 221 } 222 222 while (skip--) { 223 JSObject* o = *iter;223 JSObject* o = iter->get(); 224 224 if (o->hasCustomProperties()) { 225 225 Identifier& ident = codeBlock->identifier(property); … … 228 228 if (o->getPropertySlot(callFrame, ident, slot)) { 229 229 JSValue result = slot.getValue(callFrame, ident); 230 exceptionValue = callFrame->globalData().exception ;230 exceptionValue = callFrame->globalData().exception.get(); 231 231 if (exceptionValue) 232 232 return false; … … 237 237 if (iter == end) 238 238 break; 239 o = *iter;239 o = iter->get(); 240 240 ++iter; 241 241 } while (true); … … 267 267 } 268 268 269 exceptionValue = callFrame->globalData().exception ;269 exceptionValue = callFrame->globalData().exception.get(); 270 270 if (exceptionValue) 271 271 return false; … … 311 311 JSObject* base; 312 312 do { 313 base = *iter;313 base = iter->get(); 314 314 PropertySlot slot(base); 315 315 if (base->getPropertySlot(callFrame, ident, slot)) { 316 316 JSValue result = slot.getValue(callFrame, ident); 317 exceptionValue = callFrame->globalData().exception ;317 exceptionValue = callFrame->globalData().exception.get(); 318 318 if (exceptionValue) 319 319 return false; … … 567 567 while (!scopeChain->object->inherits(&JSActivation::info)) 568 568 scopeChain = scopeChain->pop(); 569 JSActivation* activation = asActivation(scopeChain->object );569 JSActivation* activation = asActivation(scopeChain->object.get()); 570 570 activation->copyRegisters(); 571 571 if (JSValue arguments = callFrame->uncheckedR(unmodifiedArgumentsRegister(oldCodeBlock->argumentsRegister())).jsValue()) { 572 572 if (!oldCodeBlock->isStrictMode()) 573 asArguments(arguments)->setActivation( activation);573 asArguments(arguments)->setActivation(callFrame->globalData(), activation); 574 574 } 575 575 } else if (oldCodeBlock->usesArguments() && !oldCodeBlock->isStrictMode()) { … … 649 649 } 650 650 651 exception->putDirect( globalData->propertyNames->message, jsString(globalData, message));651 exception->putDirect(*globalData, globalData->propertyNames->message, jsString(globalData, message)); 652 652 } 653 653 … … 1086 1086 ASSERT(node); 1087 1087 if (node->object->isVariableObject()) { 1088 variableObject = static_cast<JSVariableObject*>(node->object );1088 variableObject = static_cast<JSVariableObject*>(node->object.get()); 1089 1089 break; 1090 1090 } … … 1101 1101 } 1102 1102 // Scope for BatchedTransitionOptimizer 1103 BatchedTransitionOptimizer optimizer( variableObject);1103 BatchedTransitionOptimizer optimizer(callFrame->globalData(), variableObject); 1104 1104 1105 1105 for (unsigned i = 0; i < numVariables; ++i) { … … 1372 1372 // should not be treated as a dictionary. 1373 1373 if (baseObject->structure()->isDictionary()) { 1374 baseObject->flattenDictionaryObject( );1374 baseObject->flattenDictionaryObject(callFrame->globalData()); 1375 1375 offset = baseObject->structure()->get(propertyName); 1376 1376 } … … 1476 1476 #define CHECK_FOR_EXCEPTION() \ 1477 1477 do { \ 1478 if (UNLIKELY(globalData->exception != JSValue())) { \1479 exceptionValue = globalData->exception ; \1478 if (UNLIKELY(globalData->exception.get() != JSValue())) { \ 1479 exceptionValue = globalData->exception.get(); \ 1480 1480 goto vm_throw; \ 1481 1481 } \ … … 2409 2409 } 2410 2410 ASSERT((*iter)->isVariableObject()); 2411 JSVariableObject* scope = static_cast<JSVariableObject*>( *iter);2411 JSVariableObject* scope = static_cast<JSVariableObject*>(iter->get()); 2412 2412 callFrame->uncheckedR(dst) = scope->registerAt(index); 2413 2413 ASSERT(callFrame->r(dst).jsValue()); … … 2440 2440 2441 2441 ASSERT((*iter)->isVariableObject()); 2442 JSVariableObject* scope = static_cast<JSVariableObject*>( *iter);2442 JSVariableObject* scope = static_cast<JSVariableObject*>(iter->get()); 2443 2443 ASSERT(callFrame->r(value).jsValue()); 2444 2444 scope->registerAt(index) = JSValue(callFrame->r(value).jsValue()); … … 3081 3081 unsigned offset = vPC[7].u.operand; 3082 3082 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock->identifier(vPC[2].u.operand))) == offset); 3083 baseObject->putDirectOffset( offset, callFrame->r(value).jsValue());3083 baseObject->putDirectOffset(callFrame->globalData(), offset, callFrame->r(value).jsValue()); 3084 3084 3085 3085 vPC += OPCODE_LENGTH(op_put_by_id_transition); … … 3116 3116 3117 3117 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock->identifier(vPC[2].u.operand))) == offset); 3118 baseObject->putDirectOffset( offset, callFrame->r(value).jsValue());3118 baseObject->putDirectOffset(callFrame->globalData(), offset, callFrame->r(value).jsValue()); 3119 3119 3120 3120 vPC += OPCODE_LENGTH(op_put_by_id_replace); … … 3310 3310 JSArray* jsArray = asArray(baseValue); 3311 3311 if (jsArray->canSetIndex(i)) 3312 jsArray->setIndex( i, callFrame->r(value).jsValue());3312 jsArray->setIndex(*globalData, i, callFrame->r(value).jsValue()); 3313 3313 else 3314 3314 jsArray->JSArray::put(callFrame, i, callFrame->r(value).jsValue()); … … 3836 3836 if (thisValue == globalObject && funcVal == globalObject->evalFunction()) { 3837 3837 JSValue result = callEval(callFrame, registerFile, argv, argCount, registerOffset); 3838 if ((exceptionValue = globalData->exception ))3838 if ((exceptionValue = globalData->exception.get())) 3839 3839 goto vm_throw; 3840 3840 functionReturnValue = result; … … 4104 4104 if (JSValue argumentsValue = callFrame->r(unmodifiedArgumentsRegister(arguments)).jsValue()) { 4105 4105 if (!codeBlock->isStrictMode()) 4106 asArguments(argumentsValue)->setActivation( asActivation(activationValue));4106 asArguments(argumentsValue)->setActivation(*globalData, asActivation(activationValue)); 4107 4107 } 4108 4108 } else if (JSValue argumentsValue = callFrame->r(unmodifiedArgumentsRegister(arguments)).jsValue()) { -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r77044 r77098 846 846 // should not be treated as a dictionary. 847 847 if (slotBaseObject->structure()->isDictionary()) { 848 slotBaseObject->flattenDictionaryObject( );848 slotBaseObject->flattenDictionaryObject(callFrame->globalData()); 849 849 offset = slotBaseObject->structure()->get(propertyName); 850 850 } … … 943 943 #define CHECK_FOR_EXCEPTION() \ 944 944 do { \ 945 if (UNLIKELY(stackFrame.globalData->exception )) \945 if (UNLIKELY(stackFrame.globalData->exception.get())) \ 946 946 VM_THROW_EXCEPTION(); \ 947 947 } while (0) 948 948 #define CHECK_FOR_EXCEPTION_AT_END() \ 949 949 do { \ 950 if (UNLIKELY(stackFrame.globalData->exception )) \950 if (UNLIKELY(stackFrame.globalData->exception.get())) \ 951 951 VM_THROW_EXCEPTION_AT_END(); \ 952 952 } while (0) 953 953 #define CHECK_FOR_EXCEPTION_VOID() \ 954 954 do { \ 955 if (UNLIKELY(stackFrame.globalData->exception )) { \955 if (UNLIKELY(stackFrame.globalData->exception.get())) { \ 956 956 VM_THROW_EXCEPTION_AT_END(); \ 957 957 return; \ … … 1467 1467 // should not be treated as a dictionary. 1468 1468 if (slotBaseObject->structure()->isDictionary()) 1469 slotBaseObject->flattenDictionaryObject( );1469 slotBaseObject->flattenDictionaryObject(callFrame->globalData()); 1470 1470 1471 1471 // The result fetched should always be the callee! … … 1657 1657 // should not be treated as a dictionary. 1658 1658 if (slotBaseObject->structure()->isDictionary()) { 1659 slotBaseObject->flattenDictionaryObject( );1659 slotBaseObject->flattenDictionaryObject(callFrame->globalData()); 1660 1660 offset = slotBaseObject->structure()->get(propertyName); 1661 1661 } … … 2148 2148 if (JSValue v = stackFrame.args[1].jsValue()) { 2149 2149 if (!stackFrame.callFrame->codeBlock()->isStrictMode()) 2150 asArguments(v)->setActivation( activation);2150 asArguments(v)->setActivation(*stackFrame.globalData, activation); 2151 2151 } 2152 2152 } … … 2205 2205 Identifier& ident = stackFrame.args[0].identifier(); 2206 2206 do { 2207 JSObject* o = *iter;2207 JSObject* o = iter->get(); 2208 2208 PropertySlot slot(o); 2209 2209 if (o->getPropertySlot(callFrame, ident, slot)) { … … 2398 2398 JSArray* jsArray = asArray(baseValue); 2399 2399 if (jsArray->canSetIndex(i)) 2400 jsArray->setIndex( i, value);2400 jsArray->setIndex(*globalData, i, value); 2401 2401 else 2402 2402 jsArray->JSArray::put(callFrame, i, value); … … 2646 2646 Identifier& ident = stackFrame.args[0].identifier(); 2647 2647 do { 2648 JSObject* o = *iter;2648 JSObject* o = iter->get(); 2649 2649 PropertySlot slot(o); 2650 2650 if (o->getPropertySlot(callFrame, ident, slot)) { … … 2975 2975 JSObject* base; 2976 2976 do { 2977 base = *iter;2977 base = iter->get(); 2978 2978 PropertySlot slot(base); 2979 2979 if (base->getPropertySlot(callFrame, ident, slot)) { … … 3481 3481 STUB_INIT_STACK_FRAME(stackFrame); 3482 3482 JSGlobalData* globalData = stackFrame.globalData; 3483 ExceptionHandler handler = jitThrow(globalData, stackFrame.callFrame, globalData->exception , globalData->exceptionLocation);3483 ExceptionHandler handler = jitThrow(globalData, stackFrame.callFrame, globalData->exception.get(), globalData->exceptionLocation); 3484 3484 STUB_SET_RETURN_ADDRESS(handler.catchRoutine); 3485 3485 return handler.callFrame; -
trunk/Source/JavaScriptCore/jsc.cpp
r77044 r77098 170 170 for (size_t i = 0; i < arguments.size(); ++i) 171 171 array->put(globalExec(), i, jsString(globalExec(), arguments[i])); 172 putDirect( Identifier(globalExec(), "arguments"), array);172 putDirect(globalExec()->globalData(), Identifier(globalExec(), "arguments"), array); 173 173 } 174 174 -
trunk/Source/JavaScriptCore/runtime/ArgList.cpp
r77044 r77098 43 43 for (ListSet::iterator it = markSet.begin(); it != end; ++it) { 44 44 MarkedArgumentBuffer* list = *it; 45 markStack. appendValues(reinterpret_cast<JSValue*>(list->m_buffer), list->m_size);45 markStack.deprecatedAppendValues(list->m_buffer, list->m_size); 46 46 } 47 47 } -
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r77044 r77098 49 49 50 50 if (d->registerArray) 51 markStack. appendValues(reinterpret_cast<JSValue*>(d->registerArray.get()), d->numParameters);51 markStack.deprecatedAppendValues(d->registerArray.get(), d->numParameters); 52 52 53 53 if (d->extraArguments) { 54 54 unsigned numExtraArguments = d->numArguments - d->numParameters; 55 markStack. appendValues(reinterpret_cast<JSValue*>(d->extraArguments), numExtraArguments);56 } 57 58 markStack.append( d->callee);55 markStack.deprecatedAppendValues(d->extraArguments, numExtraArguments); 56 } 57 58 markStack.append(&d->callee); 59 59 60 60 if (d->activation) 61 markStack.append( d->activation);61 markStack.append(&d->activation); 62 62 } 63 63 … … 198 198 if (propertyName == exec->propertyNames().callee && LIKELY(!d->overrodeCallee)) { 199 199 if (!d->isStrictMode) { 200 slot.setValue(d->callee );200 slot.setValue(d->callee.get()); 201 201 return true; 202 202 } … … 229 229 if (propertyName == exec->propertyNames().callee && LIKELY(!d->overrodeCallee)) { 230 230 if (!d->isStrictMode) { 231 descriptor.setDescriptor(d->callee , DontEnum);231 descriptor.setDescriptor(d->callee.get(), DontEnum); 232 232 return true; 233 233 } … … 281 281 if (propertyName == exec->propertyNames().length && !d->overrodeLength) { 282 282 d->overrodeLength = true; 283 putDirect( propertyName, value, DontEnum);283 putDirect(exec->globalData(), propertyName, value, DontEnum); 284 284 return; 285 285 } … … 288 288 if (!d->isStrictMode) { 289 289 d->overrodeCallee = true; 290 putDirect( propertyName, value, DontEnum);290 putDirect(exec->globalData(), propertyName, value, DontEnum); 291 291 return; 292 292 } -
trunk/Source/JavaScriptCore/runtime/Arguments.h
r77044 r77098 38 38 public: 39 39 ArgumentsData() { } 40 JSActivation*activation;40 WriteBarrier<JSActivation> activation; 41 41 42 42 unsigned numParameters; … … 51 51 Register extraArgumentsFixedBuffer[4]; 52 52 53 JSFunction*callee;53 WriteBarrier<JSFunction> callee; 54 54 bool overrodeLength : 1; 55 55 bool overrodeCallee : 1; … … 87 87 void copyRegisters(); 88 88 bool isTornOff() const { return d->registerArray; } 89 void setActivation(JS Activation* activation)89 void setActivation(JSGlobalData& globalData, JSActivation* activation) 90 90 { 91 d->activation = activation;91 d->activation.set(globalData, this, activation); 92 92 d->registers = &activation->registerAt(0); 93 93 } … … 159 159 d->numArguments = numArguments; 160 160 161 d->activation = 0;162 161 d->registers = callFrame->registers(); 163 162 … … 177 176 d->extraArguments = extraArguments; 178 177 179 d->callee = callee;178 d->callee.set(callFrame->globalData(), this, callee); 180 179 d->overrodeLength = false; 181 180 d->overrodeCallee = false; … … 196 195 d->numParameters = 0; 197 196 d->numArguments = numArguments; 198 d->activation = 0;199 197 200 198 Register* extraArguments; … … 210 208 d->extraArguments = extraArguments; 211 209 212 d->callee = asFunction(callFrame->callee());210 d->callee.set(callFrame->globalData(), this, asFunction(callFrame->callee())); 213 211 d->overrodeLength = false; 214 212 d->overrodeCallee = false; -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r77044 r77098 43 43 { 44 44 // ECMA 15.4.3.1 Array.prototype 45 putDirectWithoutTransition(exec-> propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);45 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly); 46 46 47 47 // no. of arguments for constructor 48 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);48 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 49 49 50 50 // ES5 … … 63 63 64 64 // otherwise the array is constructed with the arguments in it 65 return new (exec) JSArray(exec-> lexicalGlobalObject()->arrayStructure(), args);65 return new (exec) JSArray(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure(), args); 66 66 } 67 67 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r77044 r77098 546 546 JSArray* resObj = new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), deleteCount, CreateCompact); 547 547 JSValue result = resObj; 548 548 JSGlobalData& globalData = exec->globalData(); 549 549 for (unsigned k = 0; k < deleteCount; k++) 550 resObj->uncheckedSetIndex( k, getProperty(exec, thisObj, k + begin));550 resObj->uncheckedSetIndex(globalData, k, getProperty(exec, thisObj, k + begin)); 551 551 552 552 resObj->setLength(deleteCount); -
trunk/Source/JavaScriptCore/runtime/BatchedTransitionOptimizer.h
r77044 r77098 35 35 WTF_MAKE_NONCOPYABLE(BatchedTransitionOptimizer); 36 36 public: 37 BatchedTransitionOptimizer(JSObject* object) 38 : m_object(object) 37 BatchedTransitionOptimizer(JSGlobalData& globalData, JSObject* object) 38 : m_globalData(&globalData) 39 , m_object(object) 39 40 { 40 41 if (!m_object->structure()->isDictionary()) … … 44 45 ~BatchedTransitionOptimizer() 45 46 { 46 m_object->flattenDictionaryObject( );47 m_object->flattenDictionaryObject(*m_globalData); 47 48 } 48 49 49 50 private: 51 JSGlobalData* m_globalData; 50 52 JSObject* m_object; 51 53 }; -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
r77044 r77098 32 32 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, booleanPrototype->classInfo()->className)) 33 33 { 34 putDirectWithoutTransition(exec-> propertyNames().prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly);34 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly); 35 35 36 36 // no. of arguments for constructor 37 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);37 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum); 38 38 } 39 39 … … 42 42 { 43 43 BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanObjectStructure()); 44 obj->setInternalValue( jsBoolean(args.at(0).toBoolean(exec)));44 obj->setInternalValue(exec->globalData(), jsBoolean(args.at(0).toBoolean(exec))); 45 45 return obj; 46 46 } … … 73 73 { 74 74 BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanObjectStructure()); 75 obj->setInternalValue( immediateBooleanValue);75 obj->setInternalValue(exec->globalData(), immediateBooleanValue); 76 76 return obj; 77 77 } -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r77044 r77098 42 42 : BooleanObject(structure) 43 43 { 44 setInternalValue( jsBoolean(false));44 setInternalValue(exec->globalData(), jsBoolean(false)); 45 45 46 46 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().toString, booleanProtoFuncToString), DontEnum); -
trunk/Source/JavaScriptCore/runtime/ConservativeSet.cpp
r77044 r77098 37 37 { 38 38 size_t newCapacity = m_capacity == inlineCapacity ? nonInlineCapacity : m_capacity * 2; 39 JSCell** newSet = static_cast<JSCell**>(OSAllocator::reserveAndCommit(newCapacity * sizeof(JSCell*)));39 DeprecatedPtr<JSCell>* newSet = static_cast<DeprecatedPtr<JSCell>*>(OSAllocator::reserveAndCommit(newCapacity * sizeof(JSCell*))); 40 40 memcpy(newSet, m_set, m_size * sizeof(JSCell*)); 41 41 if (m_set != m_inlineSet) -
trunk/Source/JavaScriptCore/runtime/ConservativeSet.h
r77044 r77098 50 50 51 51 Heap* m_heap; 52 JSCell** m_set;52 DeprecatedPtr<JSCell>* m_set; 53 53 size_t m_size; 54 54 size_t m_capacity; 55 JSCell*m_inlineSet[inlineCapacity];55 DeprecatedPtr<JSCell> m_inlineSet[inlineCapacity]; 56 56 }; 57 57 … … 67 67 { 68 68 if (m_set != m_inlineSet) 69 OSAllocator::decommitAndRelease(m_set, m_capacity * sizeof( JSCell*));69 OSAllocator::decommitAndRelease(m_set, m_capacity * sizeof(DeprecatedPtr<JSCell>*)); 70 70 } 71 71 … … 73 73 { 74 74 for (size_t i = 0; i < m_size; ++i) 75 markStack.append( m_set[i]);75 markStack.append(&m_set[i]); 76 76 } 77 77 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r77044 r77098 62 62 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, datePrototype->classInfo()->className)) 63 63 { 64 putDirectWithoutTransition(exec-> propertyNames().prototype, datePrototype, DontEnum|DontDelete|ReadOnly);64 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, datePrototype, DontEnum | DontDelete | ReadOnly); 65 65 66 66 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().parse, dateParse), DontEnum); … … 68 68 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().now, dateNow), DontEnum); 69 69 70 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(7), ReadOnly | DontEnum | DontDelete);70 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(7), ReadOnly | DontEnum | DontDelete); 71 71 } 72 72 -
trunk/Source/JavaScriptCore/runtime/DateInstance.cpp
r77044 r77098 35 35 const ClassInfo DateInstance::info = {"Date", 0, 0, 0}; 36 36 37 DateInstance::DateInstance(ExecState* , NonNullPassRefPtr<Structure> structure)37 DateInstance::DateInstance(ExecState* exec, NonNullPassRefPtr<Structure> structure) 38 38 : JSWrapperObject(structure) 39 39 { 40 setInternalValue( jsNaN());40 setInternalValue(exec->globalData(), jsNaN()); 41 41 } 42 42 43 DateInstance::DateInstance(ExecState* , NonNullPassRefPtr<Structure> structure, double time)43 DateInstance::DateInstance(ExecState* exec, NonNullPassRefPtr<Structure> structure, double time) 44 44 : JSWrapperObject(structure) 45 45 { 46 setInternalValue( jsNumber(timeClip(time)));46 setInternalValue(exec->globalData(), jsNumber(timeClip(time))); 47 47 } 48 48 … … 50 50 : JSWrapperObject(exec->lexicalGlobalObject()->dateStructure()) 51 51 { 52 setInternalValue( jsNumber(timeClip(time)));52 setInternalValue(exec->globalData(), jsNumber(timeClip(time))); 53 53 } 54 54 -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r77044 r77098 846 846 double milli = timeClip(exec->argument(0).toNumber(exec)); 847 847 JSValue result = jsNumber(milli); 848 thisDateObj->setInternalValue( result);848 thisDateObj->setInternalValue(exec->globalData(), result); 849 849 return JSValue::encode(result); 850 850 } … … 861 861 if (!exec->argumentCount() || isnan(milli)) { 862 862 JSValue result = jsNaN(); 863 thisDateObj->setInternalValue( result);863 thisDateObj->setInternalValue(exec->globalData(), result); 864 864 return JSValue::encode(result); 865 865 } … … 878 878 if (!fillStructuresUsingTimeArgs(exec, numArgsToUse, &ms, &gregorianDateTime)) { 879 879 JSValue result = jsNaN(); 880 thisDateObj->setInternalValue( result);880 thisDateObj->setInternalValue(exec->globalData(), result); 881 881 return JSValue::encode(result); 882 882 } 883 883 884 884 JSValue result = jsNumber(gregorianDateTimeToMS(exec, gregorianDateTime, ms, inputIsUTC)); 885 thisDateObj->setInternalValue( result);885 thisDateObj->setInternalValue(exec->globalData(), result); 886 886 return JSValue::encode(result); 887 887 } … … 896 896 if (!exec->argumentCount()) { 897 897 JSValue result = jsNaN(); 898 thisDateObj->setInternalValue( result);898 thisDateObj->setInternalValue(exec->globalData(), result); 899 899 return JSValue::encode(result); 900 900 } … … 918 918 if (!fillStructuresUsingDateArgs(exec, numArgsToUse, &ms, &gregorianDateTime)) { 919 919 JSValue result = jsNaN(); 920 thisDateObj->setInternalValue( result);920 thisDateObj->setInternalValue(exec->globalData(), result); 921 921 return JSValue::encode(result); 922 922 } 923 923 924 924 JSValue result = jsNumber(gregorianDateTimeToMS(exec, gregorianDateTime, ms, inputIsUTC)); 925 thisDateObj->setInternalValue( result);925 thisDateObj->setInternalValue(exec->globalData(), result); 926 926 return JSValue::encode(result); 927 927 } … … 1020 1020 if (!exec->argumentCount()) { 1021 1021 JSValue result = jsNaN(); 1022 thisDateObj->setInternalValue( result);1022 thisDateObj->setInternalValue(exec->globalData(), result); 1023 1023 return JSValue::encode(result); 1024 1024 } … … 1042 1042 if (!isfinite(year)) { 1043 1043 JSValue result = jsNaN(); 1044 thisDateObj->setInternalValue( result);1044 thisDateObj->setInternalValue(exec->globalData(), result); 1045 1045 return JSValue::encode(result); 1046 1046 } … … 1048 1048 gregorianDateTime.year = toInt32((year > 99 || year < 0) ? year - 1900 : year); 1049 1049 JSValue result = jsNumber(gregorianDateTimeToMS(exec, gregorianDateTime, ms, false)); 1050 thisDateObj->setInternalValue( result);1050 thisDateObj->setInternalValue(exec->globalData(), result); 1051 1051 return JSValue::encode(result); 1052 1052 } -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
r77044 r77098 34 34 { 35 35 // ECMA 15.11.3.1 Error.prototype 36 putDirectWithoutTransition(exec-> propertyNames().prototype, errorPrototype, DontEnum | DontDelete | ReadOnly);37 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum);36 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, errorPrototype, DontEnum | DontDelete | ReadOnly); 37 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum); 38 38 } 39 39 -
trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp
r77044 r77098 30 30 , m_appendSourceToMessage(false) 31 31 { 32 putDirect( globalData->propertyNames->message, jsString(globalData, ""));32 putDirect(*globalData, globalData->propertyNames->message, jsString(globalData, "")); 33 33 } 34 34 … … 37 37 , m_appendSourceToMessage(false) 38 38 { 39 putDirect( globalData->propertyNames->message, jsString(globalData, message));39 putDirect(*globalData, globalData->propertyNames->message, jsString(globalData, message)); 40 40 } 41 41 -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
r77044 r77098 42 42 // The constructor will be added later in ErrorConstructor's constructor 43 43 44 putDirectWithoutTransition(exec-> propertyNames().name, jsNontrivialString(exec, "Error"), DontEnum);44 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().name, jsNontrivialString(exec, "Error"), DontEnum); 45 45 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum); 46 46 } -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r77044 r77098 41 41 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, functionPrototype->classInfo()->className)) 42 42 { 43 putDirectWithoutTransition(exec-> propertyNames().prototype, functionPrototype, DontEnum | DontDelete | ReadOnly);43 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, functionPrototype, DontEnum | DontDelete | ReadOnly); 44 44 45 45 // Number of arguments for constructor 46 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);46 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum); 47 47 } 48 48 -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r77044 r77098 42 42 : InternalFunction(&exec->globalData(), globalObject, structure, exec->propertyNames().nullIdentifier) 43 43 { 44 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);44 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum); 45 45 } 46 46 -
trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp
r77044 r77098 34 34 35 35 if (m_getter) 36 markStack.append( m_getter);36 markStack.append(&m_getter); 37 37 if (m_setter) 38 markStack.append( m_setter);38 markStack.append(&m_setter); 39 39 } 40 40 -
trunk/Source/JavaScriptCore/runtime/GetterSetter.h
r77044 r77098 39 39 GetterSetter(ExecState* exec) 40 40 : JSCell(exec->globalData().getterSetterStructure.get()) 41 , m_getter(0)42 , m_setter(0)43 41 { 44 42 } … … 46 44 virtual void markChildren(MarkStack&); 47 45 48 JSObject* getter() const { return m_getter ; }49 void setGetter(JS Object* getter) { m_getter = getter; }50 JSObject* setter() const { return m_setter ; }51 void setSetter(JS Object* setter) { m_setter = setter; }46 JSObject* getter() const { return m_getter.get(); } 47 void setGetter(JSGlobalData& globalData, JSObject* getter) { m_getter.set(globalData, this, getter); } 48 JSObject* setter() const { return m_setter.get(); } 49 void setSetter(JSGlobalData& globalData, JSObject* setter) { m_setter.set(globalData, this, setter); } 52 50 static PassRefPtr<Structure> createStructure(JSValue prototype) 53 51 { … … 57 55 virtual bool isGetterSetter() const; 58 56 59 JSObject*m_getter;60 JSObject*m_setter;57 WriteBarrier<JSObject> m_getter; 58 WriteBarrier<JSObject> m_setter; 61 59 }; 62 60 -
trunk/Source/JavaScriptCore/runtime/GlobalEvalFunction.cpp
r77044 r77098 35 35 GlobalEvalFunction::GlobalEvalFunction(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, int len, const Identifier& name, NativeFunction function, JSGlobalObject* cachedGlobalObject) 36 36 : PrototypeFunction(exec, globalObject, structure, len, name, function) 37 , m_cachedGlobalObject( cachedGlobalObject)37 , m_cachedGlobalObject(exec->globalData(), this, cachedGlobalObject) 38 38 { 39 39 ASSERT_ARG(cachedGlobalObject, cachedGlobalObject); … … 43 43 { 44 44 PrototypeFunction::markChildren(markStack); 45 markStack.append( m_cachedGlobalObject);45 markStack.append(&m_cachedGlobalObject); 46 46 } 47 47 -
trunk/Source/JavaScriptCore/runtime/GlobalEvalFunction.h
r77044 r77098 34 34 public: 35 35 GlobalEvalFunction(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, int len, const Identifier&, NativeFunction, JSGlobalObject* expectedThisObject); 36 JSGlobalObject* cachedGlobalObject() const { return m_cachedGlobalObject ; }36 JSGlobalObject* cachedGlobalObject() const { return m_cachedGlobalObject.get(); } 37 37 38 38 static PassRefPtr<Structure> createStructure(JSValue prototype) … … 47 47 virtual void markChildren(MarkStack&); 48 48 49 JSGlobalObject*m_cachedGlobalObject;49 WriteBarrier<JSGlobalObject> m_cachedGlobalObject; 50 50 }; 51 51 -
trunk/Source/JavaScriptCore/runtime/Heap.cpp
r77094 r77098 180 180 ProtectCountSet::iterator end = m_protectedValues.end(); 181 181 for (ProtectCountSet::iterator it = m_protectedValues.begin(); it != end; ++it) 182 markStack. append(it->first);182 markStack.deprecatedAppend(&it->first); 183 183 } 184 184 … … 205 205 for (Vector<ValueStringPair>::iterator vectorIt = tempSortingVector->begin(); vectorIt != vectorEnd; ++vectorIt) { 206 206 if (vectorIt->first) 207 markStack. append(vectorIt->first);207 markStack.deprecatedAppend(&vectorIt->first); 208 208 } 209 209 } … … 256 256 MarkedArgumentBuffer::markLists(markStack, *m_markListSet); 257 257 if (m_globalData->exception) 258 markStack.append( m_globalData->exception);258 markStack.append(&m_globalData->exception); 259 259 if (m_globalData->firstStringifierToMark) 260 260 JSONObject::markStringifiers(markStack, m_globalData->firstStringifierToMark); -
trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp
r77044 r77098 47 47 : JSObjectWithGlobalObject(globalObject, structure) 48 48 { 49 putDirect( globalData->propertyNames->name, jsString(globalData, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);49 putDirect(*globalData, globalData->propertyNames->name, jsString(globalData, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum); 50 50 } 51 51 -
trunk/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h
r77044 r77098 32 32 friend JSValue jsAPIValueWrapper(ExecState*, JSValue); 33 33 public: 34 JSValue value() const { return m_value ; }34 JSValue value() const { return m_value.get(); } 35 35 36 36 virtual bool isAPIValueWrapper() const { return true; } … … 45 45 JSAPIValueWrapper(ExecState* exec, JSValue value) 46 46 : JSCell(exec->globalData().apiWrapperStructure.get()) 47 , m_value(value)48 47 { 48 m_value.set(exec->globalData(), this, value); 49 49 ASSERT(!value.isCell()); 50 50 } 51 51 52 JSValuem_value;52 WriteBarrier<Unknown> m_value; 53 53 }; 54 54 -
trunk/Source/JavaScriptCore/runtime/JSActivation.cpp
r77044 r77098 62 62 63 63 size_t count = numParametersMinusThis; 64 markStack. appendValues(registerArray, count);64 markStack.deprecatedAppendValues(registerArray, count); 65 65 66 66 size_t numVars = d()->functionExecutable->capturedVariableCount(); 67 67 68 68 // Skip the call frame, which sits between the parameters and vars. 69 markStack. appendValues(registerArray + count + RegisterFile::CallFrameHeaderSize, numVars, MayContainNullValues);69 markStack.deprecatedAppendValues(registerArray + count + RegisterFile::CallFrameHeaderSize, numVars, MayContainNullValues); 70 70 } 71 71 … … 145 145 } 146 146 147 void JSActivation::put(ExecState* , const Identifier& propertyName, JSValue value, PutPropertySlot& slot)147 void JSActivation::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) 148 148 { 149 149 ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this)); … … 156 156 // expose in the activation object. 157 157 ASSERT(!hasGetterSetterProperties()); 158 putDirect( propertyName, value, 0, true, slot);158 putDirect(exec->globalData(), propertyName, value, 0, true, slot); 159 159 } 160 160 -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r77044 r77098 189 189 m_storage->m_length = initialLength; 190 190 m_storage->m_numValuesInVector = 0; 191 JSValue* vector = m_storage->m_vector;191 WriteBarrier<Unknown>* vector = m_storage->m_vector; 192 192 for (size_t i = 0; i < initialCapacity; ++i) 193 vector[i] = JSValue();193 vector[i].clear(); 194 194 } 195 195 … … 199 199 } 200 200 201 JSArray::JSArray( NonNullPassRefPtr<Structure> structure, const ArgList& list)201 JSArray::JSArray(JSGlobalData& globalData, NonNullPassRefPtr<Structure> structure, const ArgList& list) 202 202 : JSObject(structure) 203 203 { … … 226 226 227 227 size_t i = 0; 228 JSValue* vector = m_storage->m_vector;228 WriteBarrier<Unknown>* vector = m_storage->m_vector; 229 229 ArgList::const_iterator end = list.end(); 230 230 for (ArgList::const_iterator it = list.begin(); it != end; ++it, ++i) 231 vector[i] = *it;231 vector[i].set(globalData, this, *it); 232 232 for (; i < initialStorage; i++) 233 vector[i] = JSValue();233 vector[i].clear(); 234 234 235 235 checkConsistency(); … … 258 258 259 259 if (i < m_vectorLength) { 260 JSValue& valueSlot = storage->m_vector[i];260 WriteBarrier<Unknown>& valueSlot = storage->m_vector[i]; 261 261 if (valueSlot) { 262 slot.setValueSlot( &valueSlot);262 slot.setValueSlot(valueSlot.slot()); 263 263 return true; 264 264 } … … 267 267 SparseArrayValueMap::iterator it = map->find(i); 268 268 if (it != map->end()) { 269 slot.setValueSlot( &it->second);269 slot.setValueSlot(it->second.slot()); 270 270 return true; 271 271 } … … 306 306 return false; 307 307 if (i < m_vectorLength) { 308 JSValue& value = storage->m_vector[i];308 WriteBarrier<Unknown>& value = storage->m_vector[i]; 309 309 if (value) { 310 descriptor.setDescriptor(value , 0);310 descriptor.setDescriptor(value.get(), 0); 311 311 return true; 312 312 } … … 315 315 SparseArrayValueMap::iterator it = map->find(i); 316 316 if (it != map->end()) { 317 descriptor.setDescriptor(it->second , 0);317 descriptor.setDescriptor(it->second.get(), 0); 318 318 return true; 319 319 } … … 360 360 361 361 if (i < m_vectorLength) { 362 JSValue& valueSlot = storage->m_vector[i];362 WriteBarrier<Unknown>& valueSlot = storage->m_vector[i]; 363 363 if (valueSlot) { 364 valueSlot = value;364 valueSlot.set(exec->globalData(), this, value); 365 365 checkConsistency(); 366 366 return; 367 367 } 368 valueSlot = value;368 valueSlot.set(exec->globalData(), this, value); 369 369 ++storage->m_numValuesInVector; 370 370 checkConsistency(); … … 396 396 } 397 397 398 pair<SparseArrayValueMap::iterator, bool> result = map->add(i, value); 399 if (!result.second) { // pre-existing entry 400 result.first->second = value; 398 WriteBarrier<Unknown> temp; 399 pair<SparseArrayValueMap::iterator, bool> result = map->add(i, temp); 400 result.first->second.set(exec->globalData(), this, value); 401 if (!result.second) // pre-existing entry 401 402 return; 402 }403 403 404 404 size_t capacity = map->capacity(); … … 416 416 if (increaseVectorLength(i + 1)) { 417 417 storage = m_storage; 418 storage->m_vector[i] = value;418 storage->m_vector[i].set(exec->globalData(), this, value); 419 419 ++storage->m_numValuesInVector; 420 420 checkConsistency(); … … 458 458 459 459 unsigned vectorLength = m_vectorLength; 460 JSValue* vector = storage->m_vector;460 WriteBarrier<Unknown>* vector = storage->m_vector; 461 461 462 462 if (newNumValuesInVector == storage->m_numValuesInVector + 1) { 463 463 for (unsigned j = vectorLength; j < newVectorLength; ++j) 464 vector[j] = JSValue();464 vector[j].clear(); 465 465 if (i > MIN_SPARSE_ARRAY_INDEX) 466 466 map->remove(i); 467 467 } else { 468 468 for (unsigned j = vectorLength; j < max(vectorLength, MIN_SPARSE_ARRAY_INDEX); ++j) 469 vector[j] = JSValue(); 469 vector[j].clear(); 470 JSGlobalData& globalData = exec->globalData(); 470 471 for (unsigned j = max(vectorLength, MIN_SPARSE_ARRAY_INDEX); j < newVectorLength; ++j) 471 vector[j] = map->take(j);472 vector[j].set(globalData, this, map->take(j).get()); 472 473 } 473 474 … … 477 478 storage->m_numValuesInVector = newNumValuesInVector; 478 479 479 storage->m_vector[i] = value;480 storage->m_vector[i].set(exec->globalData(), this, value); 480 481 481 482 checkConsistency(); … … 504 505 505 506 if (i < m_vectorLength) { 506 JSValue& valueSlot = storage->m_vector[i];507 WriteBarrier<Unknown>& valueSlot = storage->m_vector[i]; 507 508 if (!valueSlot) { 508 509 checkConsistency(); 509 510 return false; 510 511 } 511 valueSlot = JSValue();512 valueSlot.clear(); 512 513 --storage->m_numValuesInVector; 513 514 checkConsistency(); … … 606 607 m_storage->m_allocBase = baseStorage; 607 608 608 JSValue* vector = storage->m_vector;609 WriteBarrier<Unknown>* vector = storage->m_vector; 609 610 for (unsigned i = vectorLength; i < newVectorLength; ++i) 610 vector[i] = JSValue();611 vector[i].clear(); 611 612 612 613 m_vectorLength = newVectorLength; … … 667 668 unsigned usedVectorLength = min(length, m_vectorLength); 668 669 for (unsigned i = newLength; i < usedVectorLength; ++i) { 669 JSValue& valueSlot = storage->m_vector[i];670 WriteBarrier<Unknown>& valueSlot = storage->m_vector[i]; 670 671 bool hadValue = valueSlot; 671 valueSlot = JSValue();672 valueSlot.clear(); 672 673 storage->m_numValuesInVector -= hadValue; 673 674 } … … 707 708 708 709 if (length < m_vectorLength) { 709 JSValue& valueSlot = storage->m_vector[length];710 WriteBarrier<Unknown>& valueSlot = storage->m_vector[length]; 710 711 if (valueSlot) { 711 712 --storage->m_numValuesInVector; 712 result = valueSlot ;713 valueSlot = JSValue();713 result = valueSlot.get(); 714 valueSlot.clear(); 714 715 } else 715 716 result = jsUndefined(); … … 719 720 SparseArrayValueMap::iterator it = map->find(length); 720 721 if (it != map->end()) { 721 result = it->second ;722 result = it->second.get(); 722 723 map->remove(it); 723 724 if (map->isEmpty()) { … … 743 744 744 745 if (storage->m_length < m_vectorLength) { 745 storage->m_vector[storage->m_length] = value;746 storage->m_vector[storage->m_length].set(exec->globalData(), this, value); 746 747 ++storage->m_numValuesInVector; 747 748 ++storage->m_length; … … 755 756 if (increaseVectorLength(storage->m_length + 1)) { 756 757 storage = m_storage; 757 storage->m_vector[storage->m_length] = value;758 storage->m_vector[storage->m_length].set(exec->globalData(), this, value); 758 759 ++storage->m_numValuesInVector; 759 760 ++storage->m_length; … … 858 859 } 859 860 860 JSValue* vector = m_storage->m_vector;861 WriteBarrier<Unknown>* vector = m_storage->m_vector; 861 862 for (int i = 0; i < count; i++) 862 vector[i] = JSValue();863 vector[i].clear(); 863 864 } 864 865 … … 942 943 943 944 for (size_t i = 0; i < lengthNotIncludingUndefined; i++) { 944 JSValue value = storage->m_vector[i] ;945 JSValue value = storage->m_vector[i].get(); 945 946 ASSERT(!value.isUndefined()); 946 947 values[i].first = value; … … 975 976 if (storage->m_length < lengthNotIncludingUndefined) 976 977 storage->m_length = lengthNotIncludingUndefined; 977 978 979 JSGlobalData& globalData = exec->globalData(); 978 980 for (size_t i = 0; i < lengthNotIncludingUndefined; i++) 979 storage->m_vector[i] = values[i].first;981 storage->m_vector[i].set(globalData, this, values[i].first); 980 982 981 983 Heap::heap(this)->popTempSortVector(&values); … … 1106 1108 // Iterate over the array, ignoring missing values, counting undefined ones, and inserting all other ones into the tree. 1107 1109 for (; numDefined < usedVectorLength; ++numDefined) { 1108 JSValue v = storage->m_vector[numDefined] ;1110 JSValue v = storage->m_vector[numDefined].get(); 1109 1111 if (!v || v.isUndefined()) 1110 1112 break; … … 1113 1115 } 1114 1116 for (unsigned i = numDefined; i < usedVectorLength; ++i) { 1115 JSValue v = storage->m_vector[i] ;1117 JSValue v = storage->m_vector[i].get(); 1116 1118 if (v) { 1117 1119 if (v.isUndefined()) … … 1141 1143 SparseArrayValueMap::iterator end = map->end(); 1142 1144 for (SparseArrayValueMap::iterator it = map->begin(); it != end; ++it) { 1143 tree.abstractor().m_nodes[numDefined].value = it->second ;1145 tree.abstractor().m_nodes[numDefined].value = it->second.get(); 1144 1146 tree.insert(numDefined); 1145 1147 ++numDefined; … … 1158 1160 AVLTree<AVLTreeAbstractorForArrayCompare, 44>::Iterator iter; 1159 1161 iter.start_iter_least(tree); 1162 JSGlobalData& globalData = exec->globalData(); 1160 1163 for (unsigned i = 0; i < numDefined; ++i) { 1161 storage->m_vector[i] = tree.abstractor().m_nodes[*iter].value;1164 storage->m_vector[i].set(globalData, this, tree.abstractor().m_nodes[*iter].value); 1162 1165 ++iter; 1163 1166 } … … 1165 1168 // Put undefined values back in. 1166 1169 for (unsigned i = numDefined; i < newUsedVectorLength; ++i) 1167 storage->m_vector[i] = jsUndefined();1170 storage->m_vector[i].setUndefined(); 1168 1171 1169 1172 // Ensure that unused values in the vector are zeroed out. 1170 1173 for (unsigned i = newUsedVectorLength; i < usedVectorLength; ++i) 1171 storage->m_vector[i] = JSValue();1174 storage->m_vector[i].clear(); 1172 1175 1173 1176 storage->m_numValuesInVector = newUsedVectorLength; … … 1180 1183 ArrayStorage* storage = m_storage; 1181 1184 1182 JSValue* vector = storage->m_vector;1185 WriteBarrier<Unknown>* vector = storage->m_vector; 1183 1186 unsigned vectorEnd = min(storage->m_length, m_vectorLength); 1184 1187 unsigned i = 0; 1185 1188 for (; i < vectorEnd; ++i) { 1186 JSValue& v = vector[i];1189 WriteBarrier<Unknown>& v = vector[i]; 1187 1190 if (!v) 1188 1191 break; 1189 args.append(v );1192 args.append(v.get()); 1190 1193 } 1191 1194 … … 1198 1201 ASSERT(m_storage->m_length >= maxSize); 1199 1202 UNUSED_PARAM(maxSize); 1200 JSValue* vector = m_storage->m_vector;1203 WriteBarrier<Unknown>* vector = m_storage->m_vector; 1201 1204 unsigned vectorEnd = min(maxSize, m_vectorLength); 1202 1205 unsigned i = 0; 1203 1206 for (; i < vectorEnd; ++i) { 1204 JSValue& v = vector[i];1207 WriteBarrier<Unknown>& v = vector[i]; 1205 1208 if (!v) 1206 1209 break; 1207 buffer[i] = v ;1210 buffer[i] = v.get(); 1208 1211 } 1209 1212 … … 1224 1227 1225 1228 for (; numDefined < usedVectorLength; ++numDefined) { 1226 JSValue v = storage->m_vector[numDefined] ;1229 JSValue v = storage->m_vector[numDefined].get(); 1227 1230 if (!v || v.isUndefined()) 1228 1231 break; 1229 1232 } 1233 1230 1234 for (unsigned i = numDefined; i < usedVectorLength; ++i) { 1231 JSValue v = storage->m_vector[i] ;1235 JSValue v = storage->m_vector[i].get(); 1232 1236 if (v) { 1233 1237 if (v.isUndefined()) 1234 1238 ++numUndefined; 1235 1239 else 1236 storage->m_vector[numDefined++] = v;1240 storage->m_vector[numDefined++].setWithoutWriteBarrier(v); 1237 1241 } 1238 1242 } … … 1253 1257 SparseArrayValueMap::iterator end = map->end(); 1254 1258 for (SparseArrayValueMap::iterator it = map->begin(); it != end; ++it) 1255 storage->m_vector[numDefined++] = it->second;1259 storage->m_vector[numDefined++].setWithoutWriteBarrier(it->second.get()); 1256 1260 1257 1261 delete map; … … 1260 1264 1261 1265 for (unsigned i = numDefined; i < newUsedVectorLength; ++i) 1262 storage->m_vector[i] = jsUndefined();1266 storage->m_vector[i].setUndefined(); 1263 1267 for (unsigned i = newUsedVectorLength; i < usedVectorLength; ++i) 1264 storage->m_vector[i] = JSValue();1268 storage->m_vector[i].clear(); 1265 1269 1266 1270 storage->m_numValuesInVector = newUsedVectorLength; -
trunk/Source/JavaScriptCore/runtime/JSArray.h
r77044 r77098 28 28 namespace JSC { 29 29 30 typedef HashMap<unsigned, JSValue> SparseArrayValueMap;30 typedef HashMap<unsigned, WriteBarrier<Unknown> > SparseArrayValueMap; 31 31 32 32 // This struct holds the actual data values of an array. A JSArray object points to it's contained ArrayStorage … … 45 45 bool m_inCompactInitialization; 46 46 #endif 47 JSValuem_vector[1];47 WriteBarrier<Unknown> m_vector[1]; 48 48 }; 49 49 … … 68 68 explicit JSArray(NonNullPassRefPtr<Structure>); 69 69 JSArray(NonNullPassRefPtr<Structure>, unsigned initialLength, ArrayCreationMode); 70 JSArray( NonNullPassRefPtr<Structure>, const ArgList& initialValues);70 JSArray(JSGlobalData&, NonNullPassRefPtr<Structure>, const ArgList& initialValues); 71 71 virtual ~JSArray(); 72 72 … … 95 95 { 96 96 ASSERT(canGetIndex(i)); 97 return m_storage->m_vector[i] ;97 return m_storage->m_vector[i].get(); 98 98 } 99 99 100 100 bool canSetIndex(unsigned i) { return i < m_vectorLength; } 101 void setIndex( unsigned i, JSValue v)101 void setIndex(JSGlobalData& globalData, unsigned i, JSValue v) 102 102 { 103 103 ASSERT(canSetIndex(i)); 104 104 105 JSValue& x = m_storage->m_vector[i];105 WriteBarrier<Unknown>& x = m_storage->m_vector[i]; 106 106 if (!x) { 107 107 ArrayStorage *storage = m_storage; … … 110 110 storage->m_length = i + 1; 111 111 } 112 x = v;113 } 114 115 void uncheckedSetIndex( unsigned i, JSValue v)112 x.set(globalData, this, v); 113 } 114 115 void uncheckedSetIndex(JSGlobalData& globalData, unsigned i, JSValue v) 116 116 { 117 117 ASSERT(canSetIndex(i)); … … 120 120 ASSERT(storage->m_inCompactInitialization); 121 121 #endif 122 storage->m_vector[i] = v;122 storage->m_vector[i].set(globalData, this, v); 123 123 } 124 124 … … 195 195 SparseArrayValueMap::iterator end = map->end(); 196 196 for (SparseArrayValueMap::iterator it = map->begin(); it != end; ++it) 197 markStack.append( it->second);197 markStack.append(&it->second); 198 198 } 199 199 } -
trunk/Source/JavaScriptCore/runtime/JSByteArray.cpp
r77044 r77098 41 41 , m_classInfo(classInfo) 42 42 { 43 putDirect(exec->globalData() .propertyNames->length, jsNumber(m_storage->length()), ReadOnly | DontDelete);43 putDirect(exec->globalData(), exec->globalData().propertyNames->length, jsNumber(m_storage->length()), ReadOnly | DontDelete); 44 44 } 45 45 -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r77044 r77098 337 337 return isCell() ? asCell()->toThisObject(exec) : toThisObjectSlowCase(exec); 338 338 } 339 340 ALWAYS_INLINE void MarkStack::append(JSCell* cell) 339 340 template <typename T> void MarkStack::append(DeprecatedPtr<T>* slot) 341 { 342 internalAppend(slot->get()); 343 } 344 345 template <typename T> void MarkStack::append(WriteBarrierBase<T>* slot) 346 { 347 internalAppend(slot->get()); 348 } 349 350 ALWAYS_INLINE void MarkStack::internalAppend(JSCell* cell) 341 351 { 342 352 ASSERT(!m_isCheckingForDefaultMarkViolation); … … 348 358 } 349 359 350 ALWAYS_INLINE void MarkStack::append(JSValue value) 360 ALWAYS_INLINE void MarkStack::deprecatedAppend(JSCell** value) 361 { 362 ASSERT(value); 363 internalAppend(*value); 364 } 365 366 ALWAYS_INLINE void MarkStack::deprecatedAppend(JSValue* value) 367 { 368 ASSERT(value); 369 internalAppend(*value); 370 } 371 372 ALWAYS_INLINE void MarkStack::deprecatedAppend(Register* value) 373 { 374 ASSERT(value); 375 internalAppend(value->jsValue()); 376 } 377 378 ALWAYS_INLINE void MarkStack::internalAppend(JSValue value) 351 379 { 352 380 ASSERT(value); 353 381 if (value.isCell()) 354 append(value.asCell());382 internalAppend(value.asCell()); 355 383 } 356 384 -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r77044 r77098 72 72 , m_scopeChain(globalObject->globalScopeChain()) 73 73 { 74 putDirect(exec->globalData() .propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);75 putDirect(exec-> propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);74 putDirect(exec->globalData(), exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum); 75 putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum); 76 76 } 77 77 #endif … … 84 84 , m_scopeChain(globalObject->globalScopeChain()) 85 85 { 86 putDirect(exec->globalData() .propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);87 #if ENABLE(JIT) 88 putDirect(exec-> propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);86 putDirect(exec->globalData(), exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum); 87 #if ENABLE(JIT) 88 putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum); 89 89 #else 90 90 UNUSED_PARAM(length); … … 100 100 { 101 101 const Identifier& name = static_cast<FunctionExecutable*>(m_executable.get())->name(); 102 putDirect(exec->globalData() .propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);102 putDirect(exec->globalData(), exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum); 103 103 } 104 104 … … 208 208 if (!location) { 209 209 JSObject* prototype = new (exec) JSObject(scope().globalObject()->emptyObjectStructure()); 210 prototype->putDirect(exec-> propertyNames().constructor, this, DontEnum);211 putDirect(exec-> propertyNames().prototype, prototype, DontDelete | DontEnum);210 prototype->putDirect(exec->globalData(), exec->propertyNames().constructor, this, DontEnum); 211 putDirect(exec->globalData(), exec->propertyNames().prototype, prototype, DontDelete | DontEnum); 212 212 location = getDirectLocation(propertyName); 213 213 } -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r77044 r77098 204 204 Heap heap; 205 205 206 JSValueexception;206 DeprecatedPtr<Unknown> exception; 207 207 #if ENABLE(JIT) 208 208 ReturnAddressPtr exceptionLocation; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r77044 r77098 81 81 static const int preferredScriptCheckTimeInterval = 1000; 82 82 83 static inline void markIfNeeded(MarkStack& markStack, JSValuev)84 { 85 if ( v)83 template <typename T> static inline void markIfNeeded(MarkStack& markStack, WriteBarrier<T>* v) 84 { 85 if (*v) 86 86 markStack.append(v); 87 87 } … … 89 89 static inline void markIfNeeded(MarkStack& markStack, const RefPtr<Structure>& s) 90 90 { 91 if (s )92 mark IfNeeded(markStack, s->storedPrototype());91 if (s && s->storedPrototype()) 92 markStack.append(s->storedPrototypeSlot()); 93 93 } 94 94 … … 203 203 // Prototypes 204 204 205 d()->functionPrototype = new (exec) FunctionPrototype(exec, this, FunctionPrototype::createStructure(jsNull())); // The real prototype will be set once ObjectPrototype is created.206 d()->prototypeFunctionStructure = PrototypeFunction::createStructure(d()->functionPrototype );207 d()->internalFunctionStructure = InternalFunction::createStructure(d()->functionPrototype );205 d()->functionPrototype.set(exec->globalData(), this, new (exec) FunctionPrototype(exec, this, FunctionPrototype::createStructure(jsNull()))); // The real prototype will be set once ObjectPrototype is created. 206 d()->prototypeFunctionStructure = PrototypeFunction::createStructure(d()->functionPrototype.get()); 207 d()->internalFunctionStructure = InternalFunction::createStructure(d()->functionPrototype.get()); 208 208 NativeFunctionWrapper* callFunction = 0; 209 209 NativeFunctionWrapper* applyFunction = 0; 210 210 d()->functionPrototype->addFunctionProperties(exec, this, d()->prototypeFunctionStructure.get(), &callFunction, &applyFunction); 211 d()->callFunction = callFunction;212 d()->applyFunction = applyFunction;213 d()->objectPrototype = new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(jsNull()), d()->prototypeFunctionStructure.get());214 d()->functionPrototype->structure()->setPrototypeWithoutTransition(d()->objectPrototype );211 d()->callFunction.set(exec->globalData(), this, callFunction); 212 d()->applyFunction.set(exec->globalData(), this, applyFunction); 213 d()->objectPrototype.set(exec->globalData(), this, new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(jsNull()), d()->prototypeFunctionStructure.get())); 214 d()->functionPrototype->structure()->setPrototypeWithoutTransition(d()->objectPrototype.get()); 215 215 216 216 d()->emptyObjectStructure = d()->objectPrototype->inheritorID(); 217 217 218 d()->functionStructure = JSFunction::createStructure(d()->functionPrototype );219 d()->callbackFunctionStructure = JSCallbackFunction::createStructure(d()->functionPrototype );220 d()->argumentsStructure = Arguments::createStructure(d()->objectPrototype );221 d()->callbackConstructorStructure = JSCallbackConstructor::createStructure(d()->objectPrototype );222 d()->callbackObjectStructure = JSCallbackObject<JSObjectWithGlobalObject>::createStructure(d()->objectPrototype );223 224 d()->arrayPrototype = new (exec) ArrayPrototype(this, ArrayPrototype::createStructure(d()->objectPrototype));225 d()->arrayStructure = JSArray::createStructure(d()->arrayPrototype );226 d()->regExpMatchesArrayStructure = RegExpMatchesArray::createStructure(d()->arrayPrototype );227 228 d()->stringPrototype = new (exec) StringPrototype(exec, this, StringPrototype::createStructure(d()->objectPrototype));229 d()->stringObjectStructure = StringObject::createStructure(d()->stringPrototype );230 231 d()->booleanPrototype = new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());232 d()->booleanObjectStructure = BooleanObject::createStructure(d()->booleanPrototype );233 234 d()->numberPrototype = new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());235 d()->numberObjectStructure = NumberObject::createStructure(d()->numberPrototype );236 237 d()->datePrototype = new (exec) DatePrototype(exec, this, DatePrototype::createStructure(d()->objectPrototype));238 d()->dateStructure = DateInstance::createStructure(d()->datePrototype );239 240 d()->regExpPrototype = new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());241 d()->regExpStructure = RegExpObject::createStructure(d()->regExpPrototype );242 243 d()->methodCallDummy = constructEmptyObject(exec);244 245 ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(d()->objectPrototype ), d()->prototypeFunctionStructure.get());218 d()->functionStructure = JSFunction::createStructure(d()->functionPrototype.get()); 219 d()->callbackFunctionStructure = JSCallbackFunction::createStructure(d()->functionPrototype.get()); 220 d()->argumentsStructure = Arguments::createStructure(d()->objectPrototype.get()); 221 d()->callbackConstructorStructure = JSCallbackConstructor::createStructure(d()->objectPrototype.get()); 222 d()->callbackObjectStructure = JSCallbackObject<JSObjectWithGlobalObject>::createStructure(d()->objectPrototype.get()); 223 224 d()->arrayPrototype.set(exec->globalData(), this, new (exec) ArrayPrototype(this, ArrayPrototype::createStructure(d()->objectPrototype.get()))); 225 d()->arrayStructure = JSArray::createStructure(d()->arrayPrototype.get()); 226 d()->regExpMatchesArrayStructure = RegExpMatchesArray::createStructure(d()->arrayPrototype.get()); 227 228 d()->stringPrototype.set(exec->globalData(), this, new (exec) StringPrototype(exec, this, StringPrototype::createStructure(d()->objectPrototype.get()))); 229 d()->stringObjectStructure = StringObject::createStructure(d()->stringPrototype.get()); 230 231 d()->booleanPrototype.set(exec->globalData(), this, new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(d()->objectPrototype.get()), d()->prototypeFunctionStructure.get())); 232 d()->booleanObjectStructure = BooleanObject::createStructure(d()->booleanPrototype.get()); 233 234 d()->numberPrototype.set(exec->globalData(), this, new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(d()->objectPrototype.get()), d()->prototypeFunctionStructure.get())); 235 d()->numberObjectStructure = NumberObject::createStructure(d()->numberPrototype.get()); 236 237 d()->datePrototype.set(exec->globalData(), this, new (exec) DatePrototype(exec, this, DatePrototype::createStructure(d()->objectPrototype.get()))); 238 d()->dateStructure = DateInstance::createStructure(d()->datePrototype.get()); 239 240 d()->regExpPrototype.set(exec->globalData(), this, new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(d()->objectPrototype.get()), d()->prototypeFunctionStructure.get())); 241 d()->regExpStructure = RegExpObject::createStructure(d()->regExpPrototype.get()); 242 243 d()->methodCallDummy.set(exec->globalData(), this, constructEmptyObject(exec)); 244 245 ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(d()->objectPrototype.get()), d()->prototypeFunctionStructure.get()); 246 246 d()->errorStructure = ErrorInstance::createStructure(errorPrototype); 247 247 248 248 // Constructors 249 249 250 JSCell* objectConstructor = new (exec) ObjectConstructor(exec, this, ObjectConstructor::createStructure(d()->functionPrototype ), d()->objectPrototype, d()->prototypeFunctionStructure.get());251 JSCell* functionConstructor = new (exec) FunctionConstructor(exec, this, FunctionConstructor::createStructure(d()->functionPrototype ), d()->functionPrototype);252 JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, this, ArrayConstructor::createStructure(d()->functionPrototype ), d()->arrayPrototype, d()->prototypeFunctionStructure.get());253 JSCell* stringConstructor = new (exec) StringConstructor(exec, this, StringConstructor::createStructure(d()->functionPrototype ), d()->prototypeFunctionStructure.get(), d()->stringPrototype);254 JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, this, BooleanConstructor::createStructure(d()->functionPrototype ), d()->booleanPrototype);255 JSCell* numberConstructor = new (exec) NumberConstructor(exec, this, NumberConstructor::createStructure(d()->functionPrototype ), d()->numberPrototype);256 JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(d()->functionPrototype ), d()->prototypeFunctionStructure.get(), d()->datePrototype);257 258 d()->regExpConstructor = new (exec) RegExpConstructor(exec, this, RegExpConstructor::createStructure(d()->functionPrototype), d()->regExpPrototype);259 260 d()->errorConstructor = new (exec) ErrorConstructor(exec, this, ErrorConstructor::createStructure(d()->functionPrototype), errorPrototype);250 JSCell* objectConstructor = new (exec) ObjectConstructor(exec, this, ObjectConstructor::createStructure(d()->functionPrototype.get()), d()->objectPrototype.get(), d()->prototypeFunctionStructure.get()); 251 JSCell* functionConstructor = new (exec) FunctionConstructor(exec, this, FunctionConstructor::createStructure(d()->functionPrototype.get()), d()->functionPrototype.get()); 252 JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, this, ArrayConstructor::createStructure(d()->functionPrototype.get()), d()->arrayPrototype.get(), d()->prototypeFunctionStructure.get()); 253 JSCell* stringConstructor = new (exec) StringConstructor(exec, this, StringConstructor::createStructure(d()->functionPrototype.get()), d()->prototypeFunctionStructure.get(), d()->stringPrototype.get()); 254 JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, this, BooleanConstructor::createStructure(d()->functionPrototype.get()), d()->booleanPrototype.get()); 255 JSCell* numberConstructor = new (exec) NumberConstructor(exec, this, NumberConstructor::createStructure(d()->functionPrototype.get()), d()->numberPrototype.get()); 256 JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(d()->functionPrototype.get()), d()->prototypeFunctionStructure.get(), d()->datePrototype.get()); 257 258 d()->regExpConstructor.set(exec->globalData(), this, new (exec) RegExpConstructor(exec, this, RegExpConstructor::createStructure(d()->functionPrototype.get()), d()->regExpPrototype.get())); 259 260 d()->errorConstructor.set(exec->globalData(), this, new (exec) ErrorConstructor(exec, this, ErrorConstructor::createStructure(d()->functionPrototype.get()), errorPrototype)); 261 261 262 262 RefPtr<Structure> nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(errorPrototype); 263 RefPtr<Structure> nativeErrorStructure = NativeErrorConstructor::createStructure(d()->functionPrototype );264 d()->evalErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "EvalError");265 d()->rangeErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "RangeError");266 d()->referenceErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "ReferenceError");267 d()->syntaxErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "SyntaxError");268 d()->typeErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "TypeError");269 d()->URIErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "URIError");270 271 d()->objectPrototype->putDirectFunctionWithoutTransition(exec-> propertyNames().constructor, objectConstructor, DontEnum);272 d()->functionPrototype->putDirectFunctionWithoutTransition(exec-> propertyNames().constructor, functionConstructor, DontEnum);273 d()->arrayPrototype->putDirectFunctionWithoutTransition(exec-> propertyNames().constructor, arrayConstructor, DontEnum);274 d()->booleanPrototype->putDirectFunctionWithoutTransition(exec-> propertyNames().constructor, booleanConstructor, DontEnum);275 d()->stringPrototype->putDirectFunctionWithoutTransition(exec-> propertyNames().constructor, stringConstructor, DontEnum);276 d()->numberPrototype->putDirectFunctionWithoutTransition(exec-> propertyNames().constructor, numberConstructor, DontEnum);277 d()->datePrototype->putDirectFunctionWithoutTransition(exec-> propertyNames().constructor, dateConstructor, DontEnum);278 d()->regExpPrototype->putDirectFunctionWithoutTransition(exec-> propertyNames().constructor, d()->regExpConstructor, DontEnum);279 errorPrototype->putDirectFunctionWithoutTransition(exec-> propertyNames().constructor, d()->errorConstructor, DontEnum);263 RefPtr<Structure> nativeErrorStructure = NativeErrorConstructor::createStructure(d()->functionPrototype.get()); 264 d()->evalErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "EvalError")); 265 d()->rangeErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "RangeError")); 266 d()->referenceErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "ReferenceError")); 267 d()->syntaxErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "SyntaxError")); 268 d()->typeErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "TypeError")); 269 d()->URIErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "URIError")); 270 271 d()->objectPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, objectConstructor, DontEnum); 272 d()->functionPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, functionConstructor, DontEnum); 273 d()->arrayPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, arrayConstructor, DontEnum); 274 d()->booleanPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, booleanConstructor, DontEnum); 275 d()->stringPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, stringConstructor, DontEnum); 276 d()->numberPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, numberConstructor, DontEnum); 277 d()->datePrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, dateConstructor, DontEnum); 278 d()->regExpPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, d()->regExpConstructor.get(), DontEnum); 279 errorPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, d()->errorConstructor.get(), DontEnum); 280 280 281 281 // Set global constructors … … 283 283 // FIXME: These properties could be handled by a static hash table. 284 284 285 putDirectFunctionWithoutTransition( Identifier(exec, "Object"), objectConstructor, DontEnum);286 putDirectFunctionWithoutTransition( Identifier(exec, "Function"), functionConstructor, DontEnum);287 putDirectFunctionWithoutTransition( Identifier(exec, "Array"), arrayConstructor, DontEnum);288 putDirectFunctionWithoutTransition( Identifier(exec, "Boolean"), booleanConstructor, DontEnum);289 putDirectFunctionWithoutTransition( Identifier(exec, "String"), stringConstructor, DontEnum);290 putDirectFunctionWithoutTransition( Identifier(exec, "Number"), numberConstructor, DontEnum);291 putDirectFunctionWithoutTransition( Identifier(exec, "Date"), dateConstructor, DontEnum);292 putDirectFunctionWithoutTransition( Identifier(exec, "RegExp"), d()->regExpConstructor, DontEnum);293 putDirectFunctionWithoutTransition( Identifier(exec, "Error"), d()->errorConstructor, DontEnum);294 putDirectFunctionWithoutTransition( Identifier(exec, "EvalError"), d()->evalErrorConstructor, DontEnum);295 putDirectFunctionWithoutTransition( Identifier(exec, "RangeError"), d()->rangeErrorConstructor, DontEnum);296 putDirectFunctionWithoutTransition( Identifier(exec, "ReferenceError"), d()->referenceErrorConstructor, DontEnum);297 putDirectFunctionWithoutTransition( Identifier(exec, "SyntaxError"), d()->syntaxErrorConstructor, DontEnum);298 putDirectFunctionWithoutTransition( Identifier(exec, "TypeError"), d()->typeErrorConstructor, DontEnum);299 putDirectFunctionWithoutTransition( Identifier(exec, "URIError"), d()->URIErrorConstructor, DontEnum);285 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Object"), objectConstructor, DontEnum); 286 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Function"), functionConstructor, DontEnum); 287 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Array"), arrayConstructor, DontEnum); 288 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Boolean"), booleanConstructor, DontEnum); 289 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "String"), stringConstructor, DontEnum); 290 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Number"), numberConstructor, DontEnum); 291 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Date"), dateConstructor, DontEnum); 292 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "RegExp"), d()->regExpConstructor.get(), DontEnum); 293 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Error"), d()->errorConstructor.get(), DontEnum); 294 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "EvalError"), d()->evalErrorConstructor.get(), DontEnum); 295 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "RangeError"), d()->rangeErrorConstructor.get(), DontEnum); 296 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "ReferenceError"), d()->referenceErrorConstructor.get(), DontEnum); 297 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "SyntaxError"), d()->syntaxErrorConstructor.get(), DontEnum); 298 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "TypeError"), d()->typeErrorConstructor.get(), DontEnum); 299 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "URIError"), d()->URIErrorConstructor.get(), DontEnum); 300 300 301 301 // Set global values. 302 302 GlobalPropertyInfo staticGlobals[] = { 303 GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(d()->objectPrototype )), DontEnum | DontDelete),303 GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(d()->objectPrototype.get())), DontEnum | DontDelete), 304 304 GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(), DontEnum | DontDelete | ReadOnly), 305 305 GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(Inf), DontEnum | DontDelete | ReadOnly), 306 306 GlobalPropertyInfo(Identifier(exec, "undefined"), jsUndefined(), DontEnum | DontDelete | ReadOnly), 307 GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(d()->objectPrototype )), DontEnum | DontDelete)307 GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(d()->objectPrototype.get())), DontEnum | DontDelete) 308 308 }; 309 309 … … 312 312 // Set global functions. 313 313 314 d()->evalFunction = new (exec) GlobalEvalFunction(exec, this, GlobalEvalFunction::createStructure(d()->functionPrototype), 1, exec->propertyNames().eval, globalFuncEval, this);315 putDirectFunctionWithoutTransition(exec, d()->evalFunction , DontEnum);314 d()->evalFunction.set(exec->globalData(), this, new (exec) GlobalEvalFunction(exec, this, GlobalEvalFunction::createStructure(d()->functionPrototype.get()), 1, exec->propertyNames().eval, globalFuncEval, this)); 315 putDirectFunctionWithoutTransition(exec, d()->evalFunction.get(), DontEnum); 316 316 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 2, Identifier(exec, "parseInt"), globalFuncParseInt), DontEnum); 317 317 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "parseFloat"), globalFuncParseFloat), DontEnum); … … 337 337 338 338 JSObject* oldLastInPrototypeChain = lastInPrototypeChain(this); 339 JSObject* objectPrototype = d()->objectPrototype ;339 JSObject* objectPrototype = d()->objectPrototype.get(); 340 340 if (oldLastInPrototypeChain != objectPrototype) 341 341 oldLastInPrototypeChain->setPrototype(objectPrototype); … … 350 350 (*it)->markAggregate(markStack); 351 351 352 markIfNeeded(markStack, d()->regExpConstructor);353 markIfNeeded(markStack, d()->errorConstructor);354 markIfNeeded(markStack, d()->evalErrorConstructor);355 markIfNeeded(markStack, d()->rangeErrorConstructor);356 markIfNeeded(markStack, d()->referenceErrorConstructor);357 markIfNeeded(markStack, d()->syntaxErrorConstructor);358 markIfNeeded(markStack, d()->typeErrorConstructor);359 markIfNeeded(markStack, d()->URIErrorConstructor);360 361 markIfNeeded(markStack, d()->evalFunction);362 markIfNeeded(markStack, d()->callFunction);363 markIfNeeded(markStack, d()->applyFunction);364 365 markIfNeeded(markStack, d()->objectPrototype);366 markIfNeeded(markStack, d()->functionPrototype);367 markIfNeeded(markStack, d()->arrayPrototype);368 markIfNeeded(markStack, d()->booleanPrototype);369 markIfNeeded(markStack, d()->stringPrototype);370 markIfNeeded(markStack, d()->numberPrototype);371 markIfNeeded(markStack, d()->datePrototype);372 markIfNeeded(markStack, d()->regExpPrototype);373 374 markIfNeeded(markStack, d()->methodCallDummy);352 markIfNeeded(markStack, &d()->regExpConstructor); 353 markIfNeeded(markStack, &d()->errorConstructor); 354 markIfNeeded(markStack, &d()->evalErrorConstructor); 355 markIfNeeded(markStack, &d()->rangeErrorConstructor); 356 markIfNeeded(markStack, &d()->referenceErrorConstructor); 357 markIfNeeded(markStack, &d()->syntaxErrorConstructor); 358 markIfNeeded(markStack, &d()->typeErrorConstructor); 359 markIfNeeded(markStack, &d()->URIErrorConstructor); 360 361 markIfNeeded(markStack, &d()->evalFunction); 362 markIfNeeded(markStack, &d()->callFunction); 363 markIfNeeded(markStack, &d()->applyFunction); 364 365 markIfNeeded(markStack, &d()->objectPrototype); 366 markIfNeeded(markStack, &d()->functionPrototype); 367 markIfNeeded(markStack, &d()->arrayPrototype); 368 markIfNeeded(markStack, &d()->booleanPrototype); 369 markIfNeeded(markStack, &d()->stringPrototype); 370 markIfNeeded(markStack, &d()->numberPrototype); 371 markIfNeeded(markStack, &d()->datePrototype); 372 markIfNeeded(markStack, &d()->regExpPrototype); 373 374 markIfNeeded(markStack, &d()->methodCallDummy); 375 375 376 376 markIfNeeded(markStack, d()->errorStructure); … … 397 397 // Outside the execution of global code, when our variables are torn off, 398 398 // we can mark the torn-off array. 399 markStack. appendValues(d()->registerArray.get(), d()->registerArraySize);399 markStack.deprecatedAppendValues(d()->registerArray.get(), d()->registerArraySize); 400 400 } else if (d()->registers) { 401 401 // During execution of global code, when our variables are in the register file, 402 402 // the symbol table tells us how many variables there are, and registers 403 403 // points to where they end, and the registers used for execution begin. 404 markStack. appendValues(d()->registers - symbolTable().size(), symbolTable().size());404 markStack.deprecatedAppendValues(d()->registers - symbolTable().size(), symbolTable().size()); 405 405 } 406 406 } -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r77044 r77098 74 74 , registerArraySize(0) 75 75 , globalScopeChain(NoScopeChain()) 76 , regExpConstructor(0)77 , errorConstructor(0)78 , evalErrorConstructor(0)79 , rangeErrorConstructor(0)80 , referenceErrorConstructor(0)81 , syntaxErrorConstructor(0)82 , typeErrorConstructor(0)83 , URIErrorConstructor(0)84 , evalFunction(0)85 , callFunction(0)86 , applyFunction(0)87 , objectPrototype(0)88 , functionPrototype(0)89 , arrayPrototype(0)90 , booleanPrototype(0)91 , stringPrototype(0)92 , numberPrototype(0)93 , datePrototype(0)94 , regExpPrototype(0)95 , methodCallDummy(0)96 76 , weakRandom(static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0))) 97 77 { … … 110 90 Register globalCallFrame[RegisterFile::CallFrameHeaderSize]; 111 91 112 RegExpConstructor*regExpConstructor;113 ErrorConstructor*errorConstructor;114 NativeErrorConstructor*evalErrorConstructor;115 NativeErrorConstructor*rangeErrorConstructor;116 NativeErrorConstructor*referenceErrorConstructor;117 NativeErrorConstructor*syntaxErrorConstructor;118 NativeErrorConstructor*typeErrorConstructor;119 NativeErrorConstructor*URIErrorConstructor;120 121 GlobalEvalFunction*evalFunction;122 NativeFunctionWrapper*callFunction;123 NativeFunctionWrapper*applyFunction;124 125 ObjectPrototype*objectPrototype;126 FunctionPrototype*functionPrototype;127 ArrayPrototype*arrayPrototype;128 BooleanPrototype*booleanPrototype;129 StringPrototype*stringPrototype;130 NumberPrototype*numberPrototype;131 DatePrototype*datePrototype;132 RegExpPrototype*regExpPrototype;133 134 JSObject*methodCallDummy;92 WriteBarrier<RegExpConstructor> regExpConstructor; 93 WriteBarrier<ErrorConstructor> errorConstructor; 94 WriteBarrier<NativeErrorConstructor> evalErrorConstructor; 95 WriteBarrier<NativeErrorConstructor> rangeErrorConstructor; 96 WriteBarrier<NativeErrorConstructor> referenceErrorConstructor; 97 WriteBarrier<NativeErrorConstructor> syntaxErrorConstructor; 98 WriteBarrier<NativeErrorConstructor> typeErrorConstructor; 99 WriteBarrier<NativeErrorConstructor> URIErrorConstructor; 100 101 WriteBarrier<GlobalEvalFunction> evalFunction; 102 WriteBarrier<NativeFunctionWrapper> callFunction; 103 WriteBarrier<NativeFunctionWrapper> applyFunction; 104 105 WriteBarrier<ObjectPrototype> objectPrototype; 106 WriteBarrier<FunctionPrototype> functionPrototype; 107 WriteBarrier<ArrayPrototype> arrayPrototype; 108 WriteBarrier<BooleanPrototype> booleanPrototype; 109 WriteBarrier<StringPrototype> stringPrototype; 110 WriteBarrier<NumberPrototype> numberPrototype; 111 WriteBarrier<DatePrototype> datePrototype; 112 WriteBarrier<RegExpPrototype> regExpPrototype; 113 114 WriteBarrier<JSObject> methodCallDummy; 135 115 136 116 RefPtr<Structure> argumentsStructure; … … 210 190 // replaces the global object's associated property. 211 191 212 RegExpConstructor* regExpConstructor() const { return d()->regExpConstructor ; }213 214 ErrorConstructor* errorConstructor() const { return d()->errorConstructor ; }215 NativeErrorConstructor* evalErrorConstructor() const { return d()->evalErrorConstructor ; }216 NativeErrorConstructor* rangeErrorConstructor() const { return d()->rangeErrorConstructor ; }217 NativeErrorConstructor* referenceErrorConstructor() const { return d()->referenceErrorConstructor ; }218 NativeErrorConstructor* syntaxErrorConstructor() const { return d()->syntaxErrorConstructor ; }219 NativeErrorConstructor* typeErrorConstructor() const { return d()->typeErrorConstructor ; }220 NativeErrorConstructor* URIErrorConstructor() const { return d()->URIErrorConstructor ; }221 222 GlobalEvalFunction* evalFunction() const { return d()->evalFunction ; }223 224 ObjectPrototype* objectPrototype() const { return d()->objectPrototype ; }225 FunctionPrototype* functionPrototype() const { return d()->functionPrototype ; }226 ArrayPrototype* arrayPrototype() const { return d()->arrayPrototype ; }227 BooleanPrototype* booleanPrototype() const { return d()->booleanPrototype ; }228 StringPrototype* stringPrototype() const { return d()->stringPrototype ; }229 NumberPrototype* numberPrototype() const { return d()->numberPrototype ; }230 DatePrototype* datePrototype() const { return d()->datePrototype ; }231 RegExpPrototype* regExpPrototype() const { return d()->regExpPrototype ; }232 233 JSObject* methodCallDummy() const { return d()->methodCallDummy ; }192 RegExpConstructor* regExpConstructor() const { return d()->regExpConstructor.get(); } 193 194 ErrorConstructor* errorConstructor() const { return d()->errorConstructor.get(); } 195 NativeErrorConstructor* evalErrorConstructor() const { return d()->evalErrorConstructor.get(); } 196 NativeErrorConstructor* rangeErrorConstructor() const { return d()->rangeErrorConstructor.get(); } 197 NativeErrorConstructor* referenceErrorConstructor() const { return d()->referenceErrorConstructor.get(); } 198 NativeErrorConstructor* syntaxErrorConstructor() const { return d()->syntaxErrorConstructor.get(); } 199 NativeErrorConstructor* typeErrorConstructor() const { return d()->typeErrorConstructor.get(); } 200 NativeErrorConstructor* URIErrorConstructor() const { return d()->URIErrorConstructor.get(); } 201 202 GlobalEvalFunction* evalFunction() const { return d()->evalFunction.get(); } 203 204 ObjectPrototype* objectPrototype() const { return d()->objectPrototype.get(); } 205 FunctionPrototype* functionPrototype() const { return d()->functionPrototype.get(); } 206 ArrayPrototype* arrayPrototype() const { return d()->arrayPrototype.get(); } 207 BooleanPrototype* booleanPrototype() const { return d()->booleanPrototype.get(); } 208 StringPrototype* stringPrototype() const { return d()->stringPrototype.get(); } 209 NumberPrototype* numberPrototype() const { return d()->numberPrototype.get(); } 210 DatePrototype* datePrototype() const { return d()->datePrototype.get(); } 211 RegExpPrototype* regExpPrototype() const { return d()->regExpPrototype.get(); } 212 213 JSObject* methodCallDummy() const { return d()->methodCallDummy.get(); } 234 214 235 215 Structure* argumentsStructure() const { return d()->argumentsStructure.get(); } … … 386 366 { 387 367 if (typeInfo().type() == ObjectType) 388 return m_prototype ;368 return m_prototype.get(); 389 369 390 370 ASSERT(typeInfo().type() == StringType); … … 458 438 MarkedArgumentBuffer values; 459 439 values.append(singleItemValue); 460 return new (exec) JSArray(exec-> lexicalGlobalObject()->arrayStructure(), values);440 return new (exec) JSArray(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure(), values); 461 441 } 462 442 463 443 inline JSArray* constructArray(ExecState* exec, const ArgList& values) 464 444 { 465 return new (exec) JSArray(exec-> lexicalGlobalObject()->arrayStructure(), values);445 return new (exec) JSArray(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure(), values); 466 446 } 467 447 -
trunk/Source/JavaScriptCore/runtime/JSONObject.cpp
r77044 r77098 85 85 Holder(JSObject*); 86 86 87 JSObject* object() const { return m_object; } 87 JSObject* object() const { return m_object.get(); } 88 DeprecatedPtr<JSObject>* objectSlot() { return &m_object; } 88 89 89 90 bool appendNextProperty(Stringifier&, UStringBuilder&); 90 91 91 92 private: 92 JSObject* constm_object;93 DeprecatedPtr<JSObject> m_object; 93 94 const bool m_isArray; 94 95 bool m_isJSArray; … … 259 260 size_t size = m_holderStack.size(); 260 261 for (size_t i = 0; i < size; ++i) 261 markStack.append(m_holderStack[i].object ());262 markStack.append(m_holderStack[i].objectSlot()); 262 263 } 263 264 } … … 270 271 271 272 PropertyNameForFunctionCall emptyPropertyName(m_exec->globalData().propertyNames->emptyIdentifier); 272 object->putDirect(m_exec->globalData() .propertyNames->emptyIdentifier, value);273 object->putDirect(m_exec->globalData(), m_exec->globalData().propertyNames->emptyIdentifier, value); 273 274 274 275 UStringBuilder result; … … 500 501 if (!m_index) { 501 502 if (m_isArray) { 502 m_isJSArray = isJSArray(&exec->globalData(), m_object );503 m_isJSArray = isJSArray(&exec->globalData(), m_object.get()); 503 504 m_size = m_object->get(exec, exec->globalData().propertyNames->length).toUInt32(exec); 504 505 builder.append('['); … … 533 534 // Get the value. 534 535 JSValue value; 535 if (m_isJSArray && asArray(m_object )->canGetIndex(index))536 value = asArray(m_object )->getIndex(index);536 if (m_isJSArray && asArray(m_object.get())->canGetIndex(index)) 537 value = asArray(m_object.get())->getIndex(index); 537 538 else { 538 PropertySlot slot(m_object );539 PropertySlot slot(m_object.get()); 539 540 if (!m_object->getOwnPropertySlot(exec, index, slot)) 540 541 slot.setUndefined(); … … 550 551 551 552 // Append the stringified value. 552 stringifyResult = stringifier.appendStringifiedValue(builder, value, m_object , index);553 stringifyResult = stringifier.appendStringifiedValue(builder, value, m_object.get(), index); 553 554 } else { 554 555 // Get the value. 555 PropertySlot slot(m_object );556 PropertySlot slot(m_object.get()); 556 557 Identifier& propertyName = m_propertyNames->propertyNameVector()[index]; 557 558 if (!m_object->getOwnPropertySlot(exec, propertyName, slot)) … … 575 576 576 577 // Append the stringified value. 577 stringifyResult = stringifier.appendStringifiedValue(builder, value, m_object , propertyName);578 stringifyResult = stringifier.appendStringifiedValue(builder, value, m_object.get(), propertyName); 578 579 } 579 580 … … 642 643 JSValue args[] = { property, unfiltered }; 643 644 ArgList argList(args, 2); 644 return call(m_exec, m_function , m_callType, m_callData, thisObj, argList);645 return call(m_exec, m_function.get(), m_callType, m_callData, thisObj, argList); 645 646 } 646 647 … … 648 649 649 650 ExecState* m_exec; 650 JSObject*m_function;651 DeprecatedPtr<JSObject> m_function; 651 652 CallType m_callType; 652 653 CallData m_callData; … … 727 728 else { 728 729 if (isJSArray(&m_exec->globalData(), array) && array->canSetIndex(indexStack.last())) 729 array->setIndex( indexStack.last(), filteredValue);730 array->setIndex(m_exec->globalData(), indexStack.last(), filteredValue); 730 731 else 731 732 array->put(m_exec, indexStack.last(), filteredValue); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r77044 r77098 313 313 if (object && object.isGetterSetter()) { 314 314 ASSERT(m_structure->hasGetterSetterProperties()); 315 asGetterSetter(object)->setGetter( getterFunction);315 asGetterSetter(object)->setGetter(exec->globalData(), getterFunction); 316 316 return; 317 317 } … … 332 332 333 333 m_structure->setHasGetterSetterProperties(true); 334 getterSetter->setGetter( getterFunction);334 getterSetter->setGetter(exec->globalData(), getterFunction); 335 335 } 336 336 … … 340 340 if (object && object.isGetterSetter()) { 341 341 ASSERT(m_structure->hasGetterSetterProperties()); 342 asGetterSetter(object)->setSetter( setterFunction);342 asGetterSetter(object)->setSetter(exec->globalData(), setterFunction); 343 343 return; 344 344 } … … 359 359 360 360 m_structure->setHasGetterSetterProperties(true); 361 getterSetter->setSetter( setterFunction);361 getterSetter->setSetter(exec->globalData(), setterFunction); 362 362 } 363 363 … … 513 513 offset = m_structure->removePropertyWithoutTransition(propertyName); 514 514 if (offset != WTF::notFound) 515 put DirectOffset(offset, jsUndefined());515 putUndefinedAtDirectOffset(offset); 516 516 return; 517 517 } … … 520 520 setStructure(structure.release()); 521 521 if (offset != WTF::notFound) 522 put DirectOffset(offset, jsUndefined());522 putUndefinedAtDirectOffset(offset); 523 523 } 524 524 525 525 void JSObject::putDirectFunction(ExecState* exec, InternalFunction* function, unsigned attr) 526 526 { 527 putDirectFunction( Identifier(exec, function->name(exec)), function, attr);527 putDirectFunction(exec->globalData(), Identifier(exec, function->name(exec)), function, attr); 528 528 } 529 529 530 530 void JSObject::putDirectFunction(ExecState* exec, JSFunction* function, unsigned attr) 531 531 { 532 putDirectFunction( Identifier(exec, function->name(exec)), function, attr);532 putDirectFunction(exec->globalData(), Identifier(exec, function->name(exec)), function, attr); 533 533 } 534 534 535 535 void JSObject::putDirectFunctionWithoutTransition(ExecState* exec, InternalFunction* function, unsigned attr) 536 536 { 537 putDirectFunctionWithoutTransition( Identifier(exec, function->name(exec)), function, attr);537 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, function->name(exec)), function, attr); 538 538 } 539 539 540 540 void JSObject::putDirectFunctionWithoutTransition(ExecState* exec, JSFunction* function, unsigned attr) 541 541 { 542 putDirectFunctionWithoutTransition( Identifier(exec, function->name(exec)), function, attr);542 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, function->name(exec)), function, attr); 543 543 } 544 544 … … 596 596 if (oldDescriptor.getter()) { 597 597 attributes |= Getter; 598 accessor->setGetter( asObject(oldDescriptor.getter()));598 accessor->setGetter(exec->globalData(), asObject(oldDescriptor.getter())); 599 599 } 600 600 if (oldDescriptor.setter()) { 601 601 attributes |= Setter; 602 accessor->setSetter( asObject(oldDescriptor.setter()));602 accessor->setSetter(exec->globalData(), asObject(oldDescriptor.setter())); 603 603 } 604 604 target->putWithAttributes(exec, propertyName, accessor, attributes); … … 721 721 if (current.attributesEqual(descriptor)) { 722 722 if (descriptor.setter()) 723 getterSetter->setSetter( asObject(descriptor.setter()));723 getterSetter->setSetter(exec->globalData(), asObject(descriptor.setter())); 724 724 if (descriptor.getter()) 725 getterSetter->setGetter( asObject(descriptor.getter()));725 getterSetter->setGetter(exec->globalData(), asObject(descriptor.getter())); 726 726 return true; 727 727 } … … 732 732 if (descriptor.getter()) 733 733 attrs |= Getter; 734 putDirect( propertyName, getterSetter, attrs);734 putDirect(exec->globalData(), propertyName, getterSetter, attrs); 735 735 return true; 736 736 } -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r77044 r77098 71 71 }; 72 72 73 typedef EncodedJSValue* PropertyStorage;74 typedef const EncodedJSValue* ConstPropertyStorage;73 typedef WriteBarrierBase<Unknown>* PropertyStorage; 74 typedef const WriteBarrierBase<Unknown>* ConstPropertyStorage; 75 75 76 76 class JSObject : public JSCell { … … 180 180 bool hasGetterSetterProperties() { return m_structure->hasGetterSetterProperties(); } 181 181 182 bool putDirect( const Identifier& propertyName, JSValue value, unsigned attr, bool checkReadOnly, PutPropertySlot& slot);183 void putDirect( const Identifier& propertyName, JSValue value, unsigned attr = 0);184 bool putDirect( const Identifier& propertyName, JSValue value, PutPropertySlot&);185 186 void putDirectFunction( const Identifier& propertyName, JSCell* value, unsigned attr = 0);187 void putDirectFunction( const Identifier& propertyName, JSCell* value, unsigned attr, bool checkReadOnly, PutPropertySlot& slot);182 bool putDirect(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attr, bool checkReadOnly, PutPropertySlot&); 183 void putDirect(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attr = 0); 184 bool putDirect(JSGlobalData&, const Identifier& propertyName, JSValue, PutPropertySlot&); 185 186 void putDirectFunction(JSGlobalData&, const Identifier& propertyName, JSCell*, unsigned attr = 0); 187 void putDirectFunction(JSGlobalData&, const Identifier& propertyName, JSCell*, unsigned attr, bool checkReadOnly, PutPropertySlot&); 188 188 void putDirectFunction(ExecState* exec, InternalFunction* function, unsigned attr = 0); 189 189 void putDirectFunction(ExecState* exec, JSFunction* function, unsigned attr = 0); 190 190 191 void putDirectWithoutTransition( const Identifier& propertyName, JSValue value, unsigned attr = 0);192 void putDirectFunctionWithoutTransition( const Identifier& propertyName, JSCell* value, unsigned attr = 0);191 void putDirectWithoutTransition(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attr = 0); 192 void putDirectFunctionWithoutTransition(JSGlobalData&, const Identifier& propertyName, JSCell* value, unsigned attr = 0); 193 193 void putDirectFunctionWithoutTransition(ExecState* exec, InternalFunction* function, unsigned attr = 0); 194 194 void putDirectFunctionWithoutTransition(ExecState* exec, JSFunction* function, unsigned attr = 0); 195 195 196 196 // Fast access to known property offsets. 197 JSValue getDirectOffset(size_t offset) const { return JSValue::decode(propertyStorage()[offset]); } 198 void putDirectOffset(size_t offset, JSValue value) { propertyStorage()[offset] = JSValue::encode(value); } 197 JSValue getDirectOffset(size_t offset) const { return propertyStorage()[offset].get(); } 198 void putDirectOffset(JSGlobalData& globalData, size_t offset, JSValue value) { propertyStorage()[offset].set(globalData, this, value); } 199 void putUndefinedAtDirectOffset(size_t offset) { propertyStorage()[offset].setUndefined(); } 199 200 200 201 void fillGetterPropertySlot(PropertySlot&, JSValue* location); … … 226 227 } 227 228 228 void flattenDictionaryObject( )229 { 230 m_structure->flattenDictionaryStructure( this);229 void flattenDictionaryObject(JSGlobalData& globalData) 230 { 231 m_structure->flattenDictionaryStructure(globalData, this); 231 232 } 232 233 … … 268 269 } 269 270 270 bool putDirectInternal( const Identifier& propertyName, JSValue value, unsigned attr, bool checkReadOnly, PutPropertySlot& slot, JSCell*);271 bool putDirectInternal(JSGlobalData&, const Identifier& propertyName, JSValue value, unsigned attr, bool checkReadOnly, PutPropertySlot& slot);271 bool putDirectInternal(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attr, bool checkReadOnly, PutPropertySlot&, JSCell*); 272 bool putDirectInternal(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attr, bool checkReadOnly, PutPropertySlot&); 272 273 void putDirectInternal(JSGlobalData&, const Identifier& propertyName, JSValue value, unsigned attr = 0); 273 274 … … 279 280 union { 280 281 PropertyStorage m_externalStorage; 281 EncodedJSValuem_inlineStorage[inlineStorageCapacity];282 WriteBarrierBase<Unknown> m_inlineStorage[inlineStorageCapacity]; 282 283 }; 283 284 … … 451 452 } 452 453 453 inline bool JSObject::putDirectInternal( const Identifier& propertyName, JSValue value, unsigned attributes, bool checkReadOnly, PutPropertySlot& slot, JSCell* specificFunction)454 inline bool JSObject::putDirectInternal(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, unsigned attributes, bool checkReadOnly, PutPropertySlot& slot, JSCell* specificFunction) 454 455 { 455 456 ASSERT(value); … … 468 469 return false; 469 470 470 putDirectOffset( offset, value);471 putDirectOffset(globalData, offset, value); 471 472 // At this point, the objects structure only has a specific value set if previously there 472 473 // had been one set, and if the new value being specified is the same (otherwise we would … … 486 487 487 488 ASSERT(offset < m_structure->propertyStorageCapacity()); 488 putDirectOffset( offset, value);489 putDirectOffset(globalData, offset, value); 489 490 // See comment on setNewProperty call below. 490 491 if (!specificFunction) … … 501 502 ASSERT(offset < structure->propertyStorageCapacity()); 502 503 setStructure(structure.release()); 503 putDirectOffset( offset, value);504 putDirectOffset(globalData, offset, value); 504 505 // This is a new property; transitions with specific values are not currently cachable, 505 506 // so leave the slot in an uncachable state. … … 528 529 // case (1) Do the put, then return leaving the slot uncachable. 529 530 if (specificFunction == currentSpecificFunction) { 530 putDirectOffset( offset, value);531 putDirectOffset(globalData, offset, value); 531 532 return true; 532 533 } … … 537 538 // case (3) set the slot, do the put, return. 538 539 slot.setExistingProperty(this, offset); 539 putDirectOffset( offset, value);540 putDirectOffset(globalData, offset, value); 540 541 return true; 541 542 } … … 558 559 ASSERT(offset < structure->propertyStorageCapacity()); 559 560 setStructure(structure.release()); 560 putDirectOffset( offset, value);561 putDirectOffset(globalData, offset, value); 561 562 // This is a new property; transitions with specific values are not currently cachable, 562 563 // so leave the slot in an uncachable state. … … 571 572 ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this)); 572 573 573 return putDirectInternal( propertyName, value, attributes, checkReadOnly, slot, getJSFunction(globalData, value));574 return putDirectInternal(globalData, propertyName, value, attributes, checkReadOnly, slot, getJSFunction(globalData, value)); 574 575 } 575 576 … … 577 578 { 578 579 PutPropertySlot slot; 579 putDirectInternal( propertyName, value, attributes, false, slot, getJSFunction(globalData, value));580 } 581 582 inline bool JSObject::putDirect( const Identifier& propertyName, JSValue value, unsigned attributes, bool checkReadOnly, PutPropertySlot& slot)580 putDirectInternal(globalData, propertyName, value, attributes, false, slot, getJSFunction(globalData, value)); 581 } 582 583 inline bool JSObject::putDirect(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, unsigned attributes, bool checkReadOnly, PutPropertySlot& slot) 583 584 { 584 585 ASSERT(value); 585 586 ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this)); 586 587 587 return putDirectInternal( propertyName, value, attributes, checkReadOnly, slot, 0);588 } 589 590 inline void JSObject::putDirect( const Identifier& propertyName, JSValue value, unsigned attributes)588 return putDirectInternal(globalData, propertyName, value, attributes, checkReadOnly, slot, 0); 589 } 590 591 inline void JSObject::putDirect(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, unsigned attributes) 591 592 { 592 593 PutPropertySlot slot; 593 putDirectInternal( propertyName, value, attributes, false, slot, 0);594 } 595 596 inline bool JSObject::putDirect( const Identifier& propertyName, JSValue value, PutPropertySlot& slot)597 { 598 return putDirectInternal( propertyName, value, 0, false, slot, 0);599 } 600 601 inline void JSObject::putDirectFunction( const Identifier& propertyName, JSCell* value, unsigned attributes, bool checkReadOnly, PutPropertySlot& slot)602 { 603 putDirectInternal( propertyName, value, attributes, checkReadOnly, slot, value);604 } 605 606 inline void JSObject::putDirectFunction( const Identifier& propertyName, JSCell* value, unsigned attr)594 putDirectInternal(globalData, propertyName, value, attributes, false, slot, 0); 595 } 596 597 inline bool JSObject::putDirect(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) 598 { 599 return putDirectInternal(globalData, propertyName, value, 0, false, slot, 0); 600 } 601 602 inline void JSObject::putDirectFunction(JSGlobalData& globalData, const Identifier& propertyName, JSCell* value, unsigned attributes, bool checkReadOnly, PutPropertySlot& slot) 603 { 604 putDirectInternal(globalData, propertyName, value, attributes, checkReadOnly, slot, value); 605 } 606 607 inline void JSObject::putDirectFunction(JSGlobalData& globalData, const Identifier& propertyName, JSCell* value, unsigned attr) 607 608 { 608 609 PutPropertySlot slot; 609 putDirectInternal( propertyName, value, attr, false, slot, value);610 } 611 612 inline void JSObject::putDirectWithoutTransition( const Identifier& propertyName, JSValue value, unsigned attributes)610 putDirectInternal(globalData, propertyName, value, attr, false, slot, value); 611 } 612 613 inline void JSObject::putDirectWithoutTransition(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, unsigned attributes) 613 614 { 614 615 size_t currentCapacity = m_structure->propertyStorageCapacity(); … … 616 617 if (currentCapacity != m_structure->propertyStorageCapacity()) 617 618 allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity()); 618 putDirectOffset( offset, value);619 } 620 621 inline void JSObject::putDirectFunctionWithoutTransition( const Identifier& propertyName, JSCell* value, unsigned attributes)619 putDirectOffset(globalData, offset, value); 620 } 621 622 inline void JSObject::putDirectFunctionWithoutTransition(JSGlobalData& globalData, const Identifier& propertyName, JSCell* value, unsigned attributes) 622 623 { 623 624 size_t currentCapacity = m_structure->propertyStorageCapacity(); … … 625 626 if (currentCapacity != m_structure->propertyStorageCapacity()) 626 627 allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity()); 627 putDirectOffset( offset, value);628 putDirectOffset(globalData, offset, value); 628 629 } 629 630 … … 704 705 { 705 706 ASSERT(isCell() && isObject()); 706 if (!asObject(asCell())->putDirect( propertyName, value, slot) && slot.isStrictMode())707 if (!asObject(asCell())->putDirect(exec->globalData(), propertyName, value, slot) && slot.isStrictMode()) 707 708 throwTypeError(exec, StrictModeReadonlyPropertyWriteError); 708 709 } … … 726 727 727 728 PropertyStorage oldPropertyStorage = (wasInline ? m_inlineStorage : m_externalStorage); 728 PropertyStorage newPropertyStorage = new EncodedJSValue[newSize];729 PropertyStorage newPropertyStorage = new WriteBarrierBase<Unknown>[newSize]; 729 730 730 731 for (unsigned i = 0; i < oldSize; ++i) … … 741 742 JSCell::markChildren(markStack); 742 743 743 markStack.append(prototype()); 744 744 markStack.append(m_structure->storedPrototypeSlot()); 745 745 PropertyStorage storage = propertyStorage(); 746 746 size_t storageSize = m_structure->propertyStorageSize(); 747 markStack.appendValues( reinterpret_cast<JSValue*>(storage), storageSize);747 markStack.appendValues(storage, storageSize); 748 748 } 749 749 -
trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
r77044 r77098 41 41 , m_numCacheableSlots(numCacheableSlots) 42 42 , m_jsStringsSize(propertyNameArrayData->propertyNameVector().size()) 43 , m_jsStrings(new JSValue[m_jsStringsSize])43 , m_jsStrings(new WriteBarrier<Unknown>[m_jsStringsSize]) 44 44 { 45 45 PropertyNameArrayData::PropertyNameVector& propertyNameVector = propertyNameArrayData->propertyNameVector(); 46 46 for (size_t i = 0; i < m_jsStringsSize; ++i) 47 m_jsStrings[i] = jsOwnedString(exec, propertyNameVector[i].ustring());47 m_jsStrings[i].set(exec->globalData(), this, jsOwnedString(exec, propertyNameVector[i].ustring())); 48 48 } 49 49 … … 92 92 JSValue JSPropertyNameIterator::get(ExecState* exec, JSObject* base, size_t i) 93 93 { 94 JSValue & identifier = m_jsStrings[i];94 JSValue identifier = m_jsStrings[i].get(); 95 95 if (m_cachedStructure == base->structure() && m_cachedPrototypeChain == base->structure()->prototypeChain(exec)) 96 96 return identifier; -
trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.h
r77044 r77098 86 86 uint32_t m_numCacheableSlots; 87 87 uint32_t m_jsStringsSize; 88 OwnArrayPtr< JSValue> m_jsStrings;88 OwnArrayPtr<WriteBarrier<Unknown> > m_jsStrings; 89 89 }; 90 90 -
trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp
r77044 r77098 35 35 { 36 36 JSVariableObject::markChildren(markStack); 37 markStack. append(d()->registerStore.jsValue());37 markStack.deprecatedAppend(&d()->registerStore); 38 38 } 39 39 -
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r77044 r77098 256 256 inline StringObject* StringObject::create(ExecState* exec, JSString* string) 257 257 { 258 return new (exec) StringObject(exec-> lexicalGlobalObject()->stringObjectStructure(), string);258 return new (exec) StringObject(exec->globalData(), exec->lexicalGlobalObject()->stringObjectStructure(), string); 259 259 } 260 260 -
trunk/Source/JavaScriptCore/runtime/JSValue.h
r77044 r77098 48 48 struct Instruction; 49 49 50 template <class T> class DeprecatedPtr; 51 template <class T> class WriteBarrierBase; 52 50 53 enum PreferredPrimitiveType { NoPreference, PreferNumber, PreferString }; 51 54 … … 213 216 214 217 private: 218 template <class T> JSValue(DeprecatedPtr<T>); 219 template <class T> JSValue(WriteBarrierBase<T>); 220 215 221 enum HashTableDeletedValueTag { HashTableDeletedValue }; 216 222 JSValue(HashTableDeletedValueTag); -
trunk/Source/JavaScriptCore/runtime/JSWrapperObject.cpp
r77044 r77098 31 31 JSObject::markChildren(markStack); 32 32 if (m_internalValue) 33 markStack.append( m_internalValue);33 markStack.append(&m_internalValue); 34 34 } 35 35 -
trunk/Source/JavaScriptCore/runtime/JSWrapperObject.h
r77044 r77098 34 34 35 35 public: 36 JSValue internalValue() const { return m_internalValue ; }37 void setInternalValue(JS Value);36 JSValue internalValue() const { return m_internalValue.get(); } 37 void setInternalValue(JSGlobalData&, JSValue); 38 38 39 39 static PassRefPtr<Structure> createStructure(JSValue prototype) … … 48 48 virtual void markChildren(MarkStack&); 49 49 50 JSValuem_internalValue;50 WriteBarrier<Unknown> m_internalValue; 51 51 }; 52 52 … … 57 57 } 58 58 59 inline void JSWrapperObject::setInternalValue(JS Value value)59 inline void JSWrapperObject::setInternalValue(JSGlobalData& globalData, JSValue value) 60 60 { 61 61 ASSERT(value); 62 62 ASSERT(!value.isObject()); 63 m_internalValue = value;63 m_internalValue.set(globalData, this, value); 64 64 putAnonymousValue(0, value); 65 65 } -
trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp
r77044 r77098 374 374 case DoParseObjectEndExpression: 375 375 { 376 asObject(objectStack.last())->putDirect( identifierStack.last(), lastValue);376 asObject(objectStack.last())->putDirect(m_exec->globalData(), identifierStack.last(), lastValue); 377 377 identifierStack.removeLast(); 378 378 if (m_lexer.currentToken().type == TokComma) -
trunk/Source/JavaScriptCore/runtime/Lookup.cpp
r77044 r77098 87 87 function = new (exec) NativeFunctionWrapper(exec, globalObject, globalObject->prototypeFunctionStructure(), entry->functionLength(), propertyName, entry->function()); 88 88 89 thisObj->putDirectFunction( propertyName, function, entry->attributes());89 thisObj->putDirectFunction(exec->globalData(), propertyName, function, entry->attributes()); 90 90 location = thisObj->getDirectLocation(propertyName); 91 91 } -
trunk/Source/JavaScriptCore/runtime/Lookup.h
r77044 r77098 313 313 if (entry->attributes() & Function) { // function: put as override property 314 314 if (LIKELY(value.isCell())) 315 thisObj->putDirectFunction( propertyName, value.asCell());315 thisObj->putDirectFunction(exec->globalData(), propertyName, value.asCell()); 316 316 else 317 thisObj->putDirect( propertyName, value);317 thisObj->putDirect(exec->globalData(), propertyName, value); 318 318 } else if (!(entry->attributes() & ReadOnly)) 319 319 entry->propertyPutter()(exec, thisObj, value); -
trunk/Source/JavaScriptCore/runtime/MarkStack.h
r77044 r77098 28 28 29 29 #include "JSValue.h" 30 #include "WriteBarrier.h" 30 31 #include <wtf/Vector.h> 31 32 #include <wtf/Noncopyable.h> … … 50 51 { 51 52 } 52 53 ALWAYS_INLINE void append(JSValue);54 void append(JSCell*);55 53 56 ALWAYS_INLINE void appendValues(Register* values, size_t count, MarkSetProperties properties = NoNullValues) 57 { 58 appendValues(reinterpret_cast<JSValue*>(values), count, properties); 59 } 60 61 ALWAYS_INLINE void appendValues(JSValue* values, size_t count, MarkSetProperties properties = NoNullValues) 62 { 54 void deprecatedAppend(JSValue*); 55 void deprecatedAppend(JSCell**); 56 void deprecatedAppend(Register*); 57 template <typename T> void append(WriteBarrierBase<T>*); 58 template <typename T> void append(DeprecatedPtr<T>*); 59 60 ALWAYS_INLINE void deprecatedAppendValues(Register* registers, size_t count, MarkSetProperties properties = NoNullValues) 61 { 62 JSValue* values = reinterpret_cast<JSValue*>(registers); 63 63 if (count) 64 64 m_markSets.append(MarkSet(values, values + count, properties)); 65 65 } 66 66 67 void appendValues(WriteBarrierBase<Unknown>* barriers, size_t count, MarkSetProperties properties = NoNullValues) 68 { 69 JSValue* values = barriers->slot(); 70 if (count) 71 m_markSets.append(MarkSet(values, values + count, properties)); 72 } 73 67 74 inline void drain(); 68 75 void compact(); … … 75 82 76 83 private: 84 void internalAppend(JSCell*); 85 void internalAppend(JSValue); 77 86 void markChildren(JSCell*); 78 87 -
trunk/Source/JavaScriptCore/runtime/MathObject.cpp
r77044 r77098 90 90 : JSObjectWithGlobalObject(globalObject, structure) 91 91 { 92 putDirectWithoutTransition( Identifier(exec, "E"), jsNumber(exp(1.0)), DontDelete | DontEnum | ReadOnly);93 putDirectWithoutTransition( Identifier(exec, "LN2"), jsNumber(log(2.0)), DontDelete | DontEnum | ReadOnly);94 putDirectWithoutTransition( Identifier(exec, "LN10"), jsNumber(log(10.0)), DontDelete | DontEnum | ReadOnly);95 putDirectWithoutTransition( Identifier(exec, "LOG2E"), jsNumber(1.0 / log(2.0)), DontDelete | DontEnum | ReadOnly);96 putDirectWithoutTransition( Identifier(exec, "LOG10E"), jsNumber(1.0 / log(10.0)), DontDelete | DontEnum | ReadOnly);97 putDirectWithoutTransition( Identifier(exec, "PI"), jsNumber(piDouble), DontDelete | DontEnum | ReadOnly);98 putDirectWithoutTransition( Identifier(exec, "SQRT1_2"), jsNumber(sqrt(0.5)), DontDelete | DontEnum | ReadOnly);99 putDirectWithoutTransition( Identifier(exec, "SQRT2"), jsNumber(sqrt(2.0)), DontDelete | DontEnum | ReadOnly);92 putDirectWithoutTransition(exec->globalData(), Identifier(exec, "E"), jsNumber(exp(1.0)), DontDelete | DontEnum | ReadOnly); 93 putDirectWithoutTransition(exec->globalData(), Identifier(exec, "LN2"), jsNumber(log(2.0)), DontDelete | DontEnum | ReadOnly); 94 putDirectWithoutTransition(exec->globalData(), Identifier(exec, "LN10"), jsNumber(log(10.0)), DontDelete | DontEnum | ReadOnly); 95 putDirectWithoutTransition(exec->globalData(), Identifier(exec, "LOG2E"), jsNumber(1.0 / log(2.0)), DontDelete | DontEnum | ReadOnly); 96 putDirectWithoutTransition(exec->globalData(), Identifier(exec, "LOG10E"), jsNumber(1.0 / log(10.0)), DontDelete | DontEnum | ReadOnly); 97 putDirectWithoutTransition(exec->globalData(), Identifier(exec, "PI"), jsNumber(piDouble), DontDelete | DontEnum | ReadOnly); 98 putDirectWithoutTransition(exec->globalData(), Identifier(exec, "SQRT1_2"), jsNumber(sqrt(0.5)), DontDelete | DontEnum | ReadOnly); 99 putDirectWithoutTransition(exec->globalData(), Identifier(exec, "SQRT2"), jsNumber(sqrt(2.0)), DontDelete | DontEnum | ReadOnly); 100 100 } 101 101 -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
r77044 r77098 38 38 NativeErrorPrototype* prototype = new (exec) NativeErrorPrototype(exec, globalObject, prototypeStructure, nameAndMessage, this); 39 39 40 putDirect(exec-> propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.541 putDirect(exec-> propertyNames().prototype, prototype, DontDelete | ReadOnly | DontEnum);40 putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5 41 putDirect(exec->globalData(), exec->propertyNames().prototype, prototype, DontDelete | ReadOnly | DontEnum); 42 42 m_errorStructure = ErrorInstance::createStructure(prototype); 43 43 } -
trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
r77044 r77098 35 35 : JSObjectWithGlobalObject(globalObject, structure) 36 36 { 37 putDirect(exec-> propertyNames().name, jsString(exec, nameAndMessage), 0);38 putDirect(exec-> propertyNames().message, jsString(exec, nameAndMessage), 0);39 putDirect(exec-> propertyNames().constructor, constructor, DontEnum);37 putDirect(exec->globalData(), exec->propertyNames().name, jsString(exec, nameAndMessage), 0); 38 putDirect(exec->globalData(), exec->propertyNames().message, jsString(exec, nameAndMessage), 0); 39 putDirect(exec->globalData(), exec->propertyNames().constructor, constructor, DontEnum); 40 40 } 41 41 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r77044 r77098 59 59 { 60 60 // Number.Prototype 61 putDirectWithoutTransition(exec-> propertyNames().prototype, numberPrototype, DontEnum | DontDelete | ReadOnly);61 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, numberPrototype, DontEnum | DontDelete | ReadOnly); 62 62 63 63 // no. of arguments for constructor 64 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);64 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 65 65 } 66 66 … … 105 105 NumberObject* object = new (exec) NumberObject(exec->lexicalGlobalObject()->numberObjectStructure()); 106 106 double n = exec->argumentCount() ? exec->argument(0).toNumber(exec) : 0; 107 object->setInternalValue( jsNumber(n));107 object->setInternalValue(exec->globalData(), jsNumber(n)); 108 108 return JSValue::encode(object); 109 109 } -
trunk/Source/JavaScriptCore/runtime/NumberObject.cpp
r77044 r77098 45 45 { 46 46 NumberObject* object = new (exec) NumberObject(exec->lexicalGlobalObject()->numberObjectStructure()); 47 object->setInternalValue( number);47 object->setInternalValue(exec->globalData(), number); 48 48 return object; 49 49 } -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r77044 r77098 50 50 : NumberObject(structure) 51 51 { 52 setInternalValue( jsNumber(0));52 setInternalValue(exec->globalData(), jsNumber(0)); 53 53 54 54 // The constructor will be added later, after NumberConstructor has been constructed -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r77044 r77098 48 48 { 49 49 // ECMA 15.2.3.1 50 putDirectWithoutTransition(exec-> propertyNames().prototype, objectPrototype, DontEnum | DontDelete | ReadOnly);50 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, objectPrototype, DontEnum | DontDelete | ReadOnly); 51 51 52 52 // no. of arguments for constructor 53 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);53 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 54 54 55 55 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().getPrototypeOf, objectConstructorGetPrototypeOf), DontEnum); … … 118 118 JSObject* description = constructEmptyObject(exec); 119 119 if (!descriptor.isAccessorDescriptor()) { 120 description->putDirect(exec-> propertyNames().value, descriptor.value() ? descriptor.value() : jsUndefined(), 0);121 description->putDirect(exec-> propertyNames().writable, jsBoolean(descriptor.writable()), 0);120 description->putDirect(exec->globalData(), exec->propertyNames().value, descriptor.value() ? descriptor.value() : jsUndefined(), 0); 121 description->putDirect(exec->globalData(), exec->propertyNames().writable, jsBoolean(descriptor.writable()), 0); 122 122 } else { 123 description->putDirect(exec-> propertyNames().get, descriptor.getter() ? descriptor.getter() : jsUndefined(), 0);124 description->putDirect(exec-> propertyNames().set, descriptor.setter() ? descriptor.setter() : jsUndefined(), 0);123 description->putDirect(exec->globalData(), exec->propertyNames().get, descriptor.getter() ? descriptor.getter() : jsUndefined(), 0); 124 description->putDirect(exec->globalData(), exec->propertyNames().set, descriptor.setter() ? descriptor.setter() : jsUndefined(), 0); 125 125 } 126 126 127 description->putDirect(exec-> propertyNames().enumerable, jsBoolean(descriptor.enumerable()), 0);128 description->putDirect(exec-> propertyNames().configurable, jsBoolean(descriptor.configurable()), 0);127 description->putDirect(exec->globalData(), exec->propertyNames().enumerable, jsBoolean(descriptor.enumerable()), 0); 128 description->putDirect(exec->globalData(), exec->propertyNames().configurable, jsBoolean(descriptor.configurable()), 0); 129 129 130 130 return JSValue::encode(description); -
trunk/Source/JavaScriptCore/runtime/Operations.h
r77044 r77098 430 430 // should not be treated as a dictionary. 431 431 if (cell->structure()->isDictionary()) { 432 asObject(cell)->flattenDictionaryObject( );432 asObject(cell)->flattenDictionaryObject(callFrame->globalData()); 433 433 if (slotBase == cell) 434 434 slotOffset = cell->structure()->get(propertyName); … … 455 455 // should not be treated as a dictionary. 456 456 if (base->structure()->isDictionary()) 457 asObject(base)->flattenDictionaryObject( );457 asObject(base)->flattenDictionaryObject(callFrame->globalData()); 458 458 459 459 ++count; … … 472 472 JSObject* base; 473 473 while (true) { 474 base = *iter;474 base = iter->get(); 475 475 if (next == end) 476 476 return isStrictPut ? JSValue() : base; -
trunk/Source/JavaScriptCore/runtime/PrototypeFunction.cpp
r77044 r77098 38 38 { 39 39 ASSERT_ARG(function, function); 40 putDirect(exec-> propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);40 putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum); 41 41 } 42 42 … … 46 46 { 47 47 ASSERT_ARG(function, function); 48 putDirect(exec-> propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);48 putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum); 49 49 } 50 50 -
trunk/Source/JavaScriptCore/runtime/PutPropertySlot.h
r77044 r77098 46 46 } 47 47 48 void setExistingProperty( JSObject*base, size_t offset)48 void setExistingProperty(DeprecatedPtr<JSObject> base, size_t offset) 49 49 { 50 50 m_type = ExistingProperty; … … 53 53 } 54 54 55 void setNewProperty( JSObject*base, size_t offset)55 void setNewProperty(DeprecatedPtr<JSObject> base, size_t offset) 56 56 { 57 57 m_type = NewProperty; … … 61 61 62 62 Type type() const { return m_type; } 63 JSObject* base() const { return m_base ; }63 JSObject* base() const { return m_base.get(); } 64 64 65 65 bool isStrictMode() const { return m_isStrictMode; } … … 71 71 private: 72 72 Type m_type; 73 JSObject*m_base;73 DeprecatedPtr<JSObject> m_base; 74 74 size_t m_offset; 75 75 bool m_isStrictMode; -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r77044 r77098 101 101 { 102 102 // ECMA 15.10.5.1 RegExp.prototype 103 putDirectWithoutTransition(exec-> propertyNames().prototype, regExpPrototype, DontEnum | DontDelete | ReadOnly);103 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, regExpPrototype, DontEnum | DontDelete | ReadOnly); 104 104 105 105 // no. of arguments for constructor 106 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(2), ReadOnly | DontDelete | DontEnum);106 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(2), ReadOnly | DontDelete | DontEnum); 107 107 } 108 108 -
trunk/Source/JavaScriptCore/runtime/ScopeChain.cpp
r77044 r77098 36 36 ScopeChainIterator scopeEnd = end(); 37 37 for (ScopeChainIterator scopeIter = begin(); scopeIter != scopeEnd; ++scopeIter) { 38 JSObject*o = *scopeIter;38 DeprecatedPtr<JSObject> o = *scopeIter; 39 39 PropertyNameArray propertyNames(globalObject->globalExec()); 40 40 o->getPropertyNames(globalObject->globalExec(), propertyNames); 41 41 PropertyNameArray::const_iterator propEnd = propertyNames.end(); 42 42 43 fprintf(stderr, "----- [scope %p] -----\n", o );43 fprintf(stderr, "----- [scope %p] -----\n", o.get()); 44 44 for (PropertyNameArray::const_iterator propIter = propertyNames.begin(); propIter != propEnd; propIter++) { 45 45 Identifier name = *propIter; -
trunk/Source/JavaScriptCore/runtime/ScopeChain.h
r77044 r77098 22 22 #define ScopeChain_h 23 23 24 #include "WriteBarrier.h" 24 25 #include <wtf/FastAllocBase.h> 25 26 … … 53 54 { 54 55 next = 0; 55 object = 0;56 56 globalData = 0; 57 57 globalObject = 0; … … 61 61 62 62 ScopeChainNode* next; 63 JSObject*object;63 DeprecatedPtr<JSObject> object; 64 64 JSGlobalData* globalData; 65 65 JSGlobalObject* globalObject; … … 132 132 } 133 133 134 JSObject*const & operator*() const { return m_node->object; }135 JSObject*const * operator->() const { return &(operator*()); }134 DeprecatedPtr<JSObject> const & operator*() const { return m_node->object; } 135 DeprecatedPtr<JSObject> const * operator->() const { return &(operator*()); } 136 136 137 137 ScopeChainIterator& operator++() { m_node = m_node->next; return *this; } … … 196 196 ScopeChainNode* node() const { return m_node; } 197 197 198 JSObject* top() const { return m_node->object ; }198 JSObject* top() const { return m_node->object.get(); } 199 199 200 200 ScopeChainIterator begin() const { return m_node->begin(); } -
trunk/Source/JavaScriptCore/runtime/ScopeChainMark.h
r77044 r77098 29 29 { 30 30 for (ScopeChainNode* n = m_node; n; n = n->next) 31 markStack.append( n->object);31 markStack.append(&n->object); 32 32 } 33 33 -
trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp
r77044 r77098 36 36 static const unsigned numCharactersToStore = 0x100; 37 37 38 static inline bool isMarked(JS String* string)38 static inline bool isMarked(JSCell* string) 39 39 { 40 40 return string && Heap::isCellMarked(string); … … 84 84 */ 85 85 86 bool isAnyStringMarked = isMarked(m_emptyString );86 bool isAnyStringMarked = isMarked(m_emptyString.get()); 87 87 for (unsigned i = 0; i < numCharactersToStore && !isAnyStringMarked; ++i) 88 isAnyStringMarked = isMarked(m_singleCharacterStrings[i] );88 isAnyStringMarked = isMarked(m_singleCharacterStrings[i].get()); 89 89 90 90 if (!isAnyStringMarked) { … … 94 94 95 95 if (m_emptyString) 96 markStack.append( m_emptyString);96 markStack.append(&m_emptyString); 97 97 for (unsigned i = 0; i < numCharactersToStore; ++i) { 98 98 if (m_singleCharacterStrings[i]) 99 markStack.append( m_singleCharacterStrings[i]);99 markStack.append(&m_singleCharacterStrings[i]); 100 100 } 101 101 } -
trunk/Source/JavaScriptCore/runtime/SmallStrings.h
r77044 r77098 28 28 29 29 #include "UString.h" 30 #include "WriteBarrier.h" 30 31 #include <wtf/FixedArray.h> 31 32 #include <wtf/OwnPtr.h> … … 48 49 if (!m_emptyString) 49 50 createEmptyString(globalData); 50 return m_emptyString ;51 return m_emptyString.get(); 51 52 } 52 53 JSString* singleCharacterString(JSGlobalData* globalData, unsigned char character) … … 54 55 if (!m_singleCharacterStrings[character]) 55 56 createSingleCharacterString(globalData, character); 56 return m_singleCharacterStrings[character] ;57 return m_singleCharacterStrings[character].get(); 57 58 } 58 59 … … 64 65 unsigned count() const; 65 66 #if ENABLE(JIT) 66 JS String** singleCharacterStrings() { return m_singleCharacterStrings.data(); }67 JSCell** singleCharacterStrings() { return m_singleCharacterStrings[0].slot(); } 67 68 #endif 68 69 private: … … 70 71 void createSingleCharacterString(JSGlobalData*, unsigned char); 71 72 72 JSString*m_emptyString;73 FixedArray< JSString*, 0x100> m_singleCharacterStrings;73 DeprecatedPtr<JSString> m_emptyString; 74 FixedArray<DeprecatedPtr<JSString>, 0x100> m_singleCharacterStrings; 74 75 OwnPtr<SmallStringsStorage> m_storage; 75 76 }; -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r77044 r77098 54 54 { 55 55 // ECMA 15.5.3.1 String.prototype 56 putDirectWithoutTransition(exec-> propertyNames().prototype, stringPrototype, ReadOnly | DontEnum | DontDelete);56 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, stringPrototype, ReadOnly | DontEnum | DontDelete); 57 57 58 58 // ECMA 15.5.3.2 fromCharCode() … … 63 63 #endif 64 64 // no. of arguments for constructor 65 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);65 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 66 66 } 67 67 -
trunk/Source/JavaScriptCore/runtime/StringObject.cpp
r77044 r77098 33 33 : JSWrapperObject(structure) 34 34 { 35 setInternalValue( jsEmptyString(exec));35 setInternalValue(exec->globalData(), jsEmptyString(exec)); 36 36 } 37 37 38 StringObject::StringObject( NonNullPassRefPtr<Structure> structure, JSString* string)38 StringObject::StringObject(JSGlobalData& globalData, NonNullPassRefPtr<Structure> structure, JSString* string) 39 39 : JSWrapperObject(structure) 40 40 { 41 setInternalValue( string);41 setInternalValue(globalData, string); 42 42 } 43 43 … … 45 45 : JSWrapperObject(structure) 46 46 { 47 setInternalValue( jsString(exec, string));47 setInternalValue(exec->globalData(), jsString(exec, string)); 48 48 } 49 49 -
trunk/Source/JavaScriptCore/runtime/StringObject.h
r77044 r77098 54 54 protected: 55 55 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSWrapperObject::StructureFlags; 56 StringObject( NonNullPassRefPtr<Structure>, JSString*);56 StringObject(JSGlobalData&, NonNullPassRefPtr<Structure>, JSString*); 57 57 }; 58 58 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r77044 r77098 137 137 putAnonymousValue(0, globalObject); 138 138 // The constructor will be added later, after StringConstructor has been built 139 putDirectWithoutTransition(exec-> propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);139 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum); 140 140 } 141 141 -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r77044 r77098 243 243 244 244 ASSERT(m_prototype); 245 ASSERT(m_prototype .isObject() || m_prototype.isNull());245 ASSERT(m_prototype->isObject() || m_prototype->isNull()); 246 246 247 247 #ifndef NDEBUG … … 477 477 } 478 478 479 RefPtr<Structure> transition = create(structure->m_prototype , structure->typeInfo(), structure->anonymousSlotCount());479 RefPtr<Structure> transition = create(structure->m_prototype.get(), structure->typeInfo(), structure->anonymousSlotCount()); 480 480 481 481 transition->m_cachedPrototypeChain = structure->m_cachedPrototypeChain; … … 596 596 ASSERT(!structure->isUncacheableDictionary()); 597 597 598 RefPtr<Structure> transition = create(structure->m_prototype , structure->typeInfo(), structure->anonymousSlotCount());598 RefPtr<Structure> transition = create(structure->m_prototype.get(), structure->typeInfo(), structure->anonymousSlotCount()); 599 599 transition->m_dictionaryKind = kind; 600 600 transition->m_propertyStorageCapacity = structure->m_propertyStorageCapacity; … … 621 621 } 622 622 623 PassRefPtr<Structure> Structure::flattenDictionaryStructure(JS Object* object)623 PassRefPtr<Structure> Structure::flattenDictionaryStructure(JSGlobalData& globalData, JSObject* object) 624 624 { 625 625 ASSERT(isDictionary()); … … 652 652 // Copy the original property values into their final locations 653 653 for (unsigned i = 0; i < propertyCount; i++) 654 object->putDirectOffset( anonymousSlotCount + i, values[i]);654 object->putDirectOffset(globalData, anonymousSlotCount + i, values[i]); 655 655 656 656 if (m_propertyTable->deletedOffsets) { -
trunk/Source/JavaScriptCore/runtime/Structure.h
r77044 r77098 81 81 static PassRefPtr<Structure> toUncacheableDictionaryTransition(Structure*); 82 82 83 PassRefPtr<Structure> flattenDictionaryStructure(JS Object*);83 PassRefPtr<Structure> flattenDictionaryStructure(JSGlobalData&, JSObject*); 84 84 85 85 ~Structure(); … … 95 95 const TypeInfo& typeInfo() const { return m_typeInfo; } 96 96 97 JSValue storedPrototype() const { return m_prototype; } 97 JSValue storedPrototype() const { return m_prototype.get(); } 98 DeprecatedPtr<Unknown>* storedPrototypeSlot() { return &m_prototype; } 98 99 JSValue prototypeForLookup(ExecState*) const; 99 100 StructureChain* prototypeChain(ExecState*) const; … … 207 208 TypeInfo m_typeInfo; 208 209 209 JSValuem_prototype;210 DeprecatedPtr<Unknown> m_prototype; 210 211 mutable RefPtr<StructureChain> m_cachedPrototypeChain; 211 212 -
trunk/Source/JavaScriptCore/runtime/WeakGCMap.h
r77044 r77098 47 47 48 48 public: 49 typedef typename HashMap<KeyType, MappedType>::iterator iterator;50 typedef typename HashMap<KeyType, MappedType>::const_iterator const_iterator;49 typedef typename HashMap<KeyType, DeprecatedPtr<MappedType> >::iterator iterator; 50 typedef typename HashMap<KeyType, DeprecatedPtr<MappedType> >::const_iterator const_iterator; 51 51 52 52 bool isEmpty() { return m_map.isEmpty(); } 53 53 void clear() { m_map.clear(); } 54 54 55 MappedType get(const KeyType& key) const;56 pair<iterator, bool> set(const KeyType&, const MappedType&);57 MappedType take(const KeyType& key);55 MappedType* get(const KeyType&) const; 56 pair<iterator, bool> set(const KeyType&, MappedType*); 57 MappedType* take(const KeyType&); 58 58 59 59 // These unchecked functions provide access to a value even if the value's … … 61 61 // during the GC mark phase, which begins by clearing all mark bits. 62 62 63 MappedType uncheckedGet(const KeyType& key) const { return m_map.get(key); } 64 bool uncheckedRemove(const KeyType&, const MappedType&); 63 MappedType* uncheckedGet(const KeyType& key) const { return m_map.get(key).get(); } 64 DeprecatedPtr<MappedType>* uncheckedGetSlot(const KeyType& key) 65 { 66 iterator iter = m_map.find(key); 67 if (iter == m_map.end()) 68 return 0; 69 return &iter->second; 70 } 71 bool uncheckedRemove(const KeyType&, MappedType*); 65 72 66 73 iterator uncheckedBegin() { return m_map.begin(); } … … 70 77 const_iterator uncheckedEnd() const { return m_map.end(); } 71 78 72 bool isValid(iterator it) const { return Heap::isCellMarked(it->second ); }73 bool isValid(const_iterator it) const { return Heap::isCellMarked(it->second ); }79 bool isValid(iterator it) const { return Heap::isCellMarked(it->second.get()); } 80 bool isValid(const_iterator it) const { return Heap::isCellMarked(it->second.get()); } 74 81 75 82 private: 76 HashMap<KeyType, MappedType> m_map;83 HashMap<KeyType, DeprecatedPtr<MappedType> > m_map; 77 84 }; 78 85 79 86 template<typename KeyType, typename MappedType> 80 inline MappedType WeakGCMap<KeyType, MappedType>::get(const KeyType& key) const87 inline MappedType* WeakGCMap<KeyType, MappedType>::get(const KeyType& key) const 81 88 { 82 MappedType result = m_map.get(key);83 if (result == HashTraits<MappedType >::emptyValue())89 MappedType* result = m_map.get(key).get(); 90 if (result == HashTraits<MappedType*>::emptyValue()) 84 91 return result; 85 92 if (!Heap::isCellMarked(result)) 86 return HashTraits<MappedType >::emptyValue();93 return HashTraits<MappedType*>::emptyValue(); 87 94 return result; 88 95 } 89 96 90 97 template<typename KeyType, typename MappedType> 91 MappedType WeakGCMap<KeyType, MappedType>::take(const KeyType& key)98 MappedType* WeakGCMap<KeyType, MappedType>::take(const KeyType& key) 92 99 { 93 MappedType result = m_map.take(key);94 if (result == HashTraits<MappedType >::emptyValue())100 MappedType* result = m_map.take(key).get(); 101 if (result == HashTraits<MappedType*>::emptyValue()) 95 102 return result; 96 103 if (!Heap::isCellMarked(result)) 97 return HashTraits<MappedType >::emptyValue();104 return HashTraits<MappedType*>::emptyValue(); 98 105 return result; 99 106 } 100 107 101 108 template<typename KeyType, typename MappedType> 102 pair<typename HashMap<KeyType, MappedType>::iterator, bool> WeakGCMap<KeyType, MappedType>::set(const KeyType& key, const MappedType&value)109 pair<typename WeakGCMap<KeyType, MappedType>::iterator, bool> WeakGCMap<KeyType, MappedType>::set(const KeyType& key, MappedType* value) 103 110 { 104 111 Heap::markCell(value); // If value is newly allocated, it's not marked, so mark it now. 105 112 pair<iterator, bool> result = m_map.add(key, value); 106 113 if (!result.second) { // pre-existing entry 107 result.second = !Heap::isCellMarked(result.first->second );114 result.second = !Heap::isCellMarked(result.first->second.get()); 108 115 result.first->second = value; 109 116 } … … 112 119 113 120 template<typename KeyType, typename MappedType> 114 bool WeakGCMap<KeyType, MappedType>::uncheckedRemove(const KeyType& key, const MappedType&value)121 bool WeakGCMap<KeyType, MappedType>::uncheckedRemove(const KeyType& key, MappedType* value) 115 122 { 116 123 iterator it = m_map.find(key); 117 124 if (it == m_map.end()) 118 125 return false; 119 if (it->second != value)126 if (it->second.get() != value) 120 127 return false; 121 128 m_map.remove(it); -
trunk/Source/JavaScriptGlue/ChangeLog
r77044 r77098 1 2011-01-30 Oliver Hunt <[email protected]> 2 3 Convert markstack to a slot visitor API 4 https://bugs.webkit.org/show_bug.cgi?id=53219 5 6 rolling r77006 and r77020 back in. 7 8 * JSValueWrapper.cpp: 9 (JSValueWrapper::JSObjectMark): 10 1 11 2011-01-28 Sheriff Bot <[email protected]> 2 12 -
trunk/Source/JavaScriptGlue/JSValueWrapper.cpp
r77044 r77098 195 195 void JSValueWrapper::JSObjectMark(void *data) 196 196 { 197 JSValueWrapper* ptr = (JSValueWrapper*)data;198 if (ptr)199 {200 // This results in recursive marking but will be otherwise safe and correct.201 // We claim the array vptr is 0 because we don't have access to it here, and202 // claiming 0 is functionally harmless -- it merely means that we can't203 // devirtualise marking of arrays when recursing from this point.204 MarkStack markStack(0);205 markStack.append(ptr->fValue.get());206 markStack.drain();207 }208 197 } -
trunk/Source/WebCore/ChangeLog
r77097 r77098 1 2011-01-30 Oliver Hunt <[email protected]> 2 3 Convert markstack to a slot visitor API 4 https://bugs.webkit.org/show_bug.cgi?id=53219 5 6 rolling r77006 and r77020 back in. 7 8 * ForwardingHeaders/runtime/WriteBarrier.h: Added. 9 * WebCore.exp.in: 10 * bindings/js/DOMWrapperWorld.h: 11 (WebCore::DOMWrapperWorld::globalData): 12 * bindings/js/JSAudioConstructor.cpp: 13 (WebCore::JSAudioConstructor::JSAudioConstructor): 14 * bindings/js/JSDOMBinding.cpp: 15 (WebCore::markDOMNodesForDocument): 16 (WebCore::markDOMObjectWrapper): 17 (WebCore::markDOMNodeWrapper): 18 * bindings/js/JSDOMGlobalObject.cpp: 19 (WebCore::JSDOMGlobalObject::markChildren): 20 (WebCore::JSDOMGlobalObject::setInjectedScript): 21 (WebCore::JSDOMGlobalObject::injectedScript): 22 * bindings/js/JSDOMGlobalObject.h: 23 (WebCore::JSDOMGlobalObject::JSDOMGlobalObjectData::JSDOMGlobalObjectData): 24 (WebCore::getDOMConstructor): 25 * bindings/js/JSDOMWindowCustom.cpp: 26 (WebCore::JSDOMWindow::setLocation): 27 (WebCore::DialogHandler::dialogCreated): 28 * bindings/js/JSDOMWindowShell.cpp: 29 (WebCore::JSDOMWindowShell::JSDOMWindowShell): 30 (WebCore::JSDOMWindowShell::setWindow): 31 (WebCore::JSDOMWindowShell::markChildren): 32 (WebCore::JSDOMWindowShell::unwrappedObject): 33 * bindings/js/JSDOMWindowShell.h: 34 (WebCore::JSDOMWindowShell::window): 35 (WebCore::JSDOMWindowShell::setWindow): 36 * bindings/js/JSDeviceMotionEventCustom.cpp: 37 (WebCore::createAccelerationObject): 38 (WebCore::createRotationRateObject): 39 * bindings/js/JSEventListener.cpp: 40 (WebCore::JSEventListener::JSEventListener): 41 (WebCore::JSEventListener::markJSFunction): 42 * bindings/js/JSEventListener.h: 43 (WebCore::JSEventListener::jsFunction): 44 * bindings/js/JSHTMLDocumentCustom.cpp: 45 (WebCore::JSHTMLDocument::setAll): 46 * bindings/js/JSImageConstructor.cpp: 47 (WebCore::JSImageConstructor::JSImageConstructor): 48 * bindings/js/JSImageDataCustom.cpp: 49 (WebCore::toJS): 50 * bindings/js/JSJavaScriptCallFrameCustom.cpp: 51 (WebCore::JSJavaScriptCallFrame::scopeChain): 52 (WebCore::JSJavaScriptCallFrame::scopeType): 53 * bindings/js/JSNodeFilterCondition.cpp: 54 (WebCore::JSNodeFilterCondition::markAggregate): 55 (WebCore::JSNodeFilterCondition::acceptNode): 56 * bindings/js/JSNodeFilterCondition.h: 57 * bindings/js/JSNodeFilterCustom.cpp: 58 * bindings/js/JSOptionConstructor.cpp: 59 (WebCore::JSOptionConstructor::JSOptionConstructor): 60 * bindings/js/JSSQLResultSetRowListCustom.cpp: 61 (WebCore::JSSQLResultSetRowList::item): 62 * bindings/js/ScriptCachedFrameData.cpp: 63 (WebCore::ScriptCachedFrameData::restore): 64 * bindings/js/ScriptObject.cpp: 65 (WebCore::ScriptGlobalObject::set): 66 * bindings/js/SerializedScriptValue.cpp: 67 (WebCore::CloneDeserializer::putProperty): 68 * bindings/scripts/CodeGeneratorJS.pm: 69 * bridge/qt/qt_runtime.cpp: 70 (JSC::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod): 71 (JSC::Bindings::QtRuntimeMetaMethod::markChildren): 72 (JSC::Bindings::QtRuntimeMetaMethod::connectGetter): 73 (JSC::Bindings::QtRuntimeMetaMethod::disconnectGetter): 74 * bridge/qt/qt_runtime.h: 75 * bridge/runtime_root.cpp: 76 (JSC::Bindings::RootObject::invalidate): 77 * bridge/runtime_root.h: 78 * dom/Document.h: 79 1 80 2011-01-30 Simon Fraser <[email protected]> 2 81 -
trunk/Source/WebCore/WebCore.exp.in
r77044 r77098 447 447 __ZN7WebCore16enclosingIntRectERKNS_9FloatRectE 448 448 __ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE 449 __ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERNS0_9WeakGCMapIPN3WTF10StringImplEPNS0_8JSStringEEES6_450 449 __ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE 451 450 __ZN7WebCore17DOMImplementation13isXMLMIMETypeERKN3WTF6StringE … … 1435 1434 __ZN7WebCore16ScriptController20windowScriptNPObjectEv 1436 1435 __ZN7WebCore16ScriptController29cleanupScriptObjectsForPluginEPv 1436 __ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERNS0_9WeakGCMapIPN3WTF10StringImplENS0_8JSStringEEES6_ 1437 1437 __ZN7WebCore17HTMLPlugInElement11getNPObjectEv 1438 1438 __ZNK7WebCore12RenderObject4viewEv -
trunk/Source/WebCore/bindings/js/DOMWrapperWorld.h
r77044 r77098 33 33 class ScriptController; 34 34 35 typedef JSC::WeakGCMap<void*, DOMObject *> DOMObjectWrapperMap;36 typedef JSC::WeakGCMap<StringImpl*, JSC::JSString *> JSStringCache;35 typedef JSC::WeakGCMap<void*, DOMObject> DOMObjectWrapperMap; 36 typedef JSC::WeakGCMap<StringImpl*, JSC::JSString> JSStringCache; 37 37 38 38 class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> { … … 58 58 59 59 bool isNormal() const { return m_isNormal; } 60 61 JSC::JSGlobalData* globalData() const { return m_globalData; } 60 62 61 63 protected: -
trunk/Source/WebCore/bindings/js/JSAudioConstructor.cpp
r77044 r77098 43 43 : DOMConstructorWithDocument(JSAudioConstructor::createStructure(globalObject->objectPrototype()), globalObject) 44 44 { 45 putDirect(exec-> propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), None);46 putDirect(exec-> propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);45 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), None); 46 putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum); 47 47 } 48 48 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp
r77044 r77098 336 336 JSWrapperCache::iterator nodeEnd = nodeDict->uncheckedEnd(); 337 337 for (JSWrapperCache::iterator nodeIt = nodeDict->uncheckedBegin(); nodeIt != nodeEnd; ++nodeIt) { 338 JSNode*jsNode = nodeIt->second;339 if (isObservableThroughDOM(jsNode , world))340 markStack.append( jsNode);338 DeprecatedPtr<JSNode>& jsNode = nodeIt->second; 339 if (isObservableThroughDOM(jsNode.get(), world)) 340 markStack.append(&jsNode); 341 341 } 342 342 } … … 417 417 418 418 for (JSGlobalDataWorldIterator worldIter(&globalData); worldIter; ++worldIter) { 419 if (D OMObject* wrapper = worldIter->m_wrappers.uncheckedGet(object))420 markStack.append(wrapper );419 if (DeprecatedPtr<DOMObject>* wrapperSlot = worldIter->m_wrappers.uncheckedGetSlot(object)) 420 markStack.append(wrapperSlot); 421 421 } 422 422 } … … 427 427 JSWrapperCacheMap& wrapperCacheMap = document->wrapperCacheMap(); 428 428 for (JSWrapperCacheMap::iterator iter = wrapperCacheMap.begin(); iter != wrapperCacheMap.end(); ++iter) { 429 if ( JSNode* wrapper = iter->second->uncheckedGet(node))430 markStack.append(wrapper );429 if (DeprecatedPtr<JSNode>* wrapperSlot = iter->second->uncheckedGetSlot(node)) 430 markStack.append(wrapperSlot); 431 431 } 432 432 return; … … 434 434 435 435 for (JSGlobalDataWorldIterator worldIter(JSDOMWindow::commonJSGlobalData()); worldIter; ++worldIter) { 436 if (D OMObject* wrapper = worldIter->m_wrappers.uncheckedGet(node))437 markStack.append(wrapper );436 if (DeprecatedPtr<DOMObject>* wrapperSlot = worldIter->m_wrappers.uncheckedGetSlot(node)) 437 markStack.append(wrapperSlot); 438 438 } 439 439 } -
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
r77044 r77098 54 54 JSDOMStructureMap::iterator end = structures().end(); 55 55 for (JSDOMStructureMap::iterator it = structures().begin(); it != end; ++it) 56 markStack.append(it->second->storedPrototype ());56 markStack.append(it->second->storedPrototypeSlot()); 57 57 58 58 JSDOMConstructorMap::iterator end2 = constructors().end(); 59 59 for (JSDOMConstructorMap::iterator it2 = constructors().begin(); it2 != end2; ++it2) 60 markStack.append( it2->second);60 markStack.append(&it2->second); 61 61 62 62 if (d()->m_injectedScript) 63 markStack.append( d()->m_injectedScript);63 markStack.append(&d()->m_injectedScript); 64 64 } 65 65 … … 76 76 void JSDOMGlobalObject::setInjectedScript(JSObject* injectedScript) 77 77 { 78 d()->m_injectedScript = injectedScript;78 d()->m_injectedScript.set(globalData(), this, injectedScript); 79 79 } 80 80 81 81 JSObject* JSDOMGlobalObject::injectedScript() const 82 82 { 83 return d()->m_injectedScript ;83 return d()->m_injectedScript.get(); 84 84 } 85 85 -
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.h
r77044 r77098 40 40 41 41 typedef HashMap<const JSC::ClassInfo*, RefPtr<JSC::Structure> > JSDOMStructureMap; 42 typedef HashMap<const JSC::ClassInfo*, JSC:: JSObject*> JSDOMConstructorMap;42 typedef HashMap<const JSC::ClassInfo*, JSC::WriteBarrier<JSC::JSObject> > JSDOMConstructorMap; 43 43 44 44 class JSDOMGlobalObject : public JSC::JSGlobalObject { … … 77 77 , evt(0) 78 78 , m_world(world) 79 , m_injectedScript(0)80 79 { 81 80 } … … 86 85 Event* evt; 87 86 RefPtr<DOMWrapperWorld> m_world; 88 JS Object*m_injectedScript;87 JSC::WriteBarrier<JSObject> m_injectedScript; 89 88 }; 90 89 … … 98 97 inline JSC::JSObject* getDOMConstructor(JSC::ExecState* exec, const JSDOMGlobalObject* globalObject) 99 98 { 100 if (JSC::JSObject* constructor = globalObject->constructors().get(&ConstructorClass::s_info) )99 if (JSC::JSObject* constructor = globalObject->constructors().get(&ConstructorClass::s_info).get()) 101 100 return constructor; 102 101 JSC::JSObject* constructor = new (exec) ConstructorClass(exec, const_cast<JSDOMGlobalObject*>(globalObject)); 103 102 ASSERT(!globalObject->constructors().contains(&ConstructorClass::s_info)); 104 globalObject->constructors().set(&ConstructorClass::s_info, constructor); 103 JSC::WriteBarrier<JSC::JSObject> temp; 104 globalObject->constructors().add(&ConstructorClass::s_info, temp).first->second.set(exec->globalData(), globalObject, constructor); 105 105 return constructor; 106 106 } -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r77044 r77098 476 476 if (settings->usesDashboardBackwardCompatibilityMode() && !activeFrame->tree()->parent()) { 477 477 if (allowsAccessFrom(exec)) 478 putDirect( Identifier(exec, "location"), value);478 putDirect(exec->globalData(), Identifier(exec, "location"), value); 479 479 return; 480 480 } … … 683 683 m_globalObject = toJSDOMWindow(dialog->frame(), normalWorld(m_exec->globalData())); 684 684 if (JSValue dialogArguments = m_exec->argument(1)) 685 m_globalObject->putDirect( Identifier(m_exec, "dialogArguments"), dialogArguments);685 m_globalObject->putDirect(m_exec->globalData(), Identifier(m_exec, "dialogArguments"), dialogArguments); 686 686 } 687 687 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
r77044 r77098 46 46 JSDOMWindowShell::JSDOMWindowShell(PassRefPtr<DOMWindow> window, DOMWrapperWorld* world) 47 47 : Base(JSDOMWindowShell::createStructure(jsNull())) 48 , m_window(0)49 48 , m_world(world) 50 49 { … … 67 66 JSDOMWindow* jsDOMWindow = new (JSDOMWindow::commonJSGlobalData()) JSDOMWindow(structure.release(), domWindow, this); 68 67 prototype->putAnonymousValue(0, jsDOMWindow); 69 setWindow( jsDOMWindow);68 setWindow(*JSDOMWindow::commonJSGlobalData(), jsDOMWindow); 70 69 } 71 70 … … 78 77 Base::markChildren(markStack); 79 78 if (m_window) 80 markStack.append( m_window);79 markStack.append(&m_window); 81 80 } 82 81 … … 148 147 JSObject* JSDOMWindowShell::unwrappedObject() 149 148 { 150 return m_window ;149 return m_window.get(); 151 150 } 152 151 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h
r77044 r77098 44 44 virtual ~JSDOMWindowShell(); 45 45 46 JSDOMWindow* window() const { return m_window ; }47 void setWindow(JS DOMWindow* window)46 JSDOMWindow* window() const { return m_window.get(); } 47 void setWindow(JSC::JSGlobalData& globalData, JSDOMWindow* window) 48 48 { 49 49 ASSERT_ARG(window, window); 50 m_window = window;50 m_window.set(globalData, this, window); 51 51 setPrototype(window->prototype()); 52 52 } … … 86 86 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } 87 87 88 JS DOMWindow*m_window;88 JSC::WriteBarrier<JSDOMWindow> m_window; 89 89 RefPtr<DOMWrapperWorld> m_world; 90 90 }; -
trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
r77044 r77098 115 115 { 116 116 JSObject* object = constructEmptyObject(exec); 117 object->putDirect( Identifier(exec, "x"), acceleration->canProvideX() ? jsNumber(acceleration->x()) : jsNull());118 object->putDirect( Identifier(exec, "y"), acceleration->canProvideY() ? jsNumber(acceleration->y()) : jsNull());119 object->putDirect( Identifier(exec, "z"), acceleration->canProvideZ() ? jsNumber(acceleration->z()) : jsNull());117 object->putDirect(exec->globalData(), Identifier(exec, "x"), acceleration->canProvideX() ? jsNumber(acceleration->x()) : jsNull()); 118 object->putDirect(exec->globalData(), Identifier(exec, "y"), acceleration->canProvideY() ? jsNumber(acceleration->y()) : jsNull()); 119 object->putDirect(exec->globalData(), Identifier(exec, "z"), acceleration->canProvideZ() ? jsNumber(acceleration->z()) : jsNull()); 120 120 return object; 121 121 } … … 124 124 { 125 125 JSObject* object = constructEmptyObject(exec); 126 object->putDirect( Identifier(exec, "alpha"), rotationRate->canProvideAlpha() ? jsNumber(rotationRate->alpha()) : jsNull());127 object->putDirect( Identifier(exec, "beta"), rotationRate->canProvideBeta() ? jsNumber(rotationRate->beta()) : jsNull());128 object->putDirect( Identifier(exec, "gamma"), rotationRate->canProvideGamma() ? jsNumber(rotationRate->gamma()) : jsNull());126 object->putDirect(exec->globalData(), Identifier(exec, "alpha"), rotationRate->canProvideAlpha() ? jsNumber(rotationRate->alpha()) : jsNull()); 127 object->putDirect(exec->globalData(), Identifier(exec, "beta"), rotationRate->canProvideBeta() ? jsNumber(rotationRate->beta()) : jsNull()); 128 object->putDirect(exec->globalData(), Identifier(exec, "gamma"), rotationRate->canProvideGamma() ? jsNumber(rotationRate->gamma()) : jsNull()); 129 129 return object; 130 130 } -
trunk/Source/WebCore/bindings/js/JSEventListener.cpp
r77044 r77098 35 35 JSEventListener::JSEventListener(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld) 36 36 : EventListener(JSEventListenerType) 37 , m_jsFunction(function)38 37 , m_isAttribute(isAttribute) 39 38 , m_isolatedWorld(isolatedWorld) … … 41 40 if (wrapper) 42 41 m_wrapper = wrapper; 42 m_jsFunction.set(*m_isolatedWorld->globalData(), wrapper, function); 43 43 } 44 44 … … 56 56 { 57 57 if (m_jsFunction) 58 markStack.append( m_jsFunction);58 markStack.append(&m_jsFunction); 59 59 } 60 60 -
trunk/Source/WebCore/bindings/js/JSEventListener.h
r77044 r77098 67 67 68 68 private: 69 mutable JSC:: JSObject*m_jsFunction;69 mutable JSC::WriteBarrier<JSC::JSObject> m_jsFunction; 70 70 mutable JSC::WeakGCPtr<JSC::JSObject> m_wrapper; 71 71 … … 77 77 { 78 78 if (!m_jsFunction) 79 m_jsFunction = initializeJSFunction(scriptExecutionContext);79 m_jsFunction.set(*scriptExecutionContext->globalData(), m_wrapper.get(), initializeJSFunction(scriptExecutionContext)); 80 80 81 81 // Verify that we have a valid wrapper protecting our function from … … 87 87 // Try to verify that m_jsFunction wasn't recycled. (Not exact, since an 88 88 // event listener can be almost anything, but this makes test-writing easier). 89 ASSERT(!m_jsFunction || static_cast<JSC::JSCell*>(m_jsFunction )->isObject());89 ASSERT(!m_jsFunction || static_cast<JSC::JSCell*>(m_jsFunction.get())->isObject()); 90 90 91 return m_jsFunction ;91 return m_jsFunction.get(); 92 92 } 93 93 -
trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
r77062 r77098 97 97 { 98 98 // Add "all" to the property map. 99 putDirect( Identifier(exec, "all"), value);99 putDirect(exec->globalData(), Identifier(exec, "all"), value); 100 100 } 101 101 -
trunk/Source/WebCore/bindings/js/JSImageConstructor.cpp
r77044 r77098 38 38 : DOMConstructorWithDocument(JSImageConstructor::createStructure(globalObject->objectPrototype()), globalObject) 39 39 { 40 putDirect(exec-> propertyNames().prototype, JSHTMLImageElementPrototype::self(exec, globalObject), None);40 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLImageElementPrototype::self(exec, globalObject), None); 41 41 } 42 42 -
trunk/Source/WebCore/bindings/js/JSImageDataCustom.cpp
r77044 r77098 50 50 DEFINE_STATIC_LOCAL(RefPtr<Structure>, cpaStructure, (JSByteArray::createStructure(jsNull()))); 51 51 static const ClassInfo cpaClassInfo = { "CanvasPixelArray", 0, 0, 0 }; 52 wrapper->putDirect( dataName, new (exec) JSByteArray(exec, cpaStructure, imageData->data()->data(), &cpaClassInfo), DontDelete | ReadOnly);52 wrapper->putDirect(exec->globalData(), dataName, new (exec) JSByteArray(exec, cpaStructure, imageData->data()->data(), &cpaClassInfo), DontDelete | ReadOnly); 53 53 exec->heap()->reportExtraMemoryCost(imageData->data()->length()); 54 54 -
trunk/Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
r77044 r77098 80 80 MarkedArgumentBuffer list; 81 81 do { 82 list.append( *iter);82 list.append(iter->get()); 83 83 ++iter; 84 84 } while (iter != end); … … 101 101 bool foundLocalScope = false; 102 102 for (ScopeChainIterator iter = scopeChain->begin(); iter != end; ++iter) { 103 JS Object*scope = *iter;103 JSC::DeprecatedPtr<JSObject> scope = *iter; 104 104 if (scope->isActivationObject()) { 105 105 if (!foundLocalScope) { -
trunk/Source/WebCore/bindings/js/JSNodeFilterCondition.cpp
r77044 r77098 40 40 void JSNodeFilterCondition::markAggregate(MarkStack& markStack) 41 41 { 42 markStack.append( m_filter);42 markStack.append(&m_filter); 43 43 } 44 44 … … 47 47 JSLock lock(SilenceAssertionsOnly); 48 48 49 if (!m_filter .isObject())49 if (!m_filter->isObject()) 50 50 return NodeFilter::FILTER_ACCEPT; 51 51 … … 59 59 return NodeFilter::FILTER_REJECT; 60 60 61 JSValue function = m_filter ;61 JSValue function = m_filter.get(); 62 62 CallData callData; 63 63 CallType callType = getCallData(function, callData); 64 64 if (callType == CallTypeNone) { 65 function = m_filter .get(exec, Identifier(exec, "acceptNode"));65 function = m_filter->get(exec, Identifier(exec, "acceptNode")); 66 66 callType = getCallData(function, callData); 67 67 if (callType == CallTypeNone) { … … 78 78 return NodeFilter::FILTER_REJECT; 79 79 80 JSValue result = JSC::call(exec, function, callType, callData, m_filter , args);80 JSValue result = JSC::call(exec, function, callType, callData, m_filter.get(), args); 81 81 if (exec->hadException()) 82 82 return NodeFilter::FILTER_REJECT; -
trunk/Source/WebCore/bindings/js/JSNodeFilterCondition.h
r77044 r77098 42 42 virtual void markAggregate(JSC::MarkStack&); 43 43 44 mutable JSC:: JSValuem_filter;44 mutable JSC::DeprecatedPtr<JSC::Unknown> m_filter; 45 45 }; 46 46 -
trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp
r77044 r77098 27 27 #include "JSNodeFilter.h" 28 28 29 #include "JSDOMWindowBase.h" 29 30 #include "JSNode.h" 30 31 #include "JSNodeFilterCondition.h" -
trunk/Source/WebCore/bindings/js/JSOptionConstructor.cpp
r77044 r77098 39 39 : DOMConstructorWithDocument(JSOptionConstructor::createStructure(globalObject->objectPrototype()), globalObject) 40 40 { 41 putDirect(exec-> propertyNames().prototype, JSHTMLOptionElementPrototype::self(exec, globalObject), None);42 putDirect(exec-> propertyNames().length, jsNumber(4), ReadOnly | DontDelete | DontEnum);41 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLOptionElementPrototype::self(exec, globalObject), None); 42 putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(4), ReadOnly | DontDelete | DontEnum); 43 43 } 44 44 -
trunk/Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
r77044 r77098 75 75 } 76 76 77 object->putDirect( Identifier(exec, stringToUString(m_impl->columnNames()[i])), jsValue, DontDelete | ReadOnly);77 object->putDirect(exec->globalData(), Identifier(exec, stringToUString(m_impl->columnNames()[i])), jsValue, DontDelete | ReadOnly); 78 78 } 79 79 -
trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp
r77044 r77098 85 85 86 86 if (JSDOMWindow* window = m_windows.get(world)) 87 windowShell->setWindow(window );87 windowShell->setWindow(window->globalData(), window); 88 88 else { 89 89 windowShell->setWindow(frame->domWindow()); -
trunk/Source/WebCore/bindings/js/ScriptObject.cpp
r77044 r77098 63 63 { 64 64 JSLock lock(SilenceAssertionsOnly); 65 scriptState->lexicalGlobalObject()->putDirect( Identifier(scriptState, name), value.jsObject());65 scriptState->lexicalGlobalObject()->putDirect(scriptState->globalData(), Identifier(scriptState, name), value.jsObject()); 66 66 return handleException(scriptState); 67 67 } … … 72 72 JSLock lock(SilenceAssertionsOnly); 73 73 JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject()); 74 globalObject->putDirect( Identifier(scriptState, name), toJS(scriptState, globalObject, value));74 globalObject->putDirect(scriptState->globalData(), Identifier(scriptState, name), toJS(scriptState, globalObject, value)); 75 75 return handleException(scriptState); 76 76 } … … 80 80 JSLock lock(SilenceAssertionsOnly); 81 81 JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject()); 82 globalObject->putDirect( Identifier(scriptState, name), toJS(scriptState, globalObject, value));82 globalObject->putDirect(scriptState->globalData(), Identifier(scriptState, name), toJS(scriptState, globalObject, value)); 83 83 return handleException(scriptState); 84 84 } -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp
r77044 r77098 1041 1041 { 1042 1042 if (array->canSetIndex(index)) 1043 array->setIndex( index, value);1043 array->setIndex(m_exec->globalData(), index, value); 1044 1044 else 1045 1045 array->put(m_exec, index, value); … … 1048 1048 void putProperty(JSObject* object, const Identifier& property, JSValue value) 1049 1049 { 1050 object->putDirect( property, value);1050 object->putDirect(m_exec->globalData(), property, value); 1051 1051 } 1052 1052 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r77044 r77098 1736 1736 push(@implContent, " // Shadowing a built-in constructor\n"); 1737 1737 if ($interfaceName eq "DOMWindow" && $className eq "JSblah") { 1738 push(@implContent, " static_cast<$className*>(thisObject)->putDirect(exec-> propertyNames().constructor, value);\n");1738 push(@implContent, " static_cast<$className*>(thisObject)->putDirect(exec->globalData(), exec->propertyNames().constructor, value);\n"); 1739 1739 } else { 1740 push(@implContent, " static_cast<$className*>(thisObject)->putDirect( Identifier(exec, \"$name\"), value);\n");1740 push(@implContent, " static_cast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n"); 1741 1741 } 1742 1742 } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) { 1743 1743 push(@implContent, " // Shadowing a built-in object\n"); 1744 push(@implContent, " static_cast<$className*>(thisObject)->putDirect( Identifier(exec, \"$name\"), value);\n");1744 push(@implContent, " static_cast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n"); 1745 1745 } else { 1746 1746 push(@implContent, " $className* castedThis = static_cast<$className*>(thisObject);\n"); … … 1825 1825 1826 1826 if ($interfaceName eq "DOMWindow") { 1827 push(@implContent, " static_cast<$className*>(thisObject)->putDirect(exec-> propertyNames().constructor, value);\n");1827 push(@implContent, " static_cast<$className*>(thisObject)->putDirect(exec->globalData(), exec->propertyNames().constructor, value);\n"); 1828 1828 } else { 1829 push(@implContent, " static_cast<$className*>(thisObject)->putDirect( Identifier(exec, \"$name\"), value);\n");1829 push(@implContent, " static_cast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n"); 1830 1830 } 1831 1831 push(@implContent, "}\n"); … … 2943 2943 push(@$outputArray, "{\n"); 2944 2944 if ($interfaceName eq "DOMWindow") { 2945 push(@$outputArray, " putDirect(exec-> propertyNames().prototype, globalObject->prototype(), DontDelete | ReadOnly);\n");2945 push(@$outputArray, " putDirect(exec->globalData(), exec->propertyNames().prototype, globalObject->prototype(), DontDelete | ReadOnly);\n"); 2946 2946 } else { 2947 push(@$outputArray, " putDirect(exec-> propertyNames().prototype, ${protoClassName}::self(exec, globalObject), DontDelete | ReadOnly);\n");2948 } 2949 push(@$outputArray, " putDirect(exec-> propertyNames().length, jsNumber(${numberOfconstructParameters}), ReadOnly | DontDelete | DontEnum);\n") if $numberOfconstructParameters;2947 push(@$outputArray, " putDirect(exec->globalData(), exec->propertyNames().prototype, ${protoClassName}::self(exec, globalObject), DontDelete | ReadOnly);\n"); 2948 } 2949 push(@$outputArray, " putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(${numberOfconstructParameters}), ReadOnly | DontDelete | DontEnum);\n") if $numberOfconstructParameters; 2950 2950 push(@$outputArray, "}\n\n"); 2951 2951 -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r77044 r77098 1402 1402 d->m_signature = signature; 1403 1403 d->m_index = index; 1404 d->m_connect = 0;1405 d->m_disconnect = 0;1406 1404 d->m_allowPrivate = allowPrivate; 1407 1405 } … … 1412 1410 QW_D(QtRuntimeMetaMethod); 1413 1411 if (d->m_connect) 1414 markStack.append( d->m_connect);1412 markStack.append(&d->m_connect); 1415 1413 if (d->m_disconnect) 1416 markStack.append( d->m_disconnect);1414 markStack.append(&d->m_disconnect); 1417 1415 } 1418 1416 … … 1524 1522 1525 1523 if (!d->m_connect) 1526 d->m_connect = new (exec) QtRuntimeConnectionMethod(exec, ident, true, d->m_instance, d->m_index, d->m_signature);1524 d->m_connect.set(exec->globalData(), this, new (exec) QtRuntimeConnectionMethod(exec, ident, true, d->m_instance, d->m_index, d->m_signature)); 1527 1525 return d->m_connect; 1528 1526 } … … 1534 1532 1535 1533 if (!d->m_disconnect) 1536 d->m_disconnect = new (exec) QtRuntimeConnectionMethod(exec, ident, false, d->m_instance, d->m_index, d->m_signature);1534 d->m_disconnect.set(exec->globalData(), this, new (exec) QtRuntimeConnectionMethod(exec, ident, false, d->m_instance, d->m_index, d->m_signature)); 1537 1535 return d->m_disconnect; 1538 1536 } -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r77044 r77098 130 130 bool m_allowPrivate; 131 131 int m_index; 132 QtRuntimeConnectionMethod *m_connect;133 QtRuntimeConnectionMethod *m_disconnect;132 WriteBarrier<QtRuntimeConnectionMethod> m_connect; 133 WriteBarrier<QtRuntimeConnectionMethod> m_disconnect; 134 134 }; 135 135 -
trunk/Source/WebCore/bridge/runtime_root.cpp
r77044 r77098 102 102 103 103 { 104 WeakGCMap<RuntimeObject*, RuntimeObject *>::iterator end = m_runtimeObjects.uncheckedEnd();105 for (WeakGCMap<RuntimeObject*, RuntimeObject *>::iterator it = m_runtimeObjects.uncheckedBegin(); it != end; ++it) {104 WeakGCMap<RuntimeObject*, RuntimeObject>::iterator end = m_runtimeObjects.uncheckedEnd(); 105 for (WeakGCMap<RuntimeObject*, RuntimeObject>::iterator it = m_runtimeObjects.uncheckedBegin(); it != end; ++it) { 106 106 if (m_runtimeObjects.isValid(it)) 107 107 it->second->invalidate(); -
trunk/Source/WebCore/bridge/runtime_root.h
r77044 r77098 90 90 91 91 ProtectCountSet m_protectCountSet; 92 WeakGCMap<RuntimeObject*, RuntimeObject *> m_runtimeObjects; // Really need a WeakGCSet, but this will do.92 WeakGCMap<RuntimeObject*, RuntimeObject> m_runtimeObjects; // Really need a WeakGCSet, but this will do. 93 93 94 94 HashSet<InvalidationCallback*> m_invalidationCallbacks; -
trunk/Source/WebCore/dom/Document.h
r77044 r77098 941 941 942 942 #if USE(JSC) 943 typedef JSC::WeakGCMap<WebCore::Node*, JSNode *> JSWrapperCache;943 typedef JSC::WeakGCMap<WebCore::Node*, JSNode> JSWrapperCache; 944 944 typedef HashMap<DOMWrapperWorld*, JSWrapperCache*> JSWrapperCacheMap; 945 945 JSWrapperCacheMap& wrapperCacheMap() { return m_wrapperCacheMap; } -
trunk/Source/WebKit/mac/ChangeLog
r77077 r77098 1 2011-01-30 Oliver Hunt <[email protected]> 2 3 Convert markstack to a slot visitor API 4 https://bugs.webkit.org/show_bug.cgi?id=53219 5 6 rolling r77006 and r77020 back in. 7 8 * WebView/WebScriptDebugDelegate.mm: 9 (-[WebScriptCallFrame scopeChain]): 10 1 11 2011-01-28 Geoffrey Garen <[email protected]> 2 12 -
trunk/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm
r77044 r77098 185 185 ScopeChainIterator end = scopeChain->end(); 186 186 for (ScopeChainIterator it = scopeChain->begin(); it != end; ++it) { 187 JSObject* object = *it;187 JSObject* object = it->get(); 188 188 if (object->isActivationObject()) 189 object = new (scopeChain->globalData) DebuggerActivation( object);189 object = new (scopeChain->globalData) DebuggerActivation(*scopeChain->globalData, object); 190 190 [scopes addObject:[self _convertValueToObjcValue:object]]; 191 191 }
Note:
See TracChangeset
for help on using the changeset viewer.