Changeset 58012 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Apr 21, 2010, 1:59:14 PM (15 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/ArrayPrototype.cpp
r57978 r58012 157 157 158 158 HashSet<JSObject*>& arrayVisitedElements = exec->globalData().arrayVisitedElements; 159 if (arrayVisitedElements.size() >= MaxS econdaryThreadReentryDepth) {160 if ( !isMainThread() || arrayVisitedElements.size() >= MaxMainThreadReentryDepth)161 return throwError(exec, RangeError, "Maximum call stack size exceeded."); 159 if (arrayVisitedElements.size() >= MaxSmallThreadReentryDepth) { 160 if (arrayVisitedElements.size() >= exec->globalData().maxReentryDepth) 161 return throwError(exec, RangeError, "Maximum call stack size exceeded."); 162 162 } 163 163 … … 215 215 216 216 HashSet<JSObject*>& arrayVisitedElements = exec->globalData().arrayVisitedElements; 217 if (arrayVisitedElements.size() >= MaxS econdaryThreadReentryDepth) {218 if ( !isMainThread() || arrayVisitedElements.size() >= MaxMainThreadReentryDepth)219 return throwError(exec, RangeError, "Maximum call stack size exceeded."); 217 if (arrayVisitedElements.size() >= MaxSmallThreadReentryDepth) { 218 if (arrayVisitedElements.size() >= exec->globalData().maxReentryDepth) 219 return throwError(exec, RangeError, "Maximum call stack size exceeded."); 220 220 } 221 221 … … 253 253 254 254 HashSet<JSObject*>& arrayVisitedElements = exec->globalData().arrayVisitedElements; 255 if (arrayVisitedElements.size() >= MaxS econdaryThreadReentryDepth) {256 if ( !isMainThread() || arrayVisitedElements.size() >= MaxMainThreadReentryDepth)257 return throwError(exec, RangeError, "Maximum call stack size exceeded."); 255 if (arrayVisitedElements.size() >= MaxSmallThreadReentryDepth) { 256 if (arrayVisitedElements.size() >= exec->globalData().maxReentryDepth) 257 return throwError(exec, RangeError, "Maximum call stack size exceeded."); 258 258 } 259 259 -
trunk/JavaScriptCore/runtime/Collector.cpp
r57025 r58012 639 639 void Heap::registerThread() 640 640 { 641 ASSERT(!m_globalData-> mainThreadOnly || isMainThread());641 ASSERT(!m_globalData->exclusiveThread || m_globalData->exclusiveThread == currentThread()); 642 642 643 643 if (!m_currentThreadRegistrar || pthread_getspecific(m_currentThreadRegistrar)) -
trunk/JavaScriptCore/runtime/JSGlobalData.cpp
r57879 r58012 104 104 } 105 105 106 JSGlobalData::JSGlobalData(bool isShared )106 JSGlobalData::JSGlobalData(bool isShared, ThreadStackType threadStackType) 107 107 : isSharedInstance(isShared) 108 108 , clientData(0) … … 147 147 , cachedUTCOffset(NaN) 148 148 , weakRandom(static_cast<int>(currentTime())) 149 , maxReentryDepth(threadStackType == ThreadStackTypeSmall ? MaxSmallThreadReentryDepth : MaxLargeThreadReentryDepth) 149 150 #ifndef NDEBUG 150 , mainThreadOnly(false)151 , exclusiveThread(0) 151 152 #endif 152 153 { … … 197 198 } 198 199 199 PassRefPtr<JSGlobalData> JSGlobalData::createNonDefault( )200 { 201 return adoptRef(new JSGlobalData(false ));202 } 203 204 PassRefPtr<JSGlobalData> JSGlobalData::create( )205 { 206 JSGlobalData* globalData = new JSGlobalData(false );200 PassRefPtr<JSGlobalData> JSGlobalData::createNonDefault(ThreadStackType type) 201 { 202 return adoptRef(new JSGlobalData(false, type)); 203 } 204 205 PassRefPtr<JSGlobalData> JSGlobalData::create(ThreadStackType type) 206 { 207 JSGlobalData* globalData = new JSGlobalData(false, type); 207 208 wtfThreadData().initializeIdentifierTable(globalData->identifierTable); 208 209 return adoptRef(globalData); 209 210 } 210 211 211 PassRefPtr<JSGlobalData> JSGlobalData::createLeaked( )212 PassRefPtr<JSGlobalData> JSGlobalData::createLeaked(ThreadStackType type) 212 213 { 213 214 Structure::startIgnoringLeaks(); 214 RefPtr<JSGlobalData> data = create( );215 RefPtr<JSGlobalData> data = create(type); 215 216 Structure::stopIgnoringLeaks(); 216 217 return data.release(); … … 226 227 JSGlobalData*& instance = sharedInstanceInternal(); 227 228 if (!instance) { 228 instance = new JSGlobalData(true );229 instance = new JSGlobalData(true, ThreadStackTypeSmall); 229 230 #if ENABLE(JSC_MULTIPLE_THREADS) 230 231 instance->makeUsableFromMultipleThreads(); -
trunk/JavaScriptCore/runtime/JSGlobalData.h
r57192 r58012 85 85 }; 86 86 87 enum ThreadStackType { 88 ThreadStackTypeLarge, 89 ThreadStackTypeSmall 90 }; 91 87 92 class JSGlobalData : public RefCounted<JSGlobalData> { 88 93 public: … … 94 99 static JSGlobalData& sharedInstance(); 95 100 96 static PassRefPtr<JSGlobalData> create( );97 static PassRefPtr<JSGlobalData> createLeaked( );98 static PassRefPtr<JSGlobalData> createNonDefault( );101 static PassRefPtr<JSGlobalData> create(ThreadStackType); 102 static PassRefPtr<JSGlobalData> createLeaked(ThreadStackType); 103 static PassRefPtr<JSGlobalData> createNonDefault(ThreadStackType); 99 104 ~JSGlobalData(); 100 105 … … 188 193 WeakRandom weakRandom; 189 194 195 int maxReentryDepth; 190 196 #ifndef NDEBUG 191 bool mainThreadOnly;197 ThreadIdentifier exclusiveThread; 192 198 #endif 193 199 … … 198 204 void dumpSampleData(ExecState* exec); 199 205 private: 200 JSGlobalData(bool isShared );206 JSGlobalData(bool isShared, ThreadStackType); 201 207 static JSGlobalData*& sharedInstanceInternal(); 202 208 void createNativeThunk();
Note:
See TracChangeset
for help on using the changeset viewer.