[Webkit-unassigned] [Bug 67072] New: JSC::Executable is inconsistent about using weak handle finalizers and destructors for releasing memory
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Aug 26 17:29:26 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=67072
Summary: JSC::Executable is inconsistent about using weak
handle finalizers and destructors for releasing memory
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: fpizlo at apple.com
For executable code, JSC::Executable uses a weak handle finalizer. This ensures the executable code is released as soon as the GC knows that the Executable object is no longer reachable. For everything else, JSC::Executable uses a destructor, which may only run when the cell in which JSC::Executable was allocated gets used for a new allocation.
This is not a bad approach from a performance standpoint, since releasing executable code as soon as possible is always a good policy. But, the CodeBlock object is itself sizable, so releasing it sooner would be nice for memory usage. It's also true that moving all memory release into a finalizer is a good step towards ultimately not executing destructors. Doing so also makes confusing code slightly less confusing. The code is necessarily confusing because certain state in CodeBlock is stored in Executable to make it quicker to query during function dispatch. The current approach means that the part of CodeBlock's state that is stored in Executable is freed early, so when the CodeBlock is freed later from the destructor, some of its state is already released. It's probably wise to continue to store (or at least cache) some of CodeBlock's state in Executable, but it would make things somewhat easier to understand if the release of CodeBlock memory happened at the same ti
me as the release of CodeBlock state that was cached in Executable.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list