Bug 145669

Summary: Stop using static tables for auto-generated DOM interfaces
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: beidson, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Geoffrey Garen 2015-06-04 16:12:39 PDT
All DOM interfaces generate compile-time HashTables of their properties. We used to use these HashTables instead of runtime data structures, but we don't anymore. Now, we always call reifyStaticProperties to turn a HashTable into a Structure on demand.

Instead of a HashTable, we should auto generate code to create a Structure, and we should eliminate the auto generated HashTables.

Benefits:

(1) We can more reliably disable DOM features at runtime;

(2) Less boilerplate to read through, translating one (useless) format to another.

(3) Shorter compile times, since we don't need to compute all the hash tables.
Comment 1 Geoffrey Garen 2021-10-13 15:26:05 PDT
Another benefit: Alexey S shared anecdotal feedback that some workflows do a lot of costly reifyStaticProperties() work, which might be reduced if we reify each property individually on access, using a cacheable dictionary approach.
Comment 2 Sam Weinig 2021-11-15 09:05:30 PST
I wish I could plus one a bug! Probably still worth having some static constant table that can be used for the individual accesses in a general way to avoid on code size increasing, but those are just details. Time to get rid of the HashTable!