Changeset 28108 in webkit for trunk/JavaScriptCore
- Timestamp:
- Nov 28, 2007, 3:03:10 AM (18 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r28106 r28108 1 2007-11-28 Maciej Stachowiak <[email protected]> 2 3 Add files missing from previous commit. 4 5 * kjs/MarkStack.h: Added. 6 7 2007-11-28 Maciej Stachowiak <[email protected]> 8 9 Not reviewed. 10 11 - Fixed "Stack overflow crash in JavaScript garbage collector mark pass" 12 http://bugs.webkit.org/show_bug.cgi?id=12216 13 14 Implement mark stack. This version is not suitable for prime time because it makes a 15 huge allocation on every collect, and potentially makes marking of detached subtrees 16 slow. But it is a .2% - .4% speedup even without much tweaking. 17 18 The basic approach is to replace mark() methods with 19 markChildren(MarkStack&) methods. Reachable references are pushed 20 onto a mark stack (which encapsulates ignoring already-marked 21 references). 22 23 Objects are no longer responsible for actually setting their own 24 mark bits, the collector does that. This means that for objects on 25 the number heap we don't have to call markChildren() at all since 26 we know there aren't any. 27 28 The mark phase of collect pushes roots onto the mark stack 29 and drains it as often as possible. 30 31 To make this approach viable requires a constant-size mark stack 32 and a slow fallback approach for when the stack size is exceeded, 33 plus optimizations to make the required stack small in common 34 cases. This should be doable. 35 36 * JavaScriptCore.exp: Export new symbols. 37 * JavaScriptCore.xcodeproj/project.pbxproj: Add new file. 38 * kjs/collector.cpp: 39 (KJS::Collector::heapAllocate): 40 (KJS::drainMarkStack): Helper for all of the below. 41 (KJS::Collector::markStackObjectsConservatively): Use mark stack. 42 (KJS::Collector::markCurrentThreadConservatively): ditto 43 (KJS::Collector::markOtherThreadConservatively): ditto 44 (KJS::Collector::markProtectedObjects): ditto 45 (KJS::Collector::markMainThreadOnlyObjects): ditto 46 (KJS::Collector::collect): ditto 47 * kjs/collector.h: 48 (KJS::Collector::cellMayHaveRefs): Helper for MarkStack. 49 50 * kjs/MarkStack.h: Added. The actual mark stack implementation. 51 (KJS::MarkStack::push): 52 (KJS::MarkStack::pushAtom): 53 (KJS::MarkStack::pop): 54 (KJS::MarkStack::isEmpty): 55 (KJS::MarkStack::reserveCapacity): 56 57 Changed mark() methods to markChildren() methods: 58 59 * kjs/ExecState.cpp: 60 (KJS::ExecState::markChildren): 61 * kjs/ExecState.h: 62 * kjs/JSWrapperObject.cpp: 63 (KJS::JSWrapperObject::markChildren): 64 * kjs/JSWrapperObject.h: 65 * kjs/array_instance.cpp: 66 (KJS::ArrayInstance::markChildren): 67 * kjs/array_instance.h: 68 * kjs/bool_object.cpp: 69 (BooleanInstance::markChildren): 70 * kjs/bool_object.h: 71 * kjs/error_object.cpp: 72 * kjs/error_object.h: 73 * kjs/function.cpp: 74 (KJS::FunctionImp::markChildren): 75 (KJS::Arguments::Arguments): 76 (KJS::Arguments::markChildren): 77 (KJS::ActivationImp::markChildren): 78 * kjs/function.h: 79 * kjs/internal.cpp: 80 (KJS::GetterSetterImp::markChildren): 81 * kjs/interpreter.cpp: 82 (KJS::Interpreter::markRoots): 83 * kjs/interpreter.h: 84 * kjs/list.cpp: 85 (KJS::List::markProtectedListsSlowCase): 86 * kjs/list.h: 87 (KJS::List::markProtectedLists): 88 * kjs/object.cpp: 89 (KJS::JSObject::markChildren): 90 * kjs/object.h: 91 (KJS::ScopeChain::markChildren): 92 * kjs/property_map.cpp: 93 (KJS::PropertyMap::markChildren): 94 * kjs/property_map.h: 95 * kjs/scope_chain.h: 96 * kjs/string_object.cpp: 97 (KJS::StringInstance::markChildren): 98 * kjs/string_object.h: 99 1 100 2007-11-28 Maciej Stachowiak <[email protected]> 2 101
Note:
See TracChangeset
for help on using the changeset viewer.