Changeset 34974 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jul 2, 2008, 11:48:01 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r34969 r34974 1 2008-07-02 Geoffrey Garen <[email protected]> 2 3 Reviewed by Cameron Zwarich. 4 5 Fixed https://bugs.webkit.org/show_bug.cgi?id=19862 6 REGRESSION (r34907): Gmail crashes in JavaScriptCore code while editing drafts 7 8 I was never able to reproduce this issue, but Cameron could, and he says 9 that this patch fixes it. 10 11 The crash seems tied to a timer or event handler callback. In such a case, 12 the sole reference to the global object may be in the current call frame, 13 so we can't depend on the global object to mark the call frame area in 14 the register file. 15 16 The new GC marking rule is: the global object is not responsible for 17 marking the whole register file -- it's just responsible for the globals 18 section it's tied to. The heap is responsible for marking the call frame area. 19 1 20 2008-07-02 Mark Rowe <[email protected]> 2 21 -
trunk/JavaScriptCore/VM/RegisterFile.h
r34966 r34974 165 165 166 166 Register* lastGlobal() { return m_base - m_numGlobals; } 167 168 void mark(Heap* heap) 169 { 170 heap->markConservatively(lastGlobal(), m_base + m_size); 171 } 167 168 void markGlobals(Heap* heap) { heap->markConservatively(lastGlobal(), m_base); } 169 void markCallFrames(Heap* heap) { heap->markConservatively(m_base, m_base + m_size); } 172 170 173 171 private: -
trunk/JavaScriptCore/kjs/JSGlobalData.cpp
r34947 r34974 59 59 JSGlobalData::JSGlobalData(bool isShared) 60 60 : machine(new Machine) 61 , heap(new Heap( isShared))61 , heap(new Heap(machine, isShared)) 62 62 #if USE(MULTIPLE_THREADS) 63 63 , arrayTable(new HashTable(KJS::arrayTable)) -
trunk/JavaScriptCore/kjs/JSGlobalObject.cpp
r34950 r34974 351 351 RegisterFile& registerFile = globalData()->machine->registerFile(); 352 352 if (registerFile.globalObject() == this) 353 registerFile.mark (globalData()->heap);353 registerFile.markGlobals(globalData()->heap); 354 354 355 355 markIfNeeded(d()->globalExec->exception()); -
trunk/JavaScriptCore/kjs/collector.cpp
r34969 r34974 93 93 static void freeHeap(CollectorHeap*); 94 94 95 Heap::Heap( bool isShared)95 Heap::Heap(Machine* machine, bool isShared) 96 96 : m_markListSet(0) 97 97 , m_isShared(isShared) 98 , m_machine(machine) 98 99 { 99 100 memset(&primaryHeap, 0, sizeof(CollectorHeap)); … … 945 946 if (m_markListSet && m_markListSet->size()) 946 947 ArgList::markLists(*m_markListSet); 948 m_machine->registerFile().markCallFrames(this); 947 949 948 950 JAVASCRIPTCORE_GC_MARKED(); -
trunk/JavaScriptCore/kjs/collector.h
r34947 r34974 112 112 113 113 friend class JSGlobalData; 114 Heap( bool isShared);114 Heap(Machine*, bool isShared); 115 115 ~Heap(); 116 116 … … 133 133 134 134 bool m_isShared; 135 136 Machine* m_machine; 135 137 }; 136 138
Note:
See TracChangeset
for help on using the changeset viewer.