Changeset 178364 in webkit for trunk/Source/JavaScriptCore/heap
- Timestamp:
- Jan 13, 2015, 9:46:40 AM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore/heap
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/Heap.cpp
r178284 r178364 506 506 // gathering uses the mark bits to determine whether a reference is valid. 507 507 void* dummy; 508 ALLOCATE_AND_GET_REGISTER_STATE(registers); 508 509 ConservativeRoots conservativeRoots(&m_objectSpace.blocks(), &m_storageSpace); 509 gatherStackRoots(conservativeRoots, &dummy );510 gatherStackRoots(conservativeRoots, &dummy, registers); 510 511 gatherJSStackRoots(conservativeRoots); 511 512 gatherScratchBufferRoots(conservativeRoots); … … 567 568 } 568 569 569 void Heap::gatherStackRoots(ConservativeRoots& roots, void** dummy )570 void Heap::gatherStackRoots(ConservativeRoots& roots, void** dummy, MachineThreads::RegisterState& registers) 570 571 { 571 572 GCPHASE(GatherStackRoots); 572 573 m_jitStubRoutines.clearMarks(); 573 m_machineThreads.gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks, dummy );574 m_machineThreads.gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks, dummy, registers); 574 575 } 575 576 -
trunk/Source/JavaScriptCore/heap/Heap.h
r178284 r178364 276 276 277 277 void markRoots(double gcStartTime); 278 void gatherStackRoots(ConservativeRoots&, void** dummy );278 void gatherStackRoots(ConservativeRoots&, void** dummy, MachineThreads::RegisterState& registers); 279 279 void gatherJSStackRoots(ConservativeRoots&); 280 280 void gatherScratchBufferRoots(ConservativeRoots&); -
trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp
r178284 r178364 216 216 } 217 217 218 #if COMPILER(GCC) 219 #define REGISTER_BUFFER_ALIGNMENT __attribute__ ((aligned (sizeof(void*)))) 220 #else 221 #define REGISTER_BUFFER_ALIGNMENT 222 #endif 223 224 void MachineThreads::gatherFromCurrentThread(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks, void* stackCurrent) 225 { 226 // setjmp forces volatile registers onto the stack 227 jmp_buf registers REGISTER_BUFFER_ALIGNMENT; 228 #if COMPILER(MSVC) 229 #pragma warning(push) 230 #pragma warning(disable: 4611) 231 #endif 232 setjmp(registers); 233 #if COMPILER(MSVC) 234 #pragma warning(pop) 235 #endif 236 218 void MachineThreads::gatherFromCurrentThread(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks, void* stackCurrent, RegisterState& registers) 219 { 237 220 void* registersBegin = ®isters; 238 221 void* registersEnd = reinterpret_cast<void*>(roundUpToMultipleOf<sizeof(void*)>(reinterpret_cast<uintptr_t>(®isters + 1))); … … 446 429 } 447 430 448 void MachineThreads::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks, void* stackCurrent )449 { 450 gatherFromCurrentThread(conservativeRoots, jitStubRoutines, codeBlocks, stackCurrent );431 void MachineThreads::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks, void* stackCurrent, RegisterState& registers) 432 { 433 gatherFromCurrentThread(conservativeRoots, jitStubRoutines, codeBlocks, stackCurrent, registers); 451 434 452 435 if (m_threadSpecific) { -
trunk/Source/JavaScriptCore/heap/MachineStackMarker.h
r178284 r178364 23 23 #define MachineThreads_h 24 24 25 #include <setjmp.h> 25 26 #include <wtf/Noncopyable.h> 26 27 #include <wtf/ThreadSpecific.h> … … 37 38 WTF_MAKE_NONCOPYABLE(MachineThreads); 38 39 public: 40 typedef jmp_buf RegisterState; 41 39 42 MachineThreads(Heap*); 40 43 ~MachineThreads(); 41 44 42 void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&, void* stackCurrent );45 void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&, void* stackCurrent, RegisterState& registers); 43 46 44 47 JS_EXPORT_PRIVATE void makeUsableFromMultipleThreads(); … … 46 49 47 50 private: 48 void gatherFromCurrentThread(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&, void* stackCurrent );51 void gatherFromCurrentThread(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&, void* stackCurrent, RegisterState& registers); 49 52 50 53 class Thread; … … 65 68 } // namespace JSC 66 69 70 #if COMPILER(GCC) 71 #define REGISTER_BUFFER_ALIGNMENT __attribute__ ((aligned (sizeof(void*)))) 72 #else 73 #define REGISTER_BUFFER_ALIGNMENT 74 #endif 75 76 // ALLOCATE_AND_GET_REGISTER_STATE() is a macro so that it is always "inlined" even in debug builds. 77 #if COMPILER(MSVC) 78 #pragma warning(push) 79 #pragma warning(disable: 4611) 80 #define ALLOCATE_AND_GET_REGISTER_STATE(registers) \ 81 MachineThreads::RegisterState registers REGISTER_BUFFER_ALIGNMENT; \ 82 setjmp(registers) 83 #pragma warning(pop) 84 #else 85 #define ALLOCATE_AND_GET_REGISTER_STATE(registers) \ 86 MachineThreads::RegisterState registers REGISTER_BUFFER_ALIGNMENT; \ 87 setjmp(registers) 88 #endif 89 67 90 #endif // MachineThreads_h
Note:
See TracChangeset
for help on using the changeset viewer.