WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
128050
Keep only captured symbols in CodeBlock symbol tables.
https://bugs.webkit.org/show_bug.cgi?id=128050
Summary
Keep only captured symbols in CodeBlock symbol tables.
Andreas Kling
Reported
2014-02-01 14:00:01 PST
Keep only captured symbols in CodeBlock symbol tables.
Attachments
Patch
(4.74 KB, patch)
2014-02-01 14:08 PST
,
Andreas Kling
ggaren
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2014-02-01 14:08:40 PST
Created
attachment 222890
[details]
Patch
Geoffrey Garen
Comment 2
2014-02-01 14:41:17 PST
Comment on
attachment 222890
[details]
Patch It looks like the code already dropped uncaptured symbols, and you've changed its approach to reuse an existing table and remove items, rather than create a new table and selectively insert items. Have I read that right? What's the motivation for that change? Is there some other object that points to the BytecodeGenrator's SymbolTable? Or do you think removal will be more efficient than creating a copy or something? (If another object also points to the BytecodeGenrator's symbol table, I think a clearer solution might be to separate that object, and force it to clone the SymbolTable as well.)
Andreas Kling
Comment 3
2014-02-01 14:59:42 PST
(In reply to
comment #2
)
> (From update of
attachment 222890
[details]
) > It looks like the code already dropped uncaptured symbols, and you've changed its approach to reuse an existing table and remove items, rather than create a new table and selectively insert items. > > Have I read that right? > > What's the motivation for that change? Is there some other object that points to the BytecodeGenrator's SymbolTable? Or do you think removal will be more efficient than creating a copy or something? > > (If another object also points to the BytecodeGenrator's symbol table, I think a clearer solution might be to separate that object, and force it to clone the SymbolTable as well.)
The purpose of this change is to minimize the amount of memory used by SymbolTables hanging off of UnlinkedCodeBlocks. We currently keep the full symbol tables around, despite only ever accessing the captured symbols. FWIW the reason we clone the SymbolTable in the first place is to avoid watchpoint reuse.
Andreas Kling
Comment 4
2014-02-02 15:53:51 PST
How about this: * Rename CodeBlock::symbolTable() into CodeBlock::capturedSymbolTable(). * Fork off a CapturedSymbolTable class from SymbolTable. * CapturedSymbolTable inherits from UnconditionalFinalizer. * WatchpointCleanup goes away (IIUC the JSGlobalObject symbol table doesn't need this mechanism.) * Fork off a CapturedSymbolTableEntry class from SymbolTableEntry. * CapturedSymbolTableEntry always has a watchpoint set. SymbolTableEntry never has a watchpoint set. * Slim/fat logic in both classes disappears.
Geoffrey Garen
Comment 5
2014-02-03 12:03:58 PST
Comment on
attachment 222890
[details]
Patch r=me because this patch is better than the status quo. I think it would be even better to make a new SymbolTable, and just copy the captured things into it. (In the common case, nothing will be captured, so that will be faster.)
Geoffrey Garen
Comment 6
2014-02-03 12:05:34 PST
(In reply to
comment #4
)
> How about this: > > * Rename CodeBlock::symbolTable() into CodeBlock::capturedSymbolTable(). > * Fork off a CapturedSymbolTable class from SymbolTable. > * CapturedSymbolTable inherits from UnconditionalFinalizer. > * WatchpointCleanup goes away (IIUC the JSGlobalObject symbol table doesn't need this mechanism.) > * Fork off a CapturedSymbolTableEntry class from SymbolTableEntry. > * CapturedSymbolTableEntry always has a watchpoint set. SymbolTableEntry never has a watchpoint set. > * Slim/fat logic in both classes disappears.
I think this is right, but I think the JSGlobalObject symbol table will still need to be the version of symbol table that has an UnconditionalFinalizer.
Geoffrey Garen
Comment 7
2014-02-03 12:06:24 PST
I also think it would be nice for the BytecodeGenerator to stop sharing its SymbolTable* with some other object. Instead, BytecodeGenerator should create its own symbol table, and perform an explicit copy if any other object needs that data.
Andreas Kling
Comment 8
2014-02-03 16:08:12 PST
Committed
r163337
: <
http://trac.webkit.org/changeset/163337
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug