Changeset 168261 in webkit
- Timestamp:
- May 5, 2014 12:45:46 AM (10 years ago)
- Location:
- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog
r167236 r168261 7880 7880 (JSC::SymbolTable::SymbolTable): 7881 7881 * runtime/SymbolTable.h: 7882 7883 2013-11-27 Filip Pizlo <fpizlo@apple.com>7884 7885 Finally fix some obvious Bartlett bugs7886 https://bugs.webkit.org/show_bug.cgi?id=1249517887 7888 Reviewed by Mark Hahnenberg.7889 7890 Sanitize the stack (i.e. zero parts of it known to be dead) at three key points:7891 7892 - GC.7893 7894 - At beginning of OSR entry.7895 7896 - Just as we finish preparing OSR entry. This clears those slots on the stack that7897 could have been live in baseline but that are known to be dead in DFG.7898 7899 This is as much as a 2x speed-up on splay if you run it in certain modes, and run it7900 for a long enough interval. It appears to fix all instances of the dreaded exponential7901 heap growth that splay gets into when some stale pointer stays around.7902 7903 This doesn't have much of an effect on real-world programs. This bug has only ever7904 manifested in splay and for that reason we thus far opted against fixing it. But splay7905 is, for what it's worth, the premiere GC stress test in JavaScript - so making sure we7906 can run it without pathologies - even when you tweak its configuration - is probably7907 fairly important.7908 7909 * dfg/DFGJITCompiler.h:7910 (JSC::DFG::JITCompiler::noticeOSREntry):7911 * dfg/DFGOSREntry.cpp:7912 (JSC::DFG::prepareOSREntry):7913 * dfg/DFGOSREntry.h:7914 * heap/Heap.cpp:7915 (JSC::Heap::markRoots):7916 * interpreter/JSStack.cpp:7917 (JSC::JSStack::JSStack):7918 (JSC::JSStack::sanitizeStack):7919 * interpreter/JSStack.h:7920 7882 7921 7883 2013-11-26 Filip Pizlo <fpizlo@apple.com> -
releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGJITCompiler.h
r160493 r168261 271 271 else { 272 272 VariableAccessData* variable = node->variableAccessData(); 273 entry->m_machineStackUsed.set(variable->machineLocal().toLocal());274 275 273 switch (variable->flushFormat()) { 276 274 case FlushedDouble: -
releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
r159826 r168261 53 53 54 54 VM* vm = &exec->vm(); 55 56 vm->interpreter->stack().sanitizeStack();57 58 55 if (codeBlock->jitType() != JITCode::DFGJIT) { 59 56 RELEASE_ASSERT(codeBlock->jitType() == JITCode::FTLJIT); … … 185 182 // would have otherwise just kept running albeit less quickly. 186 183 187 unsigned frameSize = jitCode->common.requiredRegisterCountForExecutionAndExit(); 188 if (!vm->interpreter->stack().grow(&exec->registers()[virtualRegisterForLocal(frameSize).offset()])) { 184 if (!vm->interpreter->stack().grow(&exec->registers()[virtualRegisterForLocal(jitCode->common.requiredRegisterCountForExecutionAndExit()).offset()])) { 189 185 if (Options::verboseOSR()) 190 186 dataLogF(" OSR failed because stack growth failed.\n"); … … 212 208 registers[entry->m_reshufflings[i].toOffset] = temporaryLocals[i]; 213 209 214 // 5) Clear those parts of the call frame that the DFG ain't using. This helps GC on some 215 // programs by eliminating some stale pointer pathologies. 216 217 for (unsigned i = frameSize; i--;) { 218 if (entry->m_machineStackUsed.get(i)) 219 continue; 220 registers[virtualRegisterForLocal(i).offset()] = JSValue::encode(JSValue()); 221 } 222 223 // 6) Fix the call frame. 210 // 5) Fix the call frame. 224 211 225 212 exec->setCodeBlock(codeBlock); 226 213 227 // 7) Find and return the destination machine code address.214 // 6) Find and return the destination machine code address. 228 215 229 216 void* result = codeBlock->jitCode()->executableAddressAtOffset(entry->m_machineCodeOffset); -
releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.h
r159826 r168261 60 60 BitVector m_localsForcedMachineInt; 61 61 Vector<OSREntryReshuffling> m_reshufflings; 62 BitVector m_machineStackUsed;63 62 }; 64 63 -
releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/heap/Heap.cpp
r162017 r168261 468 468 GCPHASE(GatherStackRoots); 469 469 stack().gatherConservativeRoots(stackRoots, m_jitStubRoutines, m_codeBlocks); 470 stack().sanitizeStack();471 470 } 472 471 -
releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.cpp
r160063 r168261 53 53 updateStackLimit(highAddress()); 54 54 m_commitEnd = highAddress(); 55 56 m_lastStackTop = getBaseOfStack();57 55 58 56 disableErrorStackReserve(); … … 102 100 { 103 101 conservativeRoots.add(getBaseOfStack(), getTopOfStack(), jitStubRoutines, codeBlocks); 104 }105 106 void JSStack::sanitizeStack()107 {108 ASSERT(getTopOfStack() <= getBaseOfStack());109 110 if (m_lastStackTop < getTopOfStack()) {111 char* begin = reinterpret_cast<char*>(m_lastStackTop);112 char* end = reinterpret_cast<char*>(getTopOfStack());113 memset(begin, 0, end - begin);114 }115 116 m_lastStackTop = getTopOfStack();117 102 } 118 103 -
releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.h
r160186 r168261 83 83 void gatherConservativeRoots(ConservativeRoots&); 84 84 void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&); 85 void sanitizeStack();86 85 87 86 Register* getBaseOfStack() const … … 158 157 PageReservation m_reservation; 159 158 CallFrame*& m_topCallFrame; 160 Register* m_lastStackTop;161 159 162 160 friend class LLIntOffsetsExtractor;
Note: See TracChangeset
for help on using the changeset viewer.