|
| 1 | +2019-08-01 Mark Lam <mark.lam@apple.com> |
| 2 | + |
| 3 | + Add crash diagnostics for debugging unexpected zapped cells. |
| 4 | + https://bugs.webkit.org/show_bug.cgi?id=200149 |
| 5 | + <rdar://problem/53570112> |
| 6 | + |
| 7 | + Reviewed by Yusuke Suzuki. |
| 8 | + |
| 9 | + Add a check for zapped cells in SlotVisitor::appendToMarkStack() and |
| 10 | + SlotVisitor::visitChildren(). If a zapped cell is detected, we will crash with |
| 11 | + some diagnostic info. |
| 12 | + |
| 13 | + To facilitate this, we've made the following changes: |
| 14 | + 1. Changed FreeCell to preserve the 1st 8 bytes. This is fine to do because all |
| 15 | + cells are at least 16 bytes long. |
| 16 | + 2. Changed HeapCell::zap() to only zap the structureID. Leave the rest of the |
| 17 | + cell header info intact (including the cell JSType). |
| 18 | + 3. Changed HeapCell::zap() to record the reason for zapping the cell. We stash |
| 19 | + the reason immediately after the first 8 bytes. This is the same location as |
| 20 | + FreeCell::scrambledNext. However, since a cell is not expected to be zapped |
| 21 | + and on the free list at the same time, it is also fine to do this. |
| 22 | + 4. Added a few utility functions to MarkedBlock for checking if a cell points |
| 23 | + into the block. |
| 24 | + 5. Added VMInspector and JSDollarVM utilities to dump in-use subspace hashes. |
| 25 | + 6. Added some comments to document the hashes of known subspaces. |
| 26 | + 7. Added Options::dumpZappedCellCrashData() to make this check conditional. |
| 27 | + We use this option to disable this check for slower machines so that their |
| 28 | + PLT5 performance is not impacted. |
| 29 | + |
| 30 | + * assembler/CPU.cpp: |
| 31 | + (JSC::hwL3CacheSize): |
| 32 | + (JSC::hwPhysicalCPUMax): |
| 33 | + * assembler/CPU.h: |
| 34 | + (JSC::hwL3CacheSize): |
| 35 | + (JSC::hwPhysicalCPUMax): |
| 36 | + * heap/FreeList.h: |
| 37 | + (JSC::FreeCell::offsetOfScrambledNext): |
| 38 | + * heap/HeapCell.h: |
| 39 | + (JSC::HeapCell::zap): |
| 40 | + (JSC::HeapCell::isZapped const): |
| 41 | + * heap/MarkedBlock.cpp: |
| 42 | + (JSC::MarkedBlock::Handle::stopAllocating): |
| 43 | + * heap/MarkedBlock.h: |
| 44 | + (JSC::MarkedBlock::Handle::start const): |
| 45 | + (JSC::MarkedBlock::Handle::end const): |
| 46 | + (JSC::MarkedBlock::Handle::contains const): |
| 47 | + * heap/MarkedBlockInlines.h: |
| 48 | + (JSC::MarkedBlock::Handle::specializedSweep): |
| 49 | + * heap/MarkedSpace.h: |
| 50 | + (JSC::MarkedSpace::forEachSubspace): |
| 51 | + * heap/SlotVisitor.cpp: |
| 52 | + (JSC::SlotVisitor::appendToMarkStack): |
| 53 | + (JSC::SlotVisitor::visitChildren): |
| 54 | + (JSC::SlotVisitor::reportZappedCellAndCrash): |
| 55 | + * heap/SlotVisitor.h: |
| 56 | + * jit/AssemblyHelpers.cpp: |
| 57 | + (JSC::AssemblyHelpers::emitAllocateWithNonNullAllocator): |
| 58 | + * runtime/Options.cpp: |
| 59 | + (JSC::Options::initialize): |
| 60 | + * runtime/Options.h: |
| 61 | + * runtime/VM.cpp: |
| 62 | + (JSC::VM::VM): |
| 63 | + * tools/JSDollarVM.cpp: |
| 64 | + (JSC::functionDumpSubspaceHashes): |
| 65 | + (JSC::JSDollarVM::finishCreation): |
| 66 | + * tools/VMInspector.cpp: |
| 67 | + (JSC::VMInspector::dumpSubspaceHashes): |
| 68 | + * tools/VMInspector.h: |
| 69 | + |
1 | 70 | 2019-08-01 Keith Miller <keith_miller@apple.com> |
2 | 71 |
|
3 | 72 | Fix bug in testMulImm32SignExtend |
|
0 commit comments