Summary: | Provide a build-time choice when generating hash tables for properties of built-in DOM objects | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
Component: | JavaScriptCore | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | darin, ggaren, mjs | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Mac | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
David Kilzer (:ddkilzer)
2008-12-02 16:26:17 PST
Created attachment 25694 [details]
Patch v1
Passes all JavaScriptCore tests and Layout Tests with ENABLE_PERFECT_HASH_SIZE set to 0 in JavaScriptCore/runtime/Lookup.h.
Comment on attachment 25694 [details] Patch v1 > +#if ENABLE(PERFECT_HASH_SIZE) > void HashTable::createTable(JSGlobalData* globalData) const Since both of these implementations share the same function name I think it would be more elegant to put the #if around the body of the function rather than the entire function. > +// Define ENABLE_PERFECT_HASH_SIZE to 0 to save memory > +#define ENABLE_PERFECT_HASH_SIZE 1 This is not a great comment. Why would anyone let the value be 1 if setting it to 0 saves memory? r=me (In reply to comment #2) > (From update of attachment 25694 [details] [review]) > > +#if ENABLE(PERFECT_HASH_SIZE) > > void HashTable::createTable(JSGlobalData* globalData) const > > Since both of these implementations share the same function name I think it > would be more elegant to put the #if around the body of the function rather > than the entire function. Will do. > > +// Define ENABLE_PERFECT_HASH_SIZE to 0 to save memory > > +#define ENABLE_PERFECT_HASH_SIZE 1 > > This is not a great comment. Why would anyone let the value be 1 if setting it > to 0 saves memory? I'll describe the speed/memory trade-off instead when landing. (In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 25694 [details] [review] [review]) > > > +#if ENABLE(PERFECT_HASH_SIZE) > > > void HashTable::createTable(JSGlobalData* globalData) const > > > > Since both of these implementations share the same function name I think it > > would be more elegant to put the #if around the body of the function rather > > than the entire function. > > Will do. Will also make this change to this method in Lookup.h: + ALWAYS_INLINE const HashEntry* entry(const Identifier& identifier) const $ git svn dcommit Committing to http://svn.webkit.org/repository/webkit/trunk ... M JavaScriptCore/ChangeLog M JavaScriptCore/create_hash_table M JavaScriptCore/runtime/Lookup.cpp M JavaScriptCore/runtime/Lookup.h M JavaScriptCore/runtime/Structure.cpp M WebCore/ChangeLog M WebCore/bindings/scripts/CodeGeneratorJS.pm Committed r39056 http://trac.webkit.org/changeset/39056 Follow-up ChangeLog entry fix: $ git svn dcommit Committing to http://svn.webkit.org/repository/webkit/trunk ... M JavaScriptCore/ChangeLog M WebCore/ChangeLog Committed r39057 http://trac.webkit.org/changeset/39057 |