Changeset 178266 in webkit
- Timestamp:
- Jan 12, 2015, 8:29:22 AM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r178247 r178266 1 2015-01-12 Michael Saboff <[email protected]> 2 3 Local JSArray* "keys" in objectConstructorKeys() is not marked during garbage collection 4 https://bugs.webkit.org/show_bug.cgi?id=140348 5 6 Reviewed by Mark Lam. 7 8 Move the address of the local variable that is used to demarcate the top of the stack for 9 conservative roots down to MachineThreads::gatherFromCurrentThread() since it also gets 10 the register values using setjmp(). That way we don't lose any callee save register 11 contents between Heap::markRoots(), where it was set, and gatherFromCurrentThread(). 12 If we lose any JSObject* that are only in callee save registers, they will be GC'ed 13 erroneously. 14 15 * heap/Heap.cpp: 16 (JSC::Heap::markRoots): 17 (JSC::Heap::gatherStackRoots): 18 * heap/Heap.h: 19 * heap/MachineStackMarker.cpp: 20 (JSC::MachineThreads::gatherFromCurrentThread): 21 (JSC::MachineThreads::gatherConservativeRoots): 22 * heap/MachineStackMarker.h: 23 1 24 2015-01-11 Eric Carlson <[email protected]> 2 25 -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r176424 r178266 505 505 // We gather conservative roots before clearing mark bits because conservative 506 506 // gathering uses the mark bits to determine whether a reference is valid. 507 void* dummy;508 507 ConservativeRoots conservativeRoots(&m_objectSpace.blocks(), &m_storageSpace); 509 gatherStackRoots(conservativeRoots , &dummy);508 gatherStackRoots(conservativeRoots); 510 509 gatherJSStackRoots(conservativeRoots); 511 510 gatherScratchBufferRoots(conservativeRoots); … … 567 566 } 568 567 569 void Heap::gatherStackRoots(ConservativeRoots& roots , void** dummy)568 void Heap::gatherStackRoots(ConservativeRoots& roots) 570 569 { 571 570 GCPHASE(GatherStackRoots); 572 571 m_jitStubRoutines.clearMarks(); 573 m_machineThreads.gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks , dummy);572 m_machineThreads.gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks); 574 573 } 575 574 -
trunk/Source/JavaScriptCore/heap/Heap.h
r177130 r178266 276 276 277 277 void markRoots(double gcStartTime); 278 void gatherStackRoots(ConservativeRoots& , void** dummy);278 void gatherStackRoots(ConservativeRoots&); 279 279 void gatherJSStackRoots(ConservativeRoots&); 280 280 void gatherScratchBufferRoots(ConservativeRoots&); -
trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp
r173949 r178266 222 222 #endif 223 223 224 void MachineThreads::gatherFromCurrentThread(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks , void* stackCurrent)224 void MachineThreads::gatherFromCurrentThread(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks) 225 225 { 226 226 // setjmp forces volatile registers onto the stack 227 227 jmp_buf registers REGISTER_BUFFER_ALIGNMENT; 228 228 229 #if COMPILER(MSVC) 229 230 #pragma warning(push) … … 239 240 conservativeRoots.add(registersBegin, registersEnd, jitStubRoutines, codeBlocks); 240 241 241 void* stackBegin = stackCurrent; 242 // We need to mark the stack top in this function so that callee saves are either already on the stack, 243 // or will be saved in registers. 244 void* stackBegin = ®isters; 242 245 void* stackEnd = wtfThreadData().stack().origin(); 243 246 conservativeRoots.add(stackBegin, stackEnd, jitStubRoutines, codeBlocks); … … 446 449 } 447 450 448 void MachineThreads::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks , void* stackCurrent)449 { 450 gatherFromCurrentThread(conservativeRoots, jitStubRoutines, codeBlocks , stackCurrent);451 void MachineThreads::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks) 452 { 453 gatherFromCurrentThread(conservativeRoots, jitStubRoutines, codeBlocks); 451 454 452 455 if (m_threadSpecific) { -
trunk/Source/JavaScriptCore/heap/MachineStackMarker.h
r163027 r178266 40 40 ~MachineThreads(); 41 41 42 void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet& , void* stackCurrent);42 void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&); 43 43 44 44 JS_EXPORT_PRIVATE void makeUsableFromMultipleThreads(); … … 46 46 47 47 private: 48 void gatherFromCurrentThread(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet& , void* stackCurrent);48 void gatherFromCurrentThread(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&); 49 49 50 50 class Thread;
Note:
See TracChangeset
for help on using the changeset viewer.