Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/ChangeLog b/ChangeLog
- index d457bec..ee80d45 100644
- --- a/ChangeLog
- +++ b/ChangeLog
- @@ -1,3 +1,23 @@
- +2010-08-09 Andras Becsi <abecsi@webkit.org>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Undefined reference errors when linking due to gperf and inlining.
- + webkit.org/b/29244
- +
- + EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>
- +
- + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
- + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
- + to access the functionality provided. This resulted in debug build failure with newer gcc versions
- + because of a behaviour change of gcc, which disables C style inlining in debug mode.
- + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
- + in their own compilation unit.
- + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
- + for multiple inclusions of generated C files to access these functions.
- +
- + * cmake/WebKitGenerators.cmake:
- +
- 2010-08-07 Sheriff Bot <webkit.review.bot@gmail.com>
- Unreviewed, rolling out r64904.
- diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
- index 1ddb0c1..0728713 100644
- --- a/WebCore/CMakeLists.txt
- +++ b/WebCore/CMakeLists.txt
- @@ -531,6 +531,10 @@ SET(WebCore_SOURCES
- ${DERIVED_SOURCES_DIR}/CSSGrammar.cpp
- ${DERIVED_SOURCES_DIR}/HTMLElementFactory.cpp
- ${DERIVED_SOURCES_DIR}/HTMLEntityNames.cpp
- + ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp
- + ${DERIVED_SOURCES_DIR}/CSSValueKeywords.cpp
- + ${DERIVED_SOURCES_DIR}/CSSPropertyNames.cpp
- + ${DERIVED_SOURCES_DIR}/ColorData.cpp
- ${DERIVED_SOURCES_DIR}/HTMLNames.cpp
- ${DERIVED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp
- ${DERIVED_SOURCES_DIR}/MathMLElementFactory.cpp
- @@ -1820,9 +1824,11 @@ GENERATE_INSPECTOR_FROM_IDL(inspector/Inspector.idl)
- LIST(APPEND WebCore_SOURCES ${JS_IDL_FILES} ${Inspector_IDL_FILES})
- -GENERATE_GPERF(${WEBCORE_DIR}/html/HTMLEntityNames.gperf)
- -GENERATE_GPERF(${WEBCORE_DIR}/platform/ColorData.gperf)
- -GENERATE_GPERF(${WEBCORE_DIR}/html/DocTypeStrings.gperf)
- +MAKE_HASH_TOOLS(${WEBCORE_DIR}/html/HTMLEntityNames)
- +MAKE_HASH_TOOLS(${WEBCORE_DIR}/html/DocTypeStrings)
- +MAKE_HASH_TOOLS(${DERIVED_SOURCES_DIR}/CSSValueKeywords)
- +MAKE_HASH_TOOLS(${DERIVED_SOURCES_DIR}/CSSPropertyNames)
- +MAKE_HASH_TOOLS(${WEBCORE_DIR}/platform/ColorData)
- GENERATE_TOKENIZER()
- GENERATE_USER_AGENT_STYLES()
- @@ -1833,6 +1839,7 @@ GENERATE_GRAMMAR(xpathyy ${WEBCORE_DIR}/xml/XPathGrammar.y)
- GENERATE_CSS_PROPERTY_NAMES()
- GENERATE_CSS_VALUE_KEYWORDS()
- +ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/HashTools.h HTMLEntityNames.cpp DocTypeStrings.cpp CSSValueKeywords.cpp CSSPropertyNames.cpp ColorData.cpp)
- ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSValueKeywords.h)
- ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSPropertyNames.h)
- ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSPrimitiveValueMappings.h CSSValueKeywords.h)
- diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
- index 7531c65..cbd8305 100644
- --- a/WebCore/ChangeLog
- +++ b/WebCore/ChangeLog
- @@ -1,3 +1,41 @@
- +2010-08-09 Andras Becsi <abecsi@webkit.org>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Undefined reference errors when linking due to gperf and inlining.
- + webkit.org/b/29244
- +
- + EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>
- +
- + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
- + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
- + to access the functionality provided. This resulted in debug build failure with newer gcc versions
- + because of a behaviour change of gcc, which disables C style inlining in debug mode.
- + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
- + in their own compilation unit.
- + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
- + for multiple inclusions of generated C files to access these functions.
- +
- + No new tests needed.
- +
- + * CMakeLists.txt:
- + * WebCore.vcproj/WebCore.vcproj:
- + * WebCore.gyp/WebCore.gyp:
- + * WebCore.pri:
- + * WebCore.xcodeproj/project.pbxproj:
- + * css/CSSParser.cpp:
- + * css/makeprop.pl:
- + * css/makevalues.pl:
- + * html/DocTypeStrings.gperf:
- + * html/HTMLDocument.cpp:
- + * html/HTMLEntityNames.gperf:
- + * html/HTMLEntityParser.cpp:
- + * html/LegacyHTMLDocumentParser.cpp:
- + * html/LegacyPreloadScanner.cpp:
- + * make-hash-tools.pl:
- + * platform/ColorData.gperf:
- + * platform/graphics/Color.cpp:
- +
- 2010-08-09 François Sausset <sausset@gmail.com>
- Reviewed by Kenneth Rohde Christiansen.
- diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
- index a28ee5d..55dbb21 100644
- --- a/WebCore/WebCore.gyp/WebCore.gyp
- +++ b/WebCore/WebCore.gyp/WebCore.gyp
- @@ -607,7 +607,6 @@
- '<(SHARED_INTERMEDIATE_DIR)/webkit',
- '<(RULE_INPUT_PATH)',
- ],
- - 'process_outputs_as_sources': 0,
- },
- # Rule to build generated JavaScript (V8) bindings from .idl source.
- {
- @@ -702,6 +701,13 @@
- # in webcore_files.
- '<@(derived_sources_aggregate_files)',
- + # Additional .cpp files for HashTools.h
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityNames.cpp',
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/DocTypeStrings.cpp',
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorData.cpp',
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
- +
- # Additional .cpp files from webcore_bindings_sources actions.
- '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
- diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
- index 7dd0681..163aa6a 100644
- --- a/WebCore/WebCore.pri
- +++ b/WebCore/WebCore.pri
- @@ -707,7 +707,7 @@ cssprops.wkScript = $$PWD/css/makeprop.pl
- cssprops.output = $${WC_GENERATED_SOURCES_DIR}/CSSPropertyNames.cpp
- cssprops.input = WALDOCSSPROPS
- cssprops.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssprops.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
- -cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES}
- +cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} $$cssprops.wkScript
- addExtraCompiler(cssprops)
- # GENERATOR 6-B:
- @@ -715,7 +715,7 @@ cssvalues.wkScript = $$PWD/css/makevalues.pl
- cssvalues.output = $${WC_GENERATED_SOURCES_DIR}/CSSValueKeywords.cpp
- cssvalues.input = WALDOCSSVALUES
- cssvalues.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $$EXTRACSSVALUES > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssvalues.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
- -cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES}
- +cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES} $$cssvalues.wkScript
- cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.h
- addExtraCompiler(cssvalues)
- diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
- index f811295..58a2f66 100644
- --- a/WebCore/WebCore.vcproj/WebCore.vcproj
- +++ b/WebCore/WebCore.vcproj/WebCore.vcproj
- @@ -545,6 +545,30 @@
- >
- </File>
- <File
- + RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\HashTools.h"
- + >
- + </File>
- + <File
- + RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\HTMLEntityNames.cpp"
- + >
- + </File>
- + <File
- + RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\DocTypeStrings.cpp"
- + >
- + </File>
- + <File
- + RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\CSSValueKeywords.cpp"
- + >
- + </File>
- + <File
- + RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\CSSPropertyNames.cpp"
- + >
- + </File>
- + <File
- + RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\ColorData.cpp"
- + >
- + </File>
- + <File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.cpp"
- >
- </File>
- diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
- index 3791dc9..0551007 100644
- --- a/WebCore/WebCore.xcodeproj/project.pbxproj
- +++ b/WebCore/WebCore.xcodeproj/project.pbxproj
- @@ -488,6 +488,11 @@
- 1AB7FC860A8B92EC00D9D37B /* XPathValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC650A8B92EC00D9D37B /* XPathValue.h */; };
- 1AB7FC870A8B92EC00D9D37B /* XPathVariableReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC660A8B92EC00D9D37B /* XPathVariableReference.cpp */; };
- 1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC670A8B92EC00D9D37B /* XPathVariableReference.h */; };
- + 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FB1198307D009D59D6 /* ColorData.cpp */; };
- + 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */; };
- + 1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */; };
- + 1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */; };
- + 1ABA77FD11D21031004C201C /* HTMLEntityNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F4021198329A009D59D6 /* HTMLEntityNames.cpp */; };
- 1ABFE7530CD968D000FE4834 /* SQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABFE7520CD968D000FE4834 /* SQLTransaction.cpp */; };
- 1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC2260A0DB69F190089B669 /* JSDOMApplicationCache.cpp */; };
- 1AC2260D0DB69F190089B669 /* JSDOMApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC2260B0DB69F190089B669 /* JSDOMApplicationCache.h */; };
- @@ -20429,6 +20434,11 @@
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- + 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
- + 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
- + 1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */,
- + 1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */,
- + 1ABA77FD11D21031004C201C /* HTMLEntityNames.cpp in Sources */,
- B5B5DC69119BB3D5002A8790 /* AbstractDatabase.cpp in Sources */,
- 41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
- 29A812280FBB9C1D00510293 /* AccessibilityARIAGrid.cpp in Sources */,
- diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
- index aa6cdd9..c8f1173 100644
- --- a/WebCore/css/CSSParser.cpp
- +++ b/WebCore/css/CSSParser.cpp
- @@ -61,6 +61,7 @@
- #include "FloatConversion.h"
- #include "FontFamilyValue.h"
- #include "FontValue.h"
- +#include "HashTools.h"
- #include "MediaList.h"
- #include "MediaQueryExp.h"
- #include "Pair.h"
- @@ -88,9 +89,6 @@ extern int cssyyparse(void* parser);
- using namespace std;
- using namespace WTF;
- -#include "CSSPropertyNames.cpp"
- -#include "CSSValueKeywords.cpp"
- -
- namespace WebCore {
- static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
- diff --git a/WebCore/css/makeprop.pl b/WebCore/css/makeprop.pl
- index 0fd1f08..0dd8444 100644
- --- a/WebCore/css/makeprop.pl
- +++ b/WebCore/css/makeprop.pl
- @@ -41,15 +41,14 @@ print GPERF << "EOF";
- #include \"CSSPropertyNames.h\"
- %}
- %struct-type
- -struct Property {
- - const char* name;
- - int id;
- -};
- -%language=ANSI-C
- +struct Property;
- +%omit-struct-type
- +%language=C++
- %readonly-tables
- %global-table
- %compare-strncmp
- -%define lookup-function-name findProperty
- +%define class-name CSSPropertyNamesHash
- +%define lookup-function-name findPropertyImpl
- %define hash-function-name propery_hash_function
- %define word-array-name property_wordlist
- %includes
- @@ -72,6 +71,10 @@ print HEADER << "EOF";
- #ifndef CSSPropertyNames_h
- #define CSSPropertyNames_h
- +#include <string.h>
- +
- +namespace WebCore {
- +
- enum CSSPropertyID {
- CSSPropertyInvalid = 0,
- EOF
- @@ -99,15 +102,17 @@ print HEADER << "EOF";
- const char* getPropertyName(CSSPropertyID);
- +} // namespace WebCore
- +
- #endif // CSSPropertyNames_h
- EOF
- close HEADER;
- -system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
- +system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.h") == 0 || die "calling gperf failed: $?";
- -open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing";
- +open C, ">>CSSPropertyNamesHash.h" || die "Could not open CSSPropertyNamesHash.h for writing";
- print C "static const char * const propertyNameStrings[$num] = {\n";
- foreach my $name (@names) {
- @@ -116,6 +121,29 @@ foreach my $name (@names) {
- print C << "EOF";
- };
- +
- +EOF
- +
- +close C;
- +
- +my $propertyNamesImpl = "CSSPropertyNames.cpp";
- +
- +open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing";
- +print PROPERTYNAMES << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +
- +#include "CSSPropertyNames.h"
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "CSSPropertyNamesHash.h"
- +
- +const Property* findProperty (register const char* str, register unsigned int len)
- +{
- + return CSSPropertyNamesHash::findPropertyImpl(str, len);
- +}
- +
- const char* getPropertyName(CSSPropertyID id)
- {
- if (id < firstCSSProperty)
- @@ -125,7 +153,10 @@ const char* getPropertyName(CSSPropertyID id)
- return 0;
- return propertyNameStrings[index];
- }
- +
- +} // namespace WebCore
- +
- EOF
- -close C;
- +close PROPERTYNAMES;
- diff --git a/WebCore/css/makevalues.pl b/WebCore/css/makevalues.pl
- index 421e470..c9f7f70 100644
- --- a/WebCore/css/makevalues.pl
- +++ b/WebCore/css/makevalues.pl
- @@ -42,14 +42,13 @@ print GPERF << "EOF";
- #include \"CSSValueKeywords.h\"
- %}
- %struct-type
- -struct Value {
- - const char* name;
- - int id;
- -};
- -%language=ANSI-C
- +struct Value;
- +%omit-struct-type
- +%language=C++
- %readonly-tables
- %compare-strncmp
- -%define lookup-function-name findValue
- +%define class-name CSSValueKeywordsHash
- +%define lookup-function-name findValueImpl
- %define hash-function-name value_hash_function
- %define word-array-name value_word_list
- %includes
- @@ -72,6 +71,10 @@ print HEADER << "EOF";
- #ifndef CSSValueKeywords_h
- #define CSSValueKeywords_h
- +#include <string.h>
- +
- +namespace WebCore {
- +
- const int CSSValueInvalid = 0;
- EOF
- @@ -92,13 +95,16 @@ print HEADER << "EOF";
- const char* getValueName(unsigned short id);
- +} // namespace WebCore
- +
- #endif // CSSValueKeywords_h
- +
- EOF
- close HEADER;
- -system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
- +system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.h") == 0 || die "calling gperf failed: $?";
- -open C, ">>CSSValueKeywords.cpp" || die "Could not open CSSValueKeywords.cpp for writing";
- +open C, ">>CSSValueKeywordsHash.h" || die "Could not open CSSValueKeywordsHash.h for writing";
- print C "static const char * const valueList[] = {\n";
- print C "\"\",\n";
- foreach my $name (@names) {
- @@ -107,12 +113,38 @@ foreach my $name (@names) {
- print C << "EOF";
- 0
- };
- +
- +EOF
- +
- +close C;
- +
- +my $valueKeywordsImpl = "CSSValueKeywords.cpp";
- +
- +open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing";
- +print VALUEKEYWORDS << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "CSSValueKeywords.h"
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "CSSValueKeywordsHash.h"
- +
- +const Value* findValue (register const char* str, register unsigned int len)
- +{
- + return CSSValueKeywordsHash::findValueImpl(str, len);
- +}
- +
- const char* getValueName(unsigned short id)
- {
- if (id >= numCSSValueKeywords || id <= 0)
- return 0;
- return valueList[id];
- }
- +
- +} // namespace WebCore
- +
- EOF
- -close C;
- +close VALUEKEYWORDS;
- +
- diff --git a/WebCore/html/DocTypeStrings.gperf b/WebCore/html/DocTypeStrings.gperf
- index 5c213b0..6b7da04 100644
- --- a/WebCore/html/DocTypeStrings.gperf
- +++ b/WebCore/html/DocTypeStrings.gperf
- @@ -1,21 +1,13 @@
- %struct-type
- -struct PubIDInfo {
- - enum eMode {
- - eQuirks,
- - eQuirks3,
- - eAlmostStandards
- - };
- -
- - const char* name;
- - eMode mode_if_no_sysid;
- - eMode mode_if_sysid;
- -}
- -%language=ANSI-C
- +struct PubIDInfo;
- +%omit-struct-type
- +%language=C++
- %readonly-tables
- %global-table
- %compare-strncmp
- +%define class-name DocTypeStringsHash
- %define initializer-suffix ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards
- -%define lookup-function-name findDoctypeEntry
- +%define lookup-function-name findDoctypeEntryImpl
- %define hash-function-name doctype_hash_function
- %includes
- %enum
- diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
- index ff0c2de..5047ca1 100644
- --- a/WebCore/html/HTMLDocument.cpp
- +++ b/WebCore/html/HTMLDocument.cpp
- @@ -64,6 +64,7 @@
- #include "FrameLoader.h"
- #include "FrameTree.h"
- #include "FrameView.h"
- +#include "HashTools.h"
- #include "HTMLDocumentParser.h"
- #include "HTMLBodyElement.h"
- #include "HTMLElementFactory.h"
- @@ -75,8 +76,6 @@
- #include "Settings.h"
- #include <wtf/text/CString.h>
- -#include "DocTypeStrings.cpp"
- -
- namespace WebCore {
- using namespace HTMLNames;
- diff --git a/WebCore/html/HTMLEntityNames.gperf b/WebCore/html/HTMLEntityNames.gperf
- index c665efe..6ec5dca 100644
- --- a/WebCore/html/HTMLEntityNames.gperf
- +++ b/WebCore/html/HTMLEntityNames.gperf
- @@ -25,16 +25,16 @@
- */
- %}
- %struct-type
- -struct Entity {
- - const char *name;
- - int code;
- -};
- -%language=ANSI-C
- +struct Entity;
- +%language=C++
- +%omit-struct-type
- %readonly-tables
- %global-table
- %compare-strncmp
- -%define lookup-function-name findEntity
- +%define class-name HTMLEntityHash
- +%define lookup-function-name findEntityImpl
- %define hash-function-name entity_hash_function
- +%define word-array-name entity_wordlist
- %includes
- %enum
- %%
- diff --git a/WebCore/html/HTMLEntityParser.cpp b/WebCore/html/HTMLEntityParser.cpp
- index 84b2006..4621ef3 100644
- --- a/WebCore/html/HTMLEntityParser.cpp
- +++ b/WebCore/html/HTMLEntityParser.cpp
- @@ -28,21 +28,9 @@
- #include "config.h"
- #include "HTMLEntityParser.h"
- +#include "HashTools.h"
- #include <wtf/Vector.h>
- -// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
- -#ifdef __GNUC__
- -// The main parser includes this too so we are getting two copies of the data. However, this way the code gets inlined.
- -#include "HTMLEntityNames.cpp"
- -#else
- -// Not inlined for non-GCC compilers
- -struct Entity {
- - const char* name;
- - int code;
- -};
- -const struct Entity* findEntity(register const char* str, register unsigned int len);
- -#endif
- -
- using namespace WTF;
- namespace WebCore {
- diff --git a/WebCore/html/LegacyHTMLDocumentParser.cpp b/WebCore/html/LegacyHTMLDocumentParser.cpp
- index cb5fac8..aa6e240 100644
- --- a/WebCore/html/LegacyHTMLDocumentParser.cpp
- +++ b/WebCore/html/LegacyHTMLDocumentParser.cpp
- @@ -39,6 +39,7 @@
- #include "Frame.h"
- #include "FrameLoader.h"
- #include "FrameView.h"
- +#include "HashTools.h"
- #include "HTMLElement.h"
- #include "HTMLNames.h"
- #include "LegacyHTMLTreeBuilder.h"
- @@ -54,8 +55,6 @@
- #include <wtf/ASCIICType.h>
- #include <wtf/CurrentTime.h>
- -#include "HTMLEntityNames.cpp"
- -
- #define PRELOAD_SCANNER_ENABLED 1
- using namespace WTF;
- diff --git a/WebCore/html/LegacyPreloadScanner.cpp b/WebCore/html/LegacyPreloadScanner.cpp
- index c9fda4f..7a6d016 100644
- --- a/WebCore/html/LegacyPreloadScanner.cpp
- +++ b/WebCore/html/LegacyPreloadScanner.cpp
- @@ -38,25 +38,13 @@
- #include "Document.h"
- #include "Frame.h"
- #include "FrameLoader.h"
- +#include "HashTools.h"
- #include "HTMLLinkElement.h"
- #include "HTMLNames.h"
- #include <wtf/text/CString.h>
- #include <wtf/CurrentTime.h>
- #include <wtf/unicode/Unicode.h>
- -// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
- -#ifdef __GNUC__
- -// The main tokenizer includes this too so we are getting two copies of the data. However, this way the code gets inlined.
- -#include "HTMLEntityNames.cpp"
- -#else
- -// Not inlined for non-GCC compilers
- -struct Entity {
- - const char* name;
- - int code;
- -};
- -const struct Entity* findEntity(register const char* str, register unsigned int len);
- -#endif
- -
- #define PRELOAD_DEBUG 0
- using namespace WTF;
- diff --git a/WebCore/make-hash-tools.pl b/WebCore/make-hash-tools.pl
- index 42cb6fd..432ac40 100644
- --- a/WebCore/make-hash-tools.pl
- +++ b/WebCore/make-hash-tools.pl
- @@ -26,35 +26,181 @@ use File::Basename;
- my $outdir = $ARGV[0];
- shift;
- my $option = basename($ARGV[0],".gperf");
- +my $hashToolsHeader = "$outdir/HashTools.h";
- +
- +sub createHashToolsHeader() {
- +
- +open HEADER, ">$hashToolsHeader" || die "Could not open $hashToolsHeader for writing";
- +print HEADER << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#ifndef HashTools_h
- +#define HashTools_h
- +
- +#include "wtf/Platform.h"
- +
- +namespace WebCore {
- +
- +struct Entity {
- + const char* name;
- + int code;
- +};
- +
- +struct PubIDInfo {
- + enum eMode {
- + eQuirks,
- + eQuirks3,
- + eAlmostStandards
- + };
- +
- + const char* name;
- + eMode mode_if_no_sysid;
- + eMode mode_if_sysid;
- +};
- +
- +struct NamedColor {
- + const char* name;
- + int RGBValue;
- +};
- +
- +struct Property {
- + const char* name;
- + int id;
- +};
- +
- +struct Value {
- + const char* name;
- + int id;
- +};
- +
- +const Entity* findEntity(register const char* str, register unsigned int len);
- +const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len);
- +const NamedColor* findColor(register const char* str, register unsigned int len);
- +const Property* findProperty(register const char* str, register unsigned int len);
- +const Value* findValue(register const char* str, register unsigned int len);
- +
- +#if PLATFORM(CHROMIUM)
- +
- +const Entity* wordList();
- +const int wordListSize();
- +
- +#endif
- +
- +}
- +
- +#endif // HashTools_h
- +
- +EOF
- +close HEADER;
- +
- +}
- +
- +
- switch ($option) {
- case "HTMLEntityNames" {
- - my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNames.cpp";
- + createHashToolsHeader();
- +
- + my $htmlEntityNamesImpl = "$outdir/HTMLEntityNames.cpp";
- + my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNamesHash.h";
- my $htmlEntityNamesGperf = $ARGV[0];
- shift;
- + open ENTITIES, ">$htmlEntityNamesImpl" || die "Could not open $htmlEntityNamesImpl for writing";
- + print ENTITIES << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "HTMLEntityNamesHash.h"
- +
- +const Entity* findEntity(register const char* str, register unsigned int len)
- +{
- + return HTMLEntityHash::findEntityImpl(str, len);
- +}
- +
- +#if PLATFORM(CHROMIUM)
- +
- +const Entity* wordList()
- +{
- + return WebCore::entity_wordlist;
- +}
- +
- +const int wordListSize()
- +{
- + return sizeof(WebCore::entity_wordlist) / sizeof(Entity);
- +}
- +
- +#endif // PLATFORM(CHROMIUM)
- +
- +} // namespace WebCore
- +
- +EOF
- + close ENTITIES;
- +
- system("gperf --key-positions=\"*\" -D -s 2 $htmlEntityNamesGperf > $htmlEntityNamesGenerated") == 0 || die "calling gperf failed: $?";
- } # case "HTMLEntityNames"
- case "DocTypeStrings" {
- - my $docTypeStringsGenerated = "$outdir/DocTypeStrings.cpp";
- + my $docTypeStringsImpl = "$outdir/DocTypeStrings.cpp";
- + my $docTypeStringsGenerated = "$outdir/DocTypeStringsHash.h";
- my $docTypeStringsGperf = $ARGV[0];
- shift;
- + open DOCTYPESTRINGS, ">$docTypeStringsImpl" || die "Could not open $docTypeStringsImpl for writing";
- + print DOCTYPESTRINGS << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "DocTypeStringsHash.h"
- +
- +const PubIDInfo* findDoctypeEntry (register const char* str, register unsigned int len)
- +{
- + return DocTypeStringsHash::findDoctypeEntryImpl(str, len);
- +}
- +
- +}
- +
- +EOF
- + close DOCTYPESTRINGS;
- +
- system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?";
- } # case "DocTypeStrings"
- case "ColorData" {
- - my $colorDataGenerated = "$outdir/ColorData.cpp";
- - my $colorDataGperf = $ARGV[0];
- + my $colorDataImpl = "$outdir/ColorData.cpp";
- + my $colorDataGenerated = "$outdir/ColorDataHash.h";
- + my $colorDataGperf = $ARGV[0];
- shift;
- + open COLORDATA, ">$colorDataImpl" || die "Could not open $colorDataImpl for writing";
- + print COLORDATA << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "ColorDataHash.h"
- +
- +const struct NamedColor* findColor (register const char* str, register unsigned int len)
- +{
- + return ColorDataHash::findColorImpl(str, len);
- +}
- +
- +}
- +
- +EOF
- + close COLORDATA;
- +
- system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?";
- } # case "ColorData"
- diff --git a/WebCore/platform/ColorData.gperf b/WebCore/platform/ColorData.gperf
- index 11ef798..d684cb9 100644
- --- a/WebCore/platform/ColorData.gperf
- +++ b/WebCore/platform/ColorData.gperf
- @@ -1,13 +1,12 @@
- %struct-type
- -struct NamedColor {
- - const char *name;
- - int RGBValue;
- -};
- -%language=ANSI-C
- +struct NamedColor;
- +%omit-struct-type
- +%language=C++
- %readonly-tables
- %global-table
- %compare-strncmp
- -%define lookup-function-name findColor
- +%define class-name ColorDataHash
- +%define lookup-function-name findColorImpl
- %define hash-function-name colordata_hash_function
- %includes
- %enum
- diff --git a/WebCore/platform/graphics/Color.cpp b/WebCore/platform/graphics/Color.cpp
- index 80c8286..f28d51c 100644
- --- a/WebCore/platform/graphics/Color.cpp
- +++ b/WebCore/platform/graphics/Color.cpp
- @@ -26,13 +26,12 @@
- #include "config.h"
- #include "Color.h"
- +#include "HashTools.h"
- #include "PlatformString.h"
- #include <math.h>
- #include <wtf/Assertions.h>
- #include <wtf/MathExtras.h>
- -#include "ColorData.cpp"
- -
- using namespace std;
- using namespace WTF;
- diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
- index a4c845c..18b167e 100644
- --- a/WebKit/chromium/ChangeLog
- +++ b/WebKit/chromium/ChangeLog
- @@ -1,3 +1,24 @@
- +2010-08-09 Andras Becsi <abecsi@webkit.org>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Undefined reference errors when linking due to gperf and inlining.
- + webkit.org/b/29244
- +
- + EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>
- +
- + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
- + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
- + to access the functionality provided. This resulted in debug build failure with newer gcc versions
- + because of a behaviour change of gcc, which disables C style inlining in debug mode.
- + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
- + in their own compilation unit.
- + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
- + for multiple inclusions of generated C files to access these functions.
- +
- + * src/WebEntities.cpp:
- + (WebKit::WebEntities::WebEntities):
- +
- 2010-08-07 Jay Civelli <jcivelli@chromium.org>
- Reviewed by Eric Seidel.
- diff --git a/WebKit/chromium/src/WebEntities.cpp b/WebKit/chromium/src/WebEntities.cpp
- index 665d8d9..78c3f5f 100644
- --- a/WebKit/chromium/src/WebEntities.cpp
- +++ b/WebKit/chromium/src/WebEntities.cpp
- @@ -31,9 +31,9 @@
- #include "config.h"
- #include "WebEntities.h"
- -#include <string.h>
- -
- +#include "HashTools.h"
- #include "PlatformString.h"
- +#include <string.h>
- #include "StringBuilder.h"
- #include <wtf/HashMap.h>
- @@ -41,15 +41,6 @@
- using namespace WebCore;
- -namespace {
- -// Note that this file is also included by LegacyHTMLDocumentParser.cpp so we are getting
- -// two copies of the data in memory. We can fix this by changing the script
- -// that generated the array to create a static const that is its length, but
- -// this is low priority since the data is less than 4K. We use anonymous
- -// namespace to prevent name collisions.
- -#include "HTMLEntityNames.cpp" // NOLINT
- -}
- -
- namespace WebKit {
- void populateMap(WTF::HashMap<int, WebCore::String>& map,
- @@ -91,8 +82,8 @@ WebEntities::WebEntities(bool xmlEntities)
- false);
- else
- populateMap(m_entitiesMap,
- - wordlist,
- - sizeof(wordlist) / sizeof(Entity),
- + wordList(),
- + wordListSize(),
- true);
- }
- diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
- index 7275642..a89eba9 100644
- --- a/WebKit/qt/ChangeLog
- +++ b/WebKit/qt/ChangeLog
- @@ -1,3 +1,24 @@
- +2010-08-09 Andras Becsi <abecsi@webkit.org>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Undefined reference errors when linking due to gperf and inlining.
- + webkit.org/b/29244
- +
- + EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>
- +
- + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
- + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
- + to access the functionality provided. This resulted in debug build failure with newer gcc versions
- + because of a behaviour change of gcc, which disables C style inlining in debug mode.
- + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
- + in their own compilation unit.
- + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
- + for multiple inclusions of generated C files to access these functions.
- +
- + * WebCoreSupport/FrameLoaderClientQt.cpp:
- + (WebCore::FrameLoaderClientQt::createPlugin):
- +
- 2010-08-08 Ariya Hidayat <ariya@sencha.com>
- Reviewed by Antonio Gomes.
- diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
- index 1060023..3d91d55 100644
- --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
- +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
- @@ -1407,7 +1407,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
- for (unsigned i = 0; i < numqStyleSheetProperties; ++i) {
- CSSPropertyID property = qstyleSheetProperties[i];
- - styleSheet += QString::fromLatin1(::getPropertyName(property));
- + styleSheet += QString::fromLatin1(getPropertyName(property));
- styleSheet += QLatin1Char(':');
- styleSheet += computedStyle(element)->getPropertyValue(property);
- styleSheet += QLatin1Char(';');
- diff --git a/cmake/WebKitGenerators.cmake b/cmake/WebKitGenerators.cmake
- index 50c9077..5d3b86d 100644
- --- a/cmake/WebKitGenerators.cmake
- +++ b/cmake/WebKitGenerators.cmake
- @@ -2,7 +2,6 @@
- # It will check for the programs and define the given executables:
- # PERL_EXECUTABLE
- # BISON_EXECUTABLE
- -# GPERF_EXECUTABLE
- # FLEX_EXECUTABLE
- INCLUDE (WebKitFS)
- @@ -69,25 +68,24 @@ MACRO(GENERATE_GRAMMAR _prefix _source)
- ENDMACRO ()
- -FIND_PROGRAM(GPERF_EXECUTABLE gperf)
- -IF (NOT GPERF_EXECUTABLE)
- - MESSAGE(FATAL_ERROR "Missing gperf")
- -ENDIF ()
- -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPerf DEFAULT_MSG GPERF_EXECUTABLE)
- -SET(PERF_HASH_GENERATOR ${WEBCORE_DIR}/make-hash-tools.pl)
- -
- # - Create perfect hash tables using gperf
- -# GENERATE_GPERF(extension source_file)
- -#
- -# The generated files lives in ${DERIVED_SOURCES_DIR} and ends in .cpp
- -MACRO(GENERATE_GPERF _source)
- +MACRO(MAKE_HASH_TOOLS _source)
- GET_FILENAME_COMPONENT(_name ${_source} NAME_WE)
- +
- + IF (${_source} STREQUAL "HTMLEntityNames")
- + SET(_hash_tools_h "${DERIVED_SOURCES_DIR}/HashTools.h")
- + ELSE ()
- + SET(_hash_tools_h "")
- + ENDIF ()
- +
- ADD_CUSTOM_COMMAND(
- - OUTPUT ${DERIVED_SOURCES_DIR}/${_name}.cpp
- - DEPENDS ${_source}
- - COMMAND ${PERL_EXECUTABLE} ${PERF_HASH_GENERATOR} ${DERIVED_SOURCES_DIR} ${_source}
- + OUTPUT ${DERIVED_SOURCES_DIR}/${_name}.cpp ${_hash_tools_h}
- + COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/make-hash-tools.pl ${DERIVED_SOURCES_DIR} ${_source}.gperf
- VERBATIM)
- -ENDMACRO ()
- +
- + UNSET(_name)
- + UNSET(_hash_tools_h)
- +ENDMACRO()
- # Modules that the bindings generator scripts may use
Add Comment
Please, Sign In to add comment