Summary: | Move currentThreadStackBase() to WTF | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alp Toker <alp> | ||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED DUPLICATE | ||||||
Severity: | Normal | CC: | ap, barraclough, mrowe | ||||
Priority: | P2 | Keywords: | Gtk | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 16401 | ||||||
Attachments: |
|
Description
Alp Toker
2008-11-26 22:43:04 PST
Created attachment 25554 [details]
Share utility code for GC implementations
Split out JSC collector internals to WTF so the code can be shared
with DOM bindings and WebKit API layer code implementing garbage
collection.
This patch splits out what's necessary to support the proposed
conservative stack-only GC in the GObject C DOM binding.
JavaScriptCore/AllInOneFile.cpp | 1
JavaScriptCore/ChangeLog | 25 ++++
JavaScriptCore/GNUmakefile.am | 2
JavaScriptCore/JavaScriptCore.pri | 1
JavaScriptCore/JavaScriptCore.scons | 1
JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj | 8 +
JavaScriptCore/JavaScriptCoreSources.bkl | 1
JavaScriptCore/runtime/Collector.cpp | 73 ------------
JavaScriptCore/wtf/CollectorUtilities.cpp | 117 ++++++++++++++++++++
JavaScriptCore/wtf/CollectorUtilities.h | 35 +++++
WebCore/ChangeLog | 17 ++
WebCore/ForwardingHeaders/wtf/CollectorUtilities.h | 1
WebCore/WebCore.vcproj/WebCore.vcproj | 4
13 files changed, 214 insertions(+), 72 deletions(-)
Note that the patch doesn't add the new files to the XCode project files as I don't have access to the IDE right now. To the reviewer: Please update those files when landing this, or otherwise update the patch with the necessary changes so I can get them in. Thanks!
> -static inline void* currentThreadStackBase()
I'm wondering why this function was inline.
(In reply to comment #2) > > -static inline void* currentThreadStackBase() > > I'm wondering why this function was inline. > I added CollectorUtilities.cpp to AllInOneFile.cpp just above Collector.cpp, guessing gcc will inline it if appropriate at -O3. If you're concerned it might affect performance, could you try running a perf test with this patch applied? I don't think inlining or not will affect the correctness of the result (this function is for finding the stack base, not stack pointer so it's fine as a function call). I agree, I have no idea why it was inline. Comment on attachment 25554 [details]
Share utility code for GC implementations
I don't like the word "utilities" in a file name; it seems to be a word without meaning. I suggest calling this something like MachineStack.h.
If the macro is going to be in a header file, then I think it should be changed into an inline function that takes a const void*, so we don't have to add a WTF_ prefix to it.
Why include <stdlib.h>? I think all you need in this header is the type intptr_t, and that's not in <stdlib.h>.
|