Changeset 13568 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Mar 29, 2006, 6:39:24 PM (19 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/collector.cpp
r13089 r13568 444 444 InterpreterImp *scr = InterpreterImp::s_hook; 445 445 do { 446 //fprintf( stderr, "Collector marking interpreter %p\n",(void*)scr);447 446 scr->mark(); 448 447 scr = scr->next; … … 461 460 size_t numLiveObjects = heap.numLiveObjects; 462 461 462 #if USE(MULTIPLE_THREADS) 463 bool currentThreadIsMainThread = !pthread_is_threaded_np() || pthread_main_np(); 464 #else 465 bool currentThreadIsMainThread = true; 466 #endif 467 463 468 for (size_t block = 0; block < heap.usedBlocks; block++) { 464 469 CollectorBlock *curBlock = heap.blocks[block]; … … 474 479 if (imp->m_marked) { 475 480 imp->m_marked = false; 476 } else {481 } else if (currentThreadIsMainThread || imp->m_destructorIsThreadSafe) { 477 482 imp->~JSCell(); 478 483 --usedCells; … … 495 500 if (imp->m_marked) { 496 501 imp->m_marked = false; 497 } else {502 } else if (currentThreadIsMainThread || imp->m_destructorIsThreadSafe) { 498 503 imp->~JSCell(); 499 504 --usedCells; -
trunk/JavaScriptCore/kjs/object.h
r13465 r13568 118 118 * @param proto The prototype 119 119 */ 120 JSObject(JSObject *proto );120 JSObject(JSObject *proto, bool destructorIsThreadSafe = true); 121 121 122 122 /** … … 124 124 * (that is, the ECMAScript "null" value, not a null object pointer). 125 125 */ 126 JSObject();126 explicit JSObject(bool destructorIsThreadSafe = true); 127 127 128 128 virtual void mark(); … … 580 580 JSObject *throwError(ExecState *, ErrorType); 581 581 582 inline JSObject::JSObject(JSObject *proto) 583 : _proto(proto), _internalValue(0) 582 inline JSObject::JSObject(JSObject *proto, bool destructorIsThreadSafe) 583 : JSCell(destructorIsThreadSafe) 584 , _proto(proto) 585 , _internalValue(0) 584 586 { 585 587 assert(proto); 586 588 } 587 589 588 inline JSObject::JSObject() 589 : _proto(jsNull()), _internalValue(0) 590 inline JSObject::JSObject(bool destructorIsThreadSafe) 591 : JSCell(destructorIsThreadSafe) 592 , _proto(jsNull()) 593 , _internalValue(0) 590 594 { 591 595 } -
trunk/JavaScriptCore/kjs/protect.h
r12301 r13568 44 44 inline void gcProtectNullTolerant(JSValue *val) 45 45 { 46 if (val) gcProtect(val); 46 if (val) 47 gcProtect(val); 47 48 } 48 49 49 50 inline void gcUnprotectNullTolerant(JSValue *val) 50 51 { 51 if (val) gcUnprotect(val); 52 if (val) 53 gcUnprotect(val); 52 54 } 53 55 -
trunk/JavaScriptCore/kjs/value.h
r12949 r13568 122 122 friend class GetterSetterImp; 123 123 private: 124 JSCell();124 explicit JSCell(bool destructorIsThreadSafe = true); 125 125 virtual ~JSCell(); 126 126 public: … … 156 156 157 157 private: 158 bool m_marked; 158 bool m_destructorIsThreadSafe : 1; 159 bool m_marked : 1; 159 160 }; 160 161 … … 209 210 } 210 211 211 inline JSCell::JSCell() 212 : m_marked(false) 212 inline JSCell::JSCell(bool destructorIsThreadSafe) 213 : m_destructorIsThreadSafe(destructorIsThreadSafe) 214 , m_marked(false) 213 215 { 214 216 }
Note:
See TracChangeset
for help on using the changeset viewer.