Changeset 32652 in webkit
- Timestamp:
- Apr 28, 2008 11:22:14 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 64 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackConstructor.cpp
r29663 r32652 35 35 namespace KJS { 36 36 37 const ClassInfo JSCallbackConstructor::info = { "CallbackConstructor", 0, 0 };37 const ClassInfo JSCallbackConstructor::info = { "CallbackConstructor", 0, 0, 0 }; 38 38 39 39 JSCallbackConstructor::JSCallbackConstructor(ExecState* exec, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) -
trunk/JavaScriptCore/API/JSCallbackFunction.cpp
r29663 r32652 37 37 namespace KJS { 38 38 39 const ClassInfo JSCallbackFunction::info = { "CallbackFunction", &InternalFunctionImp::info, 0 };39 const ClassInfo JSCallbackFunction::info = { "CallbackFunction", &InternalFunctionImp::info, 0, 0 }; 40 40 41 41 JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSObjectCallAsFunctionCallback callback, const Identifier& name) -
trunk/JavaScriptCore/API/JSCallbackObject.cpp
r29663 r32652 34 34 35 35 // Define the two types of JSCallbackObjects we support. 36 template <> const ClassInfo JSCallbackObject<JSObject>::info = { "CallbackObject", 0, 0 };37 template <> const ClassInfo JSCallbackObject<JSGlobalObject>::info = { "CallbackGlobalObject", 0, 0 };36 template <> const ClassInfo JSCallbackObject<JSObject>::info = { "CallbackObject", 0, 0, 0 }; 37 template <> const ClassInfo JSCallbackObject<JSGlobalObject>::info = { "CallbackGlobalObject", 0, 0, 0 }; 38 38 39 39 COMPILE_ASSERT(sizeof(JSCallbackObject<JSGlobalObject>) <= CELL_SIZE, global_callback_object_fits_in_cell); -
trunk/JavaScriptCore/ChangeLog
r32650 r32652 1 2008-04-28 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin. 4 5 Fix run-webkit-tests --threading 6 and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661> 7 Proxy server issue in Sunday's Nightly 8 9 Changed ClassInfo objects for built-in objects to hold a getter function returning 10 a per-thread instance. This makes it safe to share these ClassInfo objects between threads - 11 and these are the only ones that need to be shared. 12 13 * kjs/lexer.cpp: 14 (KJS::Lexer::Lexer): 15 (KJS::Lexer::~Lexer): 16 * kjs/lexer.h: 17 Made mainTable a member of Lexer, so that it no longer needs to be shared between threads. 18 19 * kjs/object.cpp: 20 (KJS::JSObject::deleteProperty): 21 (KJS::JSObject::findPropertyHashEntry): 22 (KJS::JSObject::propertyIsEnumerable): 23 (KJS::JSObject::getPropertyAttributes): 24 (KJS::JSObject::getPropertyNames): 25 * kjs/object.h: 26 (KJS::ClassInfo::propHashTable): 27 Added a new classPropHashTableGetterFunction field to ClassInfo. If it is non-zero, the 28 static table is not used. 29 30 * kjs/JSGlobalObject.cpp: 31 (KJS::ThreadClassInfoHashTables::ThreadClassInfoHashTables): This new class holds per-thread 32 HashTables for built-in classes. The old static structs are copied to create per-thread 33 instances. 34 (KJS::JSGlobalObject::threadClassInfoHashTables): An accessor/initializer for the above. 35 (KJS::JSGlobalObject::init): Copy per-thread data into a single structure for faster access. 36 Also, construct globalExec. 37 (KJS::JSGlobalObject::reset): Adapted for globalExec now being an OwnPtr. 38 (KJS::JSGlobalObject::mark): Ditto. 39 (KJS::JSGlobalObject::globalExec): Ditto. 40 * kjs/JSGlobalObject.h: 41 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Made JSGlobalObject::JSGlobalObjectData::globalExec an OwnPtr, so that it can 42 be initialized from JSGlobalObject::init() after them. Otherwise, ExecState constructor was 43 trying to access half-initialized JSGlobalObject to make its own copy of these table 44 references, and failed. 45 (KJS::JSGlobalObject::JSGlobalObject): Pass "this" value to init() to create globalExec. 46 (KJS::JSGlobalObject::perThreadData): An accessor for per-thread data. 47 48 * kjs/ExecState.cpp: 49 (KJS::ExecState::ExecState): 50 * kjs/ExecState.h: 51 (KJS::ExecState::propertyNames): 52 (KJS::ExecState::emptyList): 53 (KJS::ExecState::arrayTable): 54 (KJS::ExecState::dateTable): 55 (KJS::ExecState::mathTable): 56 (KJS::ExecState::numberTable): 57 (KJS::ExecState::RegExpImpTable): 58 (KJS::ExecState::RegExpObjectImpTable): 59 (KJS::ExecState::stringTable): 60 * kjs/ExecStateInlines.h: 61 (KJS::ExecState::ExecState): 62 Each ExecState holds its own reference to per-thread data, for even faster access. Moved 63 m_emptyList and m_propertyNames to the same structure, making ExecState faster to construct 64 and take less space on the stack. 65 66 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize thread-static data 67 added to JSGlobalObject. 68 69 * API/JSCallbackConstructor.cpp: 70 (KJS::): 71 * API/JSCallbackFunction.cpp: 72 (KJS::): 73 * API/JSCallbackObject.cpp: 74 (KJS::): 75 * JavaScriptCore.exp: 76 * kjs/JSVariableObject.cpp: 77 (KJS::JSVariableObject::getPropertyAttributes): 78 * kjs/JSVariableObject.h: 79 * kjs/array_instance.cpp: 80 (KJS::): 81 * kjs/array_object.cpp: 82 (KJS::): 83 (KJS::ArrayPrototype::getOwnPropertySlot): 84 * kjs/bool_object.cpp: 85 (KJS::): 86 * kjs/create_hash_table: 87 * kjs/date_object.cpp: 88 (KJS::): 89 (KJS::DatePrototype::getOwnPropertySlot): 90 (KJS::DateObjectImp::DateObjectImp): 91 * kjs/error_object.cpp: 92 (KJS::): 93 * kjs/function.cpp: 94 (KJS::): 95 * kjs/function_object.cpp: 96 (KJS::FunctionPrototype::FunctionPrototype): 97 * kjs/internal.cpp: 98 (KJS::): 99 * kjs/lookup.h: 100 * kjs/math_object.cpp: 101 (KJS::): 102 (KJS::MathObjectImp::getOwnPropertySlot): 103 * kjs/number_object.cpp: 104 (KJS::): 105 (KJS::NumberObjectImp::getOwnPropertySlot): 106 * kjs/object_object.cpp: 107 (KJS::ObjectPrototype::ObjectPrototype): 108 * kjs/regexp_object.cpp: 109 (KJS::): 110 (KJS::RegExpPrototype::RegExpPrototype): 111 (KJS::RegExpImp::getOwnPropertySlot): 112 (KJS::RegExpImp::put): 113 (KJS::RegExpObjectImp::getOwnPropertySlot): 114 (KJS::RegExpObjectImp::put): 115 * kjs/string_object.cpp: 116 (KJS::): 117 (KJS::StringPrototype::getOwnPropertySlot): 118 Adjust for the above changes. 119 1 120 2008-04-28 Darin Adler <darin@apple.com> 2 121 -
trunk/JavaScriptCore/JavaScriptCore.exp
r32609 r32652 108 108 __ZN3KJS14JSGlobalObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 109 109 __ZN3KJS14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierEPNS_7JSValueE 110 __ZN3KJS14JSGlobalObject4initE v110 __ZN3KJS14JSGlobalObject4initEPNS_8JSObjectE 111 111 __ZN3KJS14JSGlobalObject4markEv 112 112 __ZN3KJS14JSGlobalObject5resetEPNS_7JSValueE … … 121 121 __ZN3KJS14StringInstanceC2EPNS_8JSObjectERKNS_7UStringE 122 122 __ZN3KJS15GlobalExecStateC1EPNS_14JSGlobalObjectEPNS_8JSObjectE 123 __ZN3KJS15GlobalExecStateD1Ev 123 124 __ZN3KJS15JSWrapperObject4markEv 124 125 __ZN3KJS16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE … … 238 239 __ZNK3KJS14JSGlobalObject14toGlobalObjectEPNS_9ExecStateE 239 240 __ZNK3KJS16JSVariableObject16isVariableObjectEv 240 __ZNK3KJS16JSVariableObject21getPropertyAttributesE RKNS_10IdentifierERj241 __ZNK3KJS16JSVariableObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj 241 242 __ZNK3KJS19InternalFunctionImp14implementsCallEv 242 243 __ZNK3KJS19InternalFunctionImp21implementsHasInstanceEv … … 267 268 __ZNK3KJS8JSObject14toGlobalObjectEPNS_9ExecStateE 268 269 __ZNK3KJS8JSObject19implementsConstructEv 269 __ZNK3KJS8JSObject21getPropertyAttributesE RKNS_10IdentifierERj270 __ZNK3KJS8JSObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj 270 271 __ZNK3KJS8JSObject21implementsHasInstanceEv 271 272 __ZNK3KJS8JSObject3getEPNS_9ExecStateERKNS_10IdentifierE -
trunk/JavaScriptCore/kjs/ExecState.cpp
r31746 r32652 34 34 namespace KJS { 35 35 36 static inline List* globalEmptyList()37 {38 static List staticEmptyList;39 return &staticEmptyList;40 }41 42 36 // ECMA 10.2 43 37 … … 46 40 : m_globalObject(globalObject) 47 41 , m_exception(0) 48 , m_propertyNames(CommonIdentifiers::shared())49 , m_emptyList(globalEmptyList())50 42 , m_callingExec(0) 43 , m_perThreadData(globalObject->perThreadData()) 51 44 , m_scopeNode(0) 52 45 , m_function(0) … … 68 61 : m_globalObject(globalObject) 69 62 , m_exception(0) 70 , m_propertyNames(CommonIdentifiers::shared())71 , m_emptyList(globalEmptyList())72 63 , m_callingExec(0) 64 , m_perThreadData(globalObject->perThreadData()) 73 65 , m_scopeNode(programNode) 74 66 , m_function(0) … … 91 83 : m_globalObject(globalObject) 92 84 , m_exception(0) 93 , m_propertyNames(callingExec->m_propertyNames)94 , m_emptyList(callingExec->m_emptyList)95 85 , m_callingExec(callingExec) 86 , m_perThreadData(callingExec->m_perThreadData) 96 87 , m_scopeNode(evalNode) 97 88 , m_function(0) -
trunk/JavaScriptCore/kjs/ExecState.h
r32259 r32652 39 39 class FunctionImp; 40 40 class GlobalFuncImp; 41 struct HashTable; 41 42 class Interpreter; 42 43 class JSGlobalObject; … … 46 47 47 48 enum CodeType { GlobalCode, EvalCode, FunctionCode }; 49 50 struct PerThreadData { 51 const HashTable* arrayTable; 52 const HashTable* dateTable; 53 const HashTable* mathTable; 54 const HashTable* numberTable; 55 const HashTable* RegExpImpTable; 56 const HashTable* RegExpObjectImpTable; 57 const HashTable* stringTable; 58 59 CommonIdentifiers* propertyNames; 60 const List emptyList; 61 }; 48 62 49 63 // Represents the current state of script execution. … … 97 111 // These pointers are used to avoid accessing global variables for these, 98 112 // to avoid taking PIC branches in Mach-O binaries. 99 const CommonIdentifiers& propertyNames() const { return *m_propertyNames; } 100 const List& emptyList() const { return *m_emptyList; } 113 const CommonIdentifiers& propertyNames() const { return *m_perThreadData->propertyNames; } 114 const List& emptyList() const { return m_perThreadData->emptyList; } 115 static const HashTable* arrayTable(ExecState* exec) { return exec->m_perThreadData->arrayTable; } 116 static const HashTable* dateTable(ExecState* exec) { return exec->m_perThreadData->dateTable; } 117 static const HashTable* mathTable(ExecState* exec) { return exec->m_perThreadData->mathTable; } 118 static const HashTable* numberTable(ExecState* exec) { return exec->m_perThreadData->numberTable; } 119 static const HashTable* RegExpImpTable(ExecState* exec) { return exec->m_perThreadData->RegExpImpTable; } 120 static const HashTable* RegExpObjectImpTable(ExecState* exec) { return exec->m_perThreadData->RegExpObjectImpTable; } 121 static const HashTable* stringTable(ExecState* exec) { return exec->m_perThreadData->stringTable; } 101 122 102 123 LocalStorage& localStorage() { return *m_localStorage; } … … 177 198 JSGlobalObject* m_globalObject; 178 199 JSValue* m_exception; 179 CommonIdentifiers* m_propertyNames;180 const List* m_emptyList;181 200 182 201 ExecState* m_callingExec; 202 203 const PerThreadData* m_perThreadData; 183 204 184 205 ScopeNode* m_scopeNode; -
trunk/JavaScriptCore/kjs/ExecStateInlines.h
r31746 r32652 36 36 : m_globalObject(globalObject) 37 37 , m_exception(0) 38 , m_propertyNames(callingExec->m_propertyNames)39 , m_emptyList(callingExec->m_emptyList)40 38 , m_callingExec(callingExec) 39 , m_perThreadData(callingExec->m_perThreadData) 41 40 , m_scopeNode(functionBodyNode) 42 41 , m_function(func) -
trunk/JavaScriptCore/kjs/InitializeThreading.cpp
r32322 r32652 34 34 #include "dtoa.h" 35 35 #include "identifier.h" 36 #include "JSGlobalObject.h" 36 37 #include "lexer.h" 37 38 #include "Parser.h" … … 55 56 lexer(); 56 57 initDateMath(); 58 JSGlobalObject::threadClassInfoHashTables(); 57 59 } 58 60 #endif -
trunk/JavaScriptCore/kjs/JSGlobalObject.cpp
r32587 r32652 45 45 #include "string_object.h" 46 46 47 #if USE(MULTIPLE_THREADS) 48 #include <wtf/ThreadSpecific.h> 49 using namespace WTF; 50 #endif 51 47 52 #if HAVE(SYS_TIME_H) 48 53 #include <sys/time.h> … … 58 63 59 64 namespace KJS { 65 66 extern HashTable arrayTable; 67 extern HashTable dateTable; 68 extern HashTable mathTable; 69 extern HashTable numberTable; 70 extern HashTable RegExpImpTable; 71 extern HashTable RegExpObjectImpTable; 72 extern HashTable stringTable; 60 73 61 74 // Default number of ticks before a timeout check should be done. … … 119 132 } 120 133 121 void JSGlobalObject::init() 134 struct ThreadClassInfoHashTables { 135 ThreadClassInfoHashTables() 136 : arrayTable(KJS::arrayTable) 137 , dateTable(KJS::dateTable) 138 , mathTable(KJS::mathTable) 139 , numberTable(KJS::numberTable) 140 , RegExpImpTable(KJS::RegExpImpTable) 141 , RegExpObjectImpTable(KJS::RegExpObjectImpTable) 142 , stringTable(KJS::stringTable) 143 { 144 } 145 146 ~ThreadClassInfoHashTables() 147 { 148 #if USE(MULTIPLE_THREADS) 149 delete[] arrayTable.table; 150 delete[] dateTable.table; 151 delete[] mathTable.table; 152 delete[] numberTable.table; 153 delete[] RegExpImpTable.table; 154 delete[] RegExpObjectImpTable.table; 155 delete[] stringTable.table; 156 #endif 157 } 158 159 #if USE(MULTIPLE_THREADS) 160 HashTable arrayTable; 161 HashTable dateTable; 162 HashTable mathTable; 163 HashTable numberTable; 164 HashTable RegExpImpTable; 165 HashTable RegExpObjectImpTable; 166 HashTable stringTable; 167 #else 168 HashTable& arrayTable; 169 HashTable& dateTable; 170 HashTable& mathTable; 171 HashTable& numberTable; 172 HashTable& RegExpImpTable; 173 HashTable& RegExpObjectImpTable; 174 HashTable& stringTable; 175 #endif 176 }; 177 178 ThreadClassInfoHashTables* JSGlobalObject::threadClassInfoHashTables() 179 { 180 #if USE(MULTIPLE_THREADS) 181 static ThreadSpecific<ThreadClassInfoHashTables> sharedInstance; 182 return sharedInstance; 183 #else 184 static ThreadClassInfoHashTables sharedInstance; 185 return &sharedInstance; 186 #endif 187 } 188 189 void JSGlobalObject::init(JSObject* thisValue) 122 190 { 123 191 ASSERT(JSLock::currentThreadIsHoldingLock()); … … 142 210 d()->activations = newStackNode; 143 211 d()->activationCount = 0; 212 213 d()->perThreadData.arrayTable = &threadClassInfoHashTables()->arrayTable; 214 d()->perThreadData.dateTable = &threadClassInfoHashTables()->dateTable; 215 d()->perThreadData.mathTable = &threadClassInfoHashTables()->mathTable; 216 d()->perThreadData.numberTable = &threadClassInfoHashTables()->numberTable; 217 d()->perThreadData.RegExpImpTable = &threadClassInfoHashTables()->RegExpImpTable; 218 d()->perThreadData.RegExpObjectImpTable = &threadClassInfoHashTables()->RegExpObjectImpTable; 219 d()->perThreadData.stringTable = &threadClassInfoHashTables()->stringTable; 220 d()->perThreadData.propertyNames = CommonIdentifiers::shared(); 221 222 d()->globalExec.set(new GlobalExecState(this, thisValue)); 144 223 145 224 d()->pageGroupIdentifier = 0; … … 232 311 d()->evalFunction = 0; 233 312 234 ExecState* exec = &d()->globalExec;313 ExecState* exec = d()->globalExec.get(); 235 314 236 315 // Prototypes … … 419 498 (*it)->m_scopeChain.mark(); 420 499 421 markIfNeeded(d()->globalExec .exception());500 markIfNeeded(d()->globalExec->exception()); 422 501 423 502 markIfNeeded(d()->objectConstructor); … … 463 542 ExecState* JSGlobalObject::globalExec() 464 543 { 465 return &d()->globalExec;544 return d()->globalExec.get(); 466 545 } 467 546 … … 493 572 } 494 573 574 495 575 } // namespace KJS -
trunk/JavaScriptCore/kjs/JSGlobalObject.h
r32587 r32652 43 43 class FunctionObjectImp; 44 44 class FunctionPrototype; 45 struct HashTable; 45 46 class JSGlobalObject; 46 47 class NativeErrorImp; … … 68 69 class UriErrorPrototype; 69 70 struct ActivationStackNode; 71 struct ThreadClassInfoHashTables; 70 72 71 73 typedef Vector<ExecState*, 16> ExecStateStack; … … 76 78 77 79 struct JSGlobalObjectData : public JSVariableObjectData { 78 JSGlobalObjectData( JSGlobalObject* globalObject, JSObject* thisValue)80 JSGlobalObjectData() 79 81 : JSVariableObjectData(&inlineSymbolTable) 80 , globalExec(globalObject, thisValue)81 82 { 82 83 } … … 87 88 Debugger* debugger; 88 89 89 GlobalExecStateglobalExec;90 OwnPtr<GlobalExecState> globalExec; 90 91 int recursion; 91 92 … … 141 142 142 143 OwnPtr<HashSet<JSObject*> > arrayVisitedElements; // Global data shared by array prototype functions. 144 145 PerThreadData perThreadData; 143 146 }; 144 147 145 148 public: 146 149 JSGlobalObject() 147 : JSVariableObject(new JSGlobalObjectData (this, this))150 : JSVariableObject(new JSGlobalObjectData) 148 151 { 149 init( );152 init(this); 150 153 } 151 154 152 155 protected: 153 156 JSGlobalObject(JSValue* proto, JSObject* globalThisValue) 154 : JSVariableObject(proto, new JSGlobalObjectData (this, globalThisValue))157 : JSVariableObject(proto, new JSGlobalObjectData) 155 158 { 156 init( );159 init(globalThisValue); 157 160 } 158 161 … … 247 250 HashSet<JSObject*>& arrayVisitedElements() { if (!d()->arrayVisitedElements) d()->arrayVisitedElements.set(new HashSet<JSObject*>); return *d()->arrayVisitedElements; } 248 251 252 // Per-thread hash tables, cached on the global object for faster access. 253 const PerThreadData* perThreadData() const { return &d()->perThreadData; } 254 255 // Initialize and/or retrieve per-thread hash tables - use perThreadData() for faster access instead. 256 static ThreadClassInfoHashTables* threadClassInfoHashTables(); 257 249 258 private: 250 void init( );259 void init(JSObject* thisValue); 251 260 252 261 JSGlobalObjectData* d() const { return static_cast<JSGlobalObjectData*>(JSVariableObject::d); } -
trunk/JavaScriptCore/kjs/JSVariableObject.cpp
r32609 r32652 54 54 } 55 55 56 bool JSVariableObject::getPropertyAttributes( const Identifier& propertyName, unsigned& attributes) const56 bool JSVariableObject::getPropertyAttributes(ExecState* exec, const Identifier& propertyName, unsigned& attributes) const 57 57 { 58 58 size_t index = symbolTable().get(propertyName.ustring().rep()); … … 61 61 return true; 62 62 } 63 return JSObject::getPropertyAttributes( propertyName, attributes);63 return JSObject::getPropertyAttributes(exec, propertyName, attributes); 64 64 } 65 65 -
trunk/JavaScriptCore/kjs/JSVariableObject.h
r32609 r32652 51 51 virtual bool isDynamicScope() const = 0; 52 52 53 virtual bool getPropertyAttributes( const Identifier& propertyName, unsigned& attributes) const;53 virtual bool getPropertyAttributes(ExecState*, const Identifier& propertyName, unsigned& attributes) const; 54 54 55 55 protected: -
trunk/JavaScriptCore/kjs/array_instance.cpp
r32609 r32652 51 51 static const unsigned copyingSortCutoff = 50000; 52 52 53 const ClassInfo ArrayInstance::info = {"Array", 0, 0 };53 const ClassInfo ArrayInstance::info = {"Array", 0, 0, 0}; 54 54 55 55 static inline size_t storageSize(unsigned vectorLength) -
trunk/JavaScriptCore/kjs/array_object.cpp
r31807 r32652 39 39 // ------------------------------ ArrayPrototype ---------------------------- 40 40 41 const ClassInfo ArrayPrototype::info = {"Array", &ArrayInstance::info, &arrayTable};41 const ClassInfo ArrayPrototype::info = {"Array", &ArrayInstance::info, 0, ExecState::arrayTable}; 42 42 43 43 /* Source for array_object.lut.h … … 73 73 bool ArrayPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 74 74 { 75 return getStaticFunctionSlot<ArrayInstance>(exec, &arrayTable, this, propertyName, slot);75 return getStaticFunctionSlot<ArrayInstance>(exec, ExecState::arrayTable(exec), this, propertyName, slot); 76 76 } 77 77 -
trunk/JavaScriptCore/kjs/bool_object.cpp
r31730 r32652 31 31 // ------------------------------ BooleanInstance --------------------------- 32 32 33 const ClassInfo BooleanInstance::info = { "Boolean", 0, 0 };33 const ClassInfo BooleanInstance::info = { "Boolean", 0, 0, 0 }; 34 34 35 35 BooleanInstance::BooleanInstance(JSObject* proto) -
trunk/JavaScriptCore/kjs/create_hash_table
r31147 r32652 203 203 print " { 0, 0, 0, 0 }\n"; 204 204 print "};\n\n"; 205 print " const struct HashTable $name = ";205 print "extern const struct HashTable $name = "; 206 206 print "\{ ", $size - 1, ", $nameEntries, 0 \};\n\n"; 207 207 print "} // namespace\n"; -
trunk/JavaScriptCore/kjs/date_object.cpp
r31943 r32652 331 331 // ------------------------------ DateInstance ------------------------------ 332 332 333 const ClassInfo DateInstance::info = {"Date", 0, 0 };333 const ClassInfo DateInstance::info = {"Date", 0, 0, 0}; 334 334 335 335 DateInstance::DateInstance(JSObject *proto) … … 417 417 // ------------------------------ DatePrototype ----------------------------- 418 418 419 const ClassInfo DatePrototype::info = {"Date", &DateInstance::info, &dateTable};419 const ClassInfo DatePrototype::info = {"Date", &DateInstance::info, 0, ExecState::dateTable}; 420 420 421 421 /* Source for date_object.lut.h … … 479 479 bool DatePrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 480 480 { 481 return getStaticFunctionSlot<JSObject>(exec, &dateTable, this, propertyName, slot);481 return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), this, propertyName, slot); 482 482 } 483 483 … … 490 490 { 491 491 putDirect(exec->propertyNames().prototype, dateProto, DontEnum|DontDelete|ReadOnly); 492 putDirectFunction(new DateObjectFuncImp(exec, funcProto, DateObjectFuncImp::Parse, 1, CommonIdentifiers::shared()->parse), DontEnum);493 putDirectFunction(new DateObjectFuncImp(exec, funcProto, DateObjectFuncImp::UTC, 7, CommonIdentifiers::shared()->UTC), DontEnum);492 putDirectFunction(new DateObjectFuncImp(exec, funcProto, DateObjectFuncImp::Parse, 1, exec->propertyNames().parse), DontEnum); 493 putDirectFunction(new DateObjectFuncImp(exec, funcProto, DateObjectFuncImp::UTC, 7, exec->propertyNames().UTC), DontEnum); 494 494 putDirect(exec->propertyNames().length, 7, ReadOnly|DontDelete|DontEnum); 495 495 } -
trunk/JavaScriptCore/kjs/error_object.cpp
r30040 r32652 32 32 // ------------------------------ ErrorInstance ---------------------------- 33 33 34 const ClassInfo ErrorInstance::info = { "Error", 0, 0 };34 const ClassInfo ErrorInstance::info = { "Error", 0, 0, 0 }; 35 35 36 36 ErrorInstance::ErrorInstance(JSObject* prototype) … … 115 115 // ------------------------------ NativeErrorImp ------------------------------- 116 116 117 const ClassInfo NativeErrorImp::info = { "Function", &InternalFunctionImp::info, 0 };117 const ClassInfo NativeErrorImp::info = { "Function", &InternalFunctionImp::info, 0, 0 }; 118 118 119 119 NativeErrorImp::NativeErrorImp(ExecState* exec, FunctionPrototype* funcProto, NativeErrorPrototype* prot) -
trunk/JavaScriptCore/kjs/function.cpp
r32609 r32652 58 58 // ----------------------------- FunctionImp ---------------------------------- 59 59 60 const ClassInfo FunctionImp::info = { "Function", &InternalFunctionImp::info, 0 };60 const ClassInfo FunctionImp::info = { "Function", &InternalFunctionImp::info, 0, 0 }; 61 61 62 62 FunctionImp::FunctionImp(ExecState* exec, const Identifier& name, FunctionBodyNode* b, const ScopeChain& sc) … … 280 280 // ------------------------------ Arguments --------------------------------- 281 281 282 const ClassInfo Arguments::info = { "Arguments", 0, 0 };282 const ClassInfo Arguments::info = { "Arguments", 0, 0, 0 }; 283 283 284 284 // ECMA 10.1.8 … … 343 343 // ------------------------------ ActivationImp -------------------------------- 344 344 345 const ClassInfo ActivationImp::info = { "Activation", 0, 0 };345 const ClassInfo ActivationImp::info = { "Activation", 0, 0, 0 }; 346 346 347 347 ActivationImp::ActivationImp(const ActivationData& oldData, bool leaveRelic) -
trunk/JavaScriptCore/kjs/function_object.cpp
r31746 r32652 48 48 49 49 putDirectFunction(new PrototypeFunction(exec, this, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum); 50 putDirectFunction(new PrototypeFunction(exec, this, 2, CommonIdentifiers::shared()->apply, functionProtoFuncApply), DontEnum);51 putDirectFunction(new PrototypeFunction(exec, this, 1, CommonIdentifiers::shared()->call, functionProtoFuncCall), DontEnum);50 putDirectFunction(new PrototypeFunction(exec, this, 2, exec->propertyNames().apply, functionProtoFuncApply), DontEnum); 51 putDirectFunction(new PrototypeFunction(exec, this, 1, exec->propertyNames().call, functionProtoFuncCall), DontEnum); 52 52 } 53 53 -
trunk/JavaScriptCore/kjs/internal.cpp
r32609 r32652 221 221 // ------------------------------ InternalFunctionImp -------------------------- 222 222 223 const ClassInfo InternalFunctionImp::info = { "Function", 0, 0 };223 const ClassInfo InternalFunctionImp::info = { "Function", 0, 0, 0 }; 224 224 225 225 InternalFunctionImp::InternalFunctionImp() -
trunk/JavaScriptCore/kjs/lexer.cpp
r31948 r32652 89 89 , next2(0) 90 90 , next3(0) 91 , mainTable(KJS::mainTable) 91 92 { 92 93 m_buffer8.reserveCapacity(initialReadBufferCapacity); … … 94 95 m_strings.reserveCapacity(initialStringTableCapacity); 95 96 m_identifiers.reserveCapacity(initialStringTableCapacity); 97 } 98 99 Lexer::~Lexer() 100 { 101 delete[] mainTable.table; 96 102 } 97 103 -
trunk/JavaScriptCore/kjs/lexer.h
r31944 r32652 25 25 #define Lexer_h 26 26 27 #include "lookup.h" 27 28 #include "ustring.h" 28 29 #include <wtf/Vector.h> … … 95 96 friend class WTF::ThreadSpecific<Lexer>; 96 97 Lexer(); 98 ~Lexer(); 97 99 98 100 int yylineno; … … 146 148 UString m_pattern; 147 149 UString m_flags; 150 151 const HashTable mainTable; 148 152 }; 149 153 -
trunk/JavaScriptCore/kjs/lookup.h
r31208 r32652 282 282 283 283 #define KJS_IMPLEMENT_PROTOTYPE(ClassName, ClassPrototype) \ 284 const ClassInfo ClassPrototype::info = { ClassName"Prototype", 0, &ClassPrototype##Table }; \284 const ClassInfo ClassPrototype::info = { ClassName"Prototype", 0, &ClassPrototype##Table, 0 }; \ 285 285 JSObject* ClassPrototype::self(ExecState* exec) \ 286 286 { \ -
trunk/JavaScriptCore/kjs/math_object.cpp
r31560 r32652 32 32 // ------------------------------ MathObjectImp -------------------------------- 33 33 34 const ClassInfo MathObjectImp::info = { "Math", 0, &mathTable };34 const ClassInfo MathObjectImp::info = { "Math", 0, 0, ExecState::mathTable }; 35 35 36 36 /* Source for math_object.lut.h … … 74 74 bool MathObjectImp::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 75 75 { 76 return getStaticPropertySlot<MathObjectImp, JSObject>(exec, &mathTable, this, propertyName, slot);76 return getStaticPropertySlot<MathObjectImp, JSObject>(exec, ExecState::mathTable(exec), this, propertyName, slot); 77 77 } 78 78 -
trunk/JavaScriptCore/kjs/number_object.cpp
r31948 r32652 35 35 // ------------------------------ NumberInstance ---------------------------- 36 36 37 const ClassInfo NumberInstance::info = { "Number", 0, 0 };37 const ClassInfo NumberInstance::info = { "Number", 0, 0, 0 }; 38 38 39 39 NumberInstance::NumberInstance(JSObject* proto) … … 451 451 // ------------------------------ NumberObjectImp ------------------------------ 452 452 453 const ClassInfo NumberObjectImp::info = { "Function", &InternalFunctionImp::info, &numberTable };453 const ClassInfo NumberObjectImp::info = { "Function", &InternalFunctionImp::info, 0, ExecState::numberTable }; 454 454 455 455 /* Source for number_object.lut.h … … 474 474 bool NumberObjectImp::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 475 475 { 476 return getStaticValueSlot<NumberObjectImp, InternalFunctionImp>(exec, &numberTable, this, propertyName, slot);476 return getStaticValueSlot<NumberObjectImp, InternalFunctionImp>(exec, ExecState::numberTable(exec), this, propertyName, slot); 477 477 } 478 478 -
trunk/JavaScriptCore/kjs/object.cpp
r32609 r32652 28 28 #include "date_object.h" 29 29 #include "error_object.h" 30 #include "lookup.h"31 30 #include "nodes.h" 32 31 #include "operations.h" … … 319 318 320 319 // ECMA 8.6.2.5 321 bool JSObject::deleteProperty(ExecState* /*exec*/, const Identifier &propertyName)320 bool JSObject::deleteProperty(ExecState* exec, const Identifier &propertyName) 322 321 { 323 322 unsigned attributes; … … 333 332 334 333 // Look in the static hashtable of properties 335 const HashEntry* entry = findPropertyHashEntry( propertyName);334 const HashEntry* entry = findPropertyHashEntry(exec, propertyName); 336 335 if (entry && entry->attributes & DontDelete) 337 336 return false; // this builtin property can't be deleted … … 396 395 } 397 396 398 const HashEntry* JSObject::findPropertyHashEntry( const Identifier& propertyName) const397 const HashEntry* JSObject::findPropertyHashEntry(ExecState* exec, const Identifier& propertyName) const 399 398 { 400 399 for (const ClassInfo* info = classInfo(); info; info = info->parentClass) { 401 if (const HashTable* propHashTable = info->propHashTable ) {400 if (const HashTable* propHashTable = info->propHashTable(exec)) { 402 401 if (const HashEntry* e = propHashTable->entry(propertyName)) 403 402 return e; … … 530 529 } 531 530 532 bool JSObject::propertyIsEnumerable(ExecState* , const Identifier& propertyName) const531 bool JSObject::propertyIsEnumerable(ExecState* exec, const Identifier& propertyName) const 533 532 { 534 533 unsigned attributes; 535 534 536 if (!getPropertyAttributes( propertyName, attributes))535 if (!getPropertyAttributes(exec, propertyName, attributes)) 537 536 return false; 538 537 else … … 540 539 } 541 540 542 bool JSObject::getPropertyAttributes( const Identifier& propertyName, unsigned& attributes) const541 bool JSObject::getPropertyAttributes(ExecState* exec, const Identifier& propertyName, unsigned& attributes) const 543 542 { 544 543 if (_prop.get(propertyName, attributes)) … … 546 545 547 546 // Look in the static hashtable of properties 548 const HashEntry* e = findPropertyHashEntry( propertyName);547 const HashEntry* e = findPropertyHashEntry(exec, propertyName); 549 548 if (e) { 550 549 attributes = e->attributes; … … 561 560 // Add properties from the static hashtables of properties 562 561 for (const ClassInfo* info = classInfo(); info; info = info->parentClass) { 563 const HashTable* table = info->propHashTable ;562 const HashTable* table = info->propHashTable(exec); 564 563 if (!table) 565 564 continue; -
trunk/JavaScriptCore/kjs/object.h
r32587 r32652 66 66 /** 67 67 * Static hash-table of properties. 68 */ 69 const HashTable* propHashTable; 68 * For classes that can be used from multiple threads, it is accessed via a getter function that would typically return a pointer to thread-specific value. 69 */ 70 const HashTable* propHashTable(ExecState* exec) const 71 { 72 if (classPropHashTableGetterFunction) 73 return classPropHashTableGetterFunction(exec); 74 return staticPropHashTable; 75 } 76 77 const HashTable* staticPropHashTable; 78 typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*); 79 const ClassPropHashTableGetterFunction classPropHashTableGetterFunction; 70 80 }; 71 81 … … 146 156 * 147 157 * \code 148 * const ClassInfo BarImp::info = { "Bar", 0, 0 }; // no parent class149 * const ClassInfo FooImp::info = { "Foo", &BarImp::info, 0 };158 * const ClassInfo BarImp::info = { "Bar", 0, 0, 0 }; // no parent class 159 * const ClassInfo FooImp::info = { "Foo", &BarImp::info, 0, 0 }; 150 160 * \endcode 151 161 * … … 410 420 virtual JSGlobalObject* toGlobalObject(ExecState*) const; 411 421 412 virtual bool getPropertyAttributes( const Identifier& propertyName, unsigned& attributes) const;422 virtual bool getPropertyAttributes(ExecState*, const Identifier& propertyName, unsigned& attributes) const; 413 423 414 424 // WebCore uses this to make document.all and style.filter undetectable … … 444 454 445 455 private: 446 const HashEntry* findPropertyHashEntry( const Identifier& propertyName) const;456 const HashEntry* findPropertyHashEntry(ExecState*, const Identifier& propertyName) const; 447 457 JSValue *_proto; 448 458 }; -
trunk/JavaScriptCore/kjs/object_object.cpp
r31746 r32652 47 47 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toLocaleString, objectProtoFuncToLocaleString), DontEnum); 48 48 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().valueOf, objectProtoFuncValueOf), DontEnum); 49 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, CommonIdentifiers::shared()->hasOwnProperty, objectProtoFuncHasOwnProperty), DontEnum);50 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, CommonIdentifiers::shared()->propertyIsEnumerable, objectProtoFuncPropertyIsEnumerable), DontEnum);51 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, CommonIdentifiers::shared()->isPrototypeOf, objectProtoFuncIsPrototypeOf), DontEnum);49 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().hasOwnProperty, objectProtoFuncHasOwnProperty), DontEnum); 50 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().propertyIsEnumerable, objectProtoFuncPropertyIsEnumerable), DontEnum); 51 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().isPrototypeOf, objectProtoFuncIsPrototypeOf), DontEnum); 52 52 53 53 // Mozilla extensions 54 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 2, CommonIdentifiers::shared()->__defineGetter__, objectProtoFuncDefineGetter), DontEnum);55 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 2, CommonIdentifiers::shared()->__defineSetter__, objectProtoFuncDefineSetter), DontEnum);56 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, CommonIdentifiers::shared()->__lookupGetter__, objectProtoFuncLookupGetter), DontEnum);57 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, CommonIdentifiers::shared()->__lookupSetter__, objectProtoFuncLookupSetter), DontEnum);54 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 2, exec->propertyNames().__defineGetter__, objectProtoFuncDefineGetter), DontEnum); 55 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 2, exec->propertyNames().__defineSetter__, objectProtoFuncDefineSetter), DontEnum); 56 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().__lookupGetter__, objectProtoFuncLookupGetter), DontEnum); 57 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().__lookupSetter__, objectProtoFuncLookupSetter), DontEnum); 58 58 } 59 59 -
trunk/JavaScriptCore/kjs/regexp_object.cpp
r31208 r32652 47 47 // ECMA 15.10.5 48 48 49 const ClassInfo RegExpPrototype::info = { "RegExpPrototype", 0, 0 };49 const ClassInfo RegExpPrototype::info = { "RegExpPrototype", 0, 0, 0 }; 50 50 51 51 RegExpPrototype::RegExpPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype) 52 52 : JSObject(objectPrototype) 53 53 { 54 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 0, CommonIdentifiers::shared()->compile, regExpProtoFuncCompile), DontEnum);55 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 0, CommonIdentifiers::shared()->exec, regExpProtoFuncExec), DontEnum);56 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 0, CommonIdentifiers::shared()->test, regExpProtoFuncTest), DontEnum);54 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().compile, regExpProtoFuncCompile), DontEnum); 55 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().exec, regExpProtoFuncExec), DontEnum); 56 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().test, regExpProtoFuncTest), DontEnum); 57 57 putDirectFunction(new PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, regExpProtoFuncToString), DontEnum); 58 58 } … … 123 123 // ------------------------------ RegExpImp ------------------------------------ 124 124 125 const ClassInfo RegExpImp::info = { "RegExp", 0, &RegExpImpTable };125 const ClassInfo RegExpImp::info = { "RegExp", 0, 0, ExecState::RegExpImpTable }; 126 126 127 127 /* Source for regexp_object.lut.h … … 148 148 bool RegExpImp::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 149 149 { 150 return getStaticValueSlot<RegExpImp, JSObject>(exec, &RegExpImpTable, this, propertyName, slot);150 return getStaticValueSlot<RegExpImp, JSObject>(exec, ExecState::RegExpImpTable(exec), this, propertyName, slot); 151 151 } 152 152 … … 172 172 void RegExpImp::put(ExecState* exec, const Identifier& propertyName, JSValue* value) 173 173 { 174 lookupPut<RegExpImp, JSObject>(exec, propertyName, value, &RegExpImpTable, this);174 lookupPut<RegExpImp, JSObject>(exec, propertyName, value, ExecState::RegExpImpTable(exec), this); 175 175 } 176 176 … … 243 243 // ------------------------------ RegExpObjectImp ------------------------------ 244 244 245 const ClassInfo RegExpObjectImp::info = { "Function", &InternalFunctionImp::info, &RegExpObjectImpTable };245 const ClassInfo RegExpObjectImp::info = { "Function", &InternalFunctionImp::info, 0, ExecState::RegExpObjectImpTable }; 246 246 247 247 /* Source for regexp_object.lut.h … … 364 364 bool RegExpObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) 365 365 { 366 return getStaticValueSlot<RegExpObjectImp, InternalFunctionImp>(exec, &RegExpObjectImpTable, this, propertyName, slot);366 return getStaticValueSlot<RegExpObjectImp, InternalFunctionImp>(exec, ExecState::RegExpObjectImpTable(exec), this, propertyName, slot); 367 367 } 368 368 … … 409 409 void RegExpObjectImp::put(ExecState *exec, const Identifier &propertyName, JSValue *value) 410 410 { 411 lookupPut<RegExpObjectImp, InternalFunctionImp>(exec, propertyName, value, &RegExpObjectImpTable, this);411 lookupPut<RegExpObjectImp, InternalFunctionImp>(exec, propertyName, value, ExecState::RegExpObjectImpTable(exec), this); 412 412 } 413 413 -
trunk/JavaScriptCore/kjs/string_object.cpp
r31746 r32652 39 39 // ------------------------------ StringInstance ---------------------------- 40 40 41 const ClassInfo StringInstance::info = { "String", 0, 0 };41 const ClassInfo StringInstance::info = { "String", 0, 0, 0 }; 42 42 43 43 StringInstance::StringInstance(JSObject *proto) … … 126 126 127 127 // ------------------------------ StringPrototype --------------------------- 128 const ClassInfo StringPrototype::info = { "String", &StringInstance::info, &stringTable };128 const ClassInfo StringPrototype::info = { "String", &StringInstance::info, 0, ExecState::stringTable }; 129 129 /* Source for string_object.lut.h 130 130 @begin stringTable 26 … … 174 174 bool StringPrototype::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot) 175 175 { 176 return getStaticFunctionSlot<StringInstance>(exec, &stringTable, this, propertyName, slot);176 return getStaticFunctionSlot<StringInstance>(exec, ExecState::stringTable(exec), this, propertyName, slot); 177 177 } 178 178 -
trunk/JavaScriptGlue/ChangeLog
r32588 r32652 1 2008-04-25 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin. 4 5 Fix run-webkit-tests --threading 6 and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661> 7 Proxy server issue in Sunday's Nightly 8 9 * UserObjectImp.cpp: Adjusted for the new member added to ClassInfo. 10 1 11 2008-04-25 Mark Rowe <mrowe@apple.com> 2 12 -
trunk/JavaScriptGlue/UserObjectImp.cpp
r28110 r32652 31 31 #include <JavaScriptCore/PropertyNameArray.h> 32 32 33 const ClassInfo UserObjectImp::info = { "UserObject", 0, 0 };33 const ClassInfo UserObjectImp::info = { "UserObject", 0, 0, 0 }; 34 34 35 35 UserObjectImp::UserObjectImp(JSUserObject* userObject) -
trunk/WebCore/ChangeLog
r32651 r32652 1 2008-04-25 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin. 4 5 Fix run-webkit-tests --threading 6 and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661> 7 Proxy server issue in Sunday's Nightly 8 9 Adjusted for JavaScriptCore changes: added a new member to ClassInfo objects, turned 10 ClassInfo::propHashTable into a function, made getPropertyAttributes() take an ExecState pointer. 11 12 * bindings/js/JSAudioConstructor.cpp: 13 (WebCore::): 14 * bindings/js/JSDOMWindowBase.cpp: 15 (WebCore::): 16 * bindings/js/JSDOMWindowCustom.cpp: 17 (WebCore::JSDOMWindow::customGetOwnPropertySlot): 18 * bindings/js/JSDOMWindowWrapper.cpp: 19 (WebCore::): 20 (WebCore::JSDOMWindowWrapper::getPropertyAttributes): 21 * bindings/js/JSDOMWindowWrapper.h: 22 * bindings/js/JSEventTargetBase.h: 23 (WebCore::JSEventTargetPrototype::classInfo): 24 * bindings/js/JSHTMLInputElementBase.cpp: 25 (WebCore::): 26 * bindings/js/JSHTMLOptionElementConstructor.cpp: 27 (WebCore::): 28 * bindings/js/JSHistoryCustom.cpp: 29 (WebCore::JSHistory::customGetOwnPropertySlot): 30 * bindings/js/JSImageConstructor.cpp: 31 (WebCore::): 32 * bindings/js/JSInspectedObjectWrapper.cpp: 33 (WebCore::): 34 * bindings/js/JSInspectorCallbackWrapper.cpp: 35 (WebCore::): 36 * bindings/js/JSLocationCustom.cpp: 37 (WebCore::JSLocation::customGetOwnPropertySlot): 38 (WebCore::JSLocation::customPut): 39 * bindings/js/JSNamedNodesCollection.cpp: 40 (WebCore::): 41 * bindings/js/JSQuarantinedObjectWrapper.cpp: 42 (WebCore::): 43 * bindings/js/JSRGBColor.cpp: 44 (WebCore::): 45 * bindings/js/JSStorageCustom.cpp: 46 (WebCore::JSStorage::customPut): 47 * bindings/js/JSXMLHttpRequestConstructor.cpp: 48 (WebCore::): 49 * bindings/js/JSXSLTProcessor.cpp: 50 (WebCore::): 51 * bindings/scripts/CodeGeneratorJS.pm: 52 * bridge/objc/objc_runtime.mm: 53 * bridge/runtime_array.cpp: 54 * bridge/runtime_object.cpp: 55 1 56 2008-04-28 David Hyatt <hyatt@apple.com> 2 57 -
trunk/WebCore/bindings/js/JSAudioConstructor.cpp
r31220 r32652 38 38 namespace WebCore { 39 39 40 const ClassInfo JSAudioConstructor::s_info = { "AudioConstructor", 0, 0 };40 const ClassInfo JSAudioConstructor::s_info = { "AudioConstructor", 0, 0, 0 }; 41 41 42 42 JSAudioConstructor::JSAudioConstructor(ExecState* exec, Document* document) -
trunk/WebCore/bindings/js/JSDOMWindowBase.cpp
r32585 r32652 138 138 ////////////////////// JSDOMWindowBase Object //////////////////////// 139 139 140 const ClassInfo JSDOMWindowBase::s_info = { "Window", 0, &JSDOMWindowBaseTable };140 const ClassInfo JSDOMWindowBase::s_info = { "Window", 0, &JSDOMWindowBaseTable, 0 }; 141 141 142 142 /* -
trunk/WebCore/bindings/js/JSDOMWindowCustom.cpp
r32597 r32652 83 83 // The following code is safe for cross-domain and same domain use. 84 84 // It ignores any custom properties that might be set on the DOMWindow (including a custom prototype). 85 entry = s_info.propHashTable ->entry(propertyName);85 entry = s_info.propHashTable(exec)->entry(propertyName); 86 86 if (entry && !(entry->attributes & Function) && entry->integerValue == ClosedAttrNum) { 87 87 slot.setStaticEntry(this, entry, staticValueGetter<JSDOMWindow>); 88 88 return true; 89 89 } 90 entry = JSDOMWindowPrototype::s_info.propHashTable ->entry(propertyName);90 entry = JSDOMWindowPrototype::s_info.propHashTable(exec)->entry(propertyName); 91 91 if (entry && (entry->attributes & Function) && entry->functionValue == jsDOMWindowPrototypeFunctionClose) { 92 92 slot.setStaticEntry(this, entry, nonCachingStaticFunctionGetter); … … 116 116 // Also, it's important to get the implementation straight out of the DOMWindow prototype regardless of 117 117 // what prototype is actually set on this object. 118 entry = JSDOMWindowPrototype::s_info.propHashTable ->entry(propertyName);118 entry = JSDOMWindowPrototype::s_info.propHashTable(exec)->entry(propertyName); 119 119 if (entry) { 120 120 if ((entry->attributes & Function) -
trunk/WebCore/bindings/js/JSDOMWindowWrapper.cpp
r31962 r32652 40 40 namespace WebCore { 41 41 42 const ClassInfo JSDOMWindowWrapper::s_info = { "JSDOMWindowWrapper", 0, 0 };42 const ClassInfo JSDOMWindowWrapper::s_info = { "JSDOMWindowWrapper", 0, 0, 0 }; 43 43 44 44 JSDOMWindowWrapper::JSDOMWindowWrapper(DOMWindow* domWindow) … … 95 95 } 96 96 97 bool JSDOMWindowWrapper::getPropertyAttributes( const Identifier& propertyName, unsigned& attributes) const97 bool JSDOMWindowWrapper::getPropertyAttributes(KJS::ExecState* exec, const Identifier& propertyName, unsigned& attributes) const 98 98 { 99 return m_window->getPropertyAttributes( propertyName, attributes);99 return m_window->getPropertyAttributes(exec, propertyName, attributes); 100 100 } 101 101 -
trunk/WebCore/bindings/js/JSDOMWindowWrapper.h
r31962 r32652 65 65 virtual bool deleteProperty(KJS::ExecState*, const KJS::Identifier& propertyName); 66 66 virtual void getPropertyNames(KJS::ExecState*, KJS::PropertyNameArray&); 67 virtual bool getPropertyAttributes( const KJS::Identifier& propertyName, unsigned& attributes) const;67 virtual bool getPropertyAttributes(KJS::ExecState*, const KJS::Identifier& propertyName, unsigned& attributes) const; 68 68 virtual void defineGetter(KJS::ExecState*, const KJS::Identifier& propertyName, KJS::JSObject* getterFunction); 69 69 virtual void defineSetter(KJS::ExecState*, const KJS::Identifier& propertyName, KJS::JSObject* setterFunction); -
trunk/WebCore/bindings/js/JSEventTargetBase.h
r31397 r32652 145 145 virtual const KJS::ClassInfo* classInfo() const 146 146 { 147 static const KJS::ClassInfo s_classInfo = { JSEventTargetPrototypeInformation::prototypeClassName(), 0, &KJS::JSEventTargetPrototypeTable };147 static const KJS::ClassInfo s_classInfo = { JSEventTargetPrototypeInformation::prototypeClassName(), 0, &KJS::JSEventTargetPrototypeTable, 0 }; 148 148 return &s_classInfo; 149 149 } -
trunk/WebCore/bindings/js/JSHTMLInputElementBase.cpp
r31220 r32652 50 50 } 51 51 52 const ClassInfo JSHTMLInputElementBase::s_info = { "HTMLInputElementBase", &JSHTMLElement::s_info, &JSHTMLInputElementBaseTable };52 const ClassInfo JSHTMLInputElementBase::s_info = { "HTMLInputElementBase", &JSHTMLElement::s_info, &JSHTMLInputElementBaseTable, 0 }; 53 53 54 54 JSHTMLInputElementBase::JSHTMLInputElementBase(KJS::JSObject* prototype, PassRefPtr<HTMLInputElement> e) -
trunk/WebCore/bindings/js/JSHTMLOptionElementConstructor.cpp
r31220 r32652 30 30 namespace WebCore { 31 31 32 const ClassInfo JSHTMLOptionElementConstructor::s_info = { "OptionConstructor", 0, 0 };32 const ClassInfo JSHTMLOptionElementConstructor::s_info = { "OptionConstructor", 0, 0, 0 }; 33 33 34 34 JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor(ExecState* exec, Document* document) -
trunk/WebCore/bindings/js/JSHistoryCustom.cpp
r31220 r32652 49 49 50 50 // Check for the few functions that we allow, even when called cross-domain. 51 const HashEntry* entry = JSHistoryPrototype::s_info.propHashTable ->entry(propertyName);51 const HashEntry* entry = JSHistoryPrototype::s_info.propHashTable(exec)->entry(propertyName); 52 52 if (entry) { 53 53 // Allow access to back(), forward() and go() from any frame. -
trunk/WebCore/bindings/js/JSImageConstructor.cpp
r31220 r32652 29 29 namespace WebCore { 30 30 31 const ClassInfo JSImageConstructor::s_info = { "ImageConstructor", 0, 0 };31 const ClassInfo JSImageConstructor::s_info = { "ImageConstructor", 0, 0, 0 }; 32 32 33 33 JSImageConstructor::JSImageConstructor(ExecState* exec, Document* document) -
trunk/WebCore/bindings/js/JSInspectedObjectWrapper.cpp
r31890 r32652 41 41 } 42 42 43 const ClassInfo JSInspectedObjectWrapper::s_info = { "JSInspectedObjectWrapper", &JSQuarantinedObjectWrapper::s_info, 0 };43 const ClassInfo JSInspectedObjectWrapper::s_info = { "JSInspectedObjectWrapper", &JSQuarantinedObjectWrapper::s_info, 0, 0 }; 44 44 45 45 JSValue* JSInspectedObjectWrapper::wrap(ExecState* unwrappedExec, JSValue* unwrappedValue) -
trunk/WebCore/bindings/js/JSInspectorCallbackWrapper.cpp
r31890 r32652 41 41 } 42 42 43 const ClassInfo JSInspectorCallbackWrapper::s_info = { "JSInspectorCallbackWrapper", &JSQuarantinedObjectWrapper::s_info, 0 };43 const ClassInfo JSInspectorCallbackWrapper::s_info = { "JSInspectorCallbackWrapper", &JSQuarantinedObjectWrapper::s_info, 0, 0 }; 44 44 45 45 JSValue* JSInspectorCallbackWrapper::wrap(ExecState* unwrappedExec, JSValue* unwrappedValue) -
trunk/WebCore/bindings/js/JSLocationCustom.cpp
r31759 r32652 55 55 56 56 // Check for the few functions that we allow, even when called cross-domain. 57 const HashEntry* entry = JSLocationPrototype::s_info.propHashTable ->entry(propertyName);57 const HashEntry* entry = JSLocationPrototype::s_info.propHashTable(exec)->entry(propertyName); 58 58 if (entry && (entry->attributes & Function) 59 59 && (entry->functionValue == jsLocationPrototypeFunctionReplace … … 81 81 bool sameDomainAccess = allowsAccessFromFrame(exec, frame); 82 82 83 const HashEntry* entry = JSLocation::s_info.propHashTable ->entry(propertyName);83 const HashEntry* entry = JSLocation::s_info.propHashTable(exec)->entry(propertyName); 84 84 if (!entry) { 85 85 if (sameDomainAccess) -
trunk/WebCore/bindings/js/JSNamedNodesCollection.cpp
r31220 r32652 36 36 using namespace KJS; 37 37 38 const ClassInfo JSNamedNodesCollection::s_info = { "Collection", 0, 0 };38 const ClassInfo JSNamedNodesCollection::s_info = { "Collection", 0, 0, 0 }; 39 39 40 40 // Such a collection is usually very short-lived, it only exists -
trunk/WebCore/bindings/js/JSQuarantinedObjectWrapper.cpp
r31890 r32652 33 33 namespace WebCore { 34 34 35 const ClassInfo JSQuarantinedObjectWrapper::s_info = { "JSQuarantinedObjectWrapper", 0, 0 };35 const ClassInfo JSQuarantinedObjectWrapper::s_info = { "JSQuarantinedObjectWrapper", 0, 0, 0 }; 36 36 37 37 JSQuarantinedObjectWrapper* JSQuarantinedObjectWrapper::asWrapper(JSValue* value) -
trunk/WebCore/bindings/js/JSRGBColor.cpp
r31220 r32652 33 33 namespace WebCore { 34 34 35 const ClassInfo JSRGBColor::s_info = { "RGBColor", 0, &JSRGBColorTable };35 const ClassInfo JSRGBColor::s_info = { "RGBColor", 0, &JSRGBColorTable, 0 }; 36 36 37 37 /* -
trunk/WebCore/bindings/js/JSStorageCustom.cpp
r31762 r32652 64 64 // the native property slots manually. 65 65 PropertySlot slot; 66 if (getStaticValueSlot<JSStorage, Base>(exec, s_info.propHashTable , this, propertyName, slot))66 if (getStaticValueSlot<JSStorage, Base>(exec, s_info.propHashTable(exec), this, propertyName, slot)) 67 67 return false; 68 68 -
trunk/WebCore/bindings/js/JSXMLHttpRequestConstructor.cpp
r32037 r32652 29 29 namespace WebCore { 30 30 31 const ClassInfo JSXMLHttpRequestConstructor::s_info = { "XMLHttpRequestConstructor", 0, 0 };31 const ClassInfo JSXMLHttpRequestConstructor::s_info = { "XMLHttpRequestConstructor", 0, 0, 0 }; 32 32 33 33 JSXMLHttpRequestConstructor::JSXMLHttpRequestConstructor(ExecState* exec, Document* document) -
trunk/WebCore/bindings/js/JSXSLTProcessor.cpp
r31220 r32652 42 42 namespace WebCore { 43 43 44 const ClassInfo JSXSLTProcessor::s_info = { "XSLTProcessor", 0, 0 };44 const ClassInfo JSXSLTProcessor::s_info = { "XSLTProcessor", 0, 0, 0 }; 45 45 46 46 /* … … 187 187 } 188 188 189 const ClassInfo JSXSLTProcessorConstructor::s_info = { "XSLTProcessorConsructor", 0, 0 };189 const ClassInfo JSXSLTProcessorConstructor::s_info = { "XSLTProcessorConsructor", 0, 0, 0 }; 190 190 191 191 JSXSLTProcessorConstructor::JSXSLTProcessorConstructor(ExecState* exec) -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r31766 r32652 731 731 \@hashSpecials, \@hashParameters); 732 732 733 push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", 0, &${className}PrototypeTable };\n\n");733 push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", 0, &${className}PrototypeTable, 0 };\n\n"); 734 734 if ($dataNode->extendedAttributes->{"DoNotCache"}) { 735 735 push(@implContent, "JSObject* ${className}Prototype::self()\n"); … … 773 773 push(@implContent, "&${className}Table "); 774 774 } else { 775 push(@implContent, "0 ") 776 } 775 push(@implContent, "0 "); 776 } 777 push(@implContent, ", 0 "); 777 778 push(@implContent, "};\n\n"); 778 779 … … 1779 1780 }; 1780 1781 1781 const ClassInfo ${className}Constructor::s_info = { "${visibleClassName}Constructor", 0, &${className}ConstructorTable };1782 const ClassInfo ${className}Constructor::s_info = { "${visibleClassName}Constructor", 0, &${className}ConstructorTable, 0 }; 1782 1783 1783 1784 bool ${className}Constructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) -
trunk/WebCore/bridge/objc/objc_runtime.mm
r31223 r32652 197 197 } 198 198 199 const ClassInfo ObjcFallbackObjectImp::info = { "ObjcFallbackObject", 0, 0 };199 const ClassInfo ObjcFallbackObjectImp::info = { "ObjcFallbackObject", 0, 0, 0 }; 200 200 201 201 ObjcFallbackObjectImp::ObjcFallbackObjectImp(ObjcInstance* i, const KJS::Identifier propertyName) -
trunk/WebCore/bridge/runtime_array.cpp
r31220 r32652 31 31 using namespace KJS; 32 32 33 const ClassInfo RuntimeArray::s_info = { "RuntimeArray", &ArrayInstance::info, 0 };33 const ClassInfo RuntimeArray::s_info = { "RuntimeArray", &ArrayInstance::info, 0, 0 }; 34 34 35 35 RuntimeArray::RuntimeArray(ExecState *exec, Bindings::Array *a) -
trunk/WebCore/bridge/runtime_object.cpp
r31220 r32652 33 33 using namespace Bindings; 34 34 35 const ClassInfo RuntimeObjectImp::s_info = { "RuntimeObject", 0, 0 };35 const ClassInfo RuntimeObjectImp::s_info = { "RuntimeObject", 0, 0, 0 }; 36 36 37 37 RuntimeObjectImp::RuntimeObjectImp(PassRefPtr<Bindings::Instance> i) -
trunk/WebKit/mac/ChangeLog
r32597 r32652 1 2008-04-25 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin. 4 5 Fix run-webkit-tests --threading 6 and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661> 7 Proxy server issue in Sunday's Nightly 8 9 * WebView/WebView.mm: (-[WebViewPrivate init]): Initialize threading. Previously, this was 10 only done from icon database code, which is not robust enough. 11 1 12 2008-04-20 Adam Barth <hk9565@gmail.com> 2 13 -
trunk/WebKit/mac/WebView/WebView.mm
r32581 r32652 125 125 #import <WebKit/WebDashboardRegion.h> 126 126 #import <WebKitSystemInterface.h> 127 #import <kjs/InitializeThreading.h> 127 128 #import <mach-o/dyld.h> 128 129 #import <objc/objc-auto.h> … … 458 459 if (!self) 459 460 return nil; 461 KJS::initializeThreading(); 460 462 allowsUndo = YES; 461 463 zoomMultiplier = 1; -
trunk/WebKit/win/ChangeLog
r32597 r32652 1 2008-04-25 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin. 4 5 Fix run-webkit-tests --threading 6 and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661> 7 Proxy server issue in Sunday's Nightly 8 9 * WebView.cpp: (WebView::WebView): Initialize threading. Previously, this was only done from 10 icon database code, which is not robust enough. 11 1 12 2008-04-26 Adam Barth <hk9565@gmail.com> 2 13 -
trunk/WebKit/win/WebView.cpp
r32523 r32652 95 95 #include <WebCore/WindowMessageBroadcaster.h> 96 96 #pragma warning(pop) 97 #include <kjs/InitializeThreading.h> 97 98 #include <JavaScriptCore/value.h> 98 99 #include <CFNetwork/CFURLCachePriv.h> … … 274 275 , m_deleteBackingStoreTimerActive(false) 275 276 { 277 KJS::initializeThreading(); 278 276 279 m_backingStoreSize.cx = m_backingStoreSize.cy = 0; 277 280 -
trunk/WebKitTools/ChangeLog
r32645 r32652 1 2008-04-25 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin. 4 5 Fix run-webkit-tests --threading 6 and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661> 7 Proxy server issue in Sunday's Nightly 8 9 * DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp: 10 (runJavaScriptThread): 11 (startJavaScriptThreads): 12 (stopJavaScriptThreads): 13 Spawned threads were immediately detached, unlike the original ones, so joining them 14 made no sense. Now, all threads are created detached, and stopJavaScriptThreads() just 15 waits for them all to exit. 16 1 17 2008-04-28 Holger Hans Peter Freyther <zecke@selfish.org> 2 18 -
trunk/WebKitTools/DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp
r30407 r32652 78 78 // Check for cancellation. 79 79 if (javaScriptThreadsShouldTerminate) { 80 javaScriptThreads()->remove(pthread_self()); 80 81 pthread_mutex_unlock(&javaScriptThreadsMutex); 81 82 return 0; … … 106 107 pthread_t pthread; 107 108 pthread_create(&pthread, 0, &runJavaScriptThread, 0); 109 pthread_detach(pthread); 108 110 javaScriptThreads()->add(pthread); 109 111 } … … 122 124 pthread_mutex_unlock(&javaScriptThreadsMutex); 123 125 124 ThreadSet::iterator end = javaScriptThreads()->end(); 125 for (ThreadSet::iterator it = javaScriptThreads()->begin(); it != end; ++it) { 126 pthread_t pthread = *it; 127 pthread_join(pthread, 0); 126 while (true) { 127 pthread_mutex_lock(&javaScriptThreadsMutex); 128 int threadCount = javaScriptThreads()->size(); 129 pthread_mutex_unlock(&javaScriptThreadsMutex); 130 131 if (!threadCount) 132 break; 133 134 usleep(1000); 128 135 } 129 136 }
Note: See TracChangeset
for help on using the changeset viewer.