Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: WebCore/ChangeLog
- ===================================================================
- --- WebCore/ChangeLog (revision 61698)
- +++ WebCore/ChangeLog (working copy)
- @@ -1,3 +1,37 @@
- +2010-06-23 Andras Becsi <abecsi@webkit.org>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Undefined reference errors when linking due to gperf and inlining.
- + webkit.org/b/29244
- +
- + 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 functionality added, no new tests needed.
- +
- + * CMakeLists.txt:
- + * 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/LegacyPreloadScanner.cpp:
- + * make-hash-tools.pl:
- + * platform/ColorData.gperf:
- + * platform/graphics/Color.cpp:
- +
- 2010-06-23 Kevin Ollivier <kevino@theolliviers.com>
- Reviewed by Darin Adler.
- Index: WebCore/CMakeLists.txt
- ===================================================================
- --- WebCore/CMakeLists.txt (revision 61698)
- +++ WebCore/CMakeLists.txt (working copy)
- @@ -516,6 +516,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}/UserAgentStyleSheetsData.cpp
- Index: WebCore/WebCore.pri
- ===================================================================
- --- WebCore/WebCore.pri (revision 61698)
- +++ WebCore/WebCore.pri (working copy)
- @@ -682,7 +682,7 @@ cssprops.wkScript = $$PWD/css/makeprop.p
- 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:
- @@ -690,7 +690,7 @@ cssvalues.wkScript = $$PWD/css/makevalue
- 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)
- Index: WebCore/make-hash-tools.pl
- ===================================================================
- --- WebCore/make-hash-tools.pl (revision 61698)
- +++ WebCore/make-hash-tools.pl (working copy)
- @@ -26,35 +26,179 @@ 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
- +
- +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"
- Index: WebCore/WebCore.gyp/WebCore.gyp
- ===================================================================
- --- WebCore/WebCore.gyp/WebCore.gyp (revision 61698)
- +++ WebCore/WebCore.gyp/WebCore.gyp (working copy)
- @@ -546,7 +546,6 @@
- '<(SHARED_INTERMEDIATE_DIR)/webkit',
- '<(RULE_INPUT_PATH)',
- ],
- - 'process_outputs_as_sources': 0,
- },
- # Rule to build generated JavaScript (V8) bindings from .idl source.
- {
- @@ -653,6 +652,13 @@
- # Additional .cpp files from the webcore_bindings_sources rules.
- '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSGrammar.cpp',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/XPathGrammar.cpp',
- +
- + # 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',
- ],
- 'conditions': [
- ['javascript_engine=="v8"', {
- Index: WebCore/WebCore.xcodeproj/project.pbxproj
- ===================================================================
- --- WebCore/WebCore.xcodeproj/project.pbxproj (revision 61698)
- +++ WebCore/WebCore.xcodeproj/project.pbxproj (working copy)
- @@ -458,6 +458,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 */; };
- @@ -21845,6 +21850,11 @@
- 1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */,
- B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */,
- A8E6A78211D1661B00311F4A /* HTMLParserScheduler.cpp in Sources */,
- + 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 */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- Index: WebCore/css/CSSParser.cpp
- ===================================================================
- --- WebCore/css/CSSParser.cpp (revision 61698)
- +++ WebCore/css/CSSParser.cpp (working copy)
- @@ -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;
- Index: WebCore/css/makeprop.pl
- ===================================================================
- --- WebCore/css/makeprop.pl (revision 61698)
- +++ WebCore/css/makeprop.pl (working copy)
- @@ -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(CSSPropertyI
- return 0;
- return propertyNameStrings[index];
- }
- +
- +} // namespace WebCore
- +
- EOF
- -close C;
- +close PROPERTYNAMES;
- Index: WebCore/css/makevalues.pl
- ===================================================================
- --- WebCore/css/makevalues.pl (revision 61698)
- +++ WebCore/css/makevalues.pl (working copy)
- @@ -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;
- +
- Index: WebCore/html/DocTypeStrings.gperf
- ===================================================================
- --- WebCore/html/DocTypeStrings.gperf (revision 61698)
- +++ WebCore/html/DocTypeStrings.gperf (working copy)
- @@ -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
- Index: WebCore/html/HTMLDocument.cpp
- ===================================================================
- --- WebCore/html/HTMLDocument.cpp (revision 61698)
- +++ WebCore/html/HTMLDocument.cpp (working copy)
- @@ -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;
- Index: WebCore/html/HTMLEntityNames.gperf
- ===================================================================
- --- WebCore/html/HTMLEntityNames.gperf (revision 61698)
- +++ WebCore/html/HTMLEntityNames.gperf (working copy)
- @@ -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
- %%
- Index: WebCore/html/HTMLEntityParser.cpp
- ===================================================================
- --- WebCore/html/HTMLEntityParser.cpp (revision 61698)
- +++ WebCore/html/HTMLEntityParser.cpp (working copy)
- @@ -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 {
- Index: WebCore/html/LegacyPreloadScanner.cpp
- ===================================================================
- --- WebCore/html/LegacyPreloadScanner.cpp (revision 61698)
- +++ WebCore/html/LegacyPreloadScanner.cpp (working copy)
- @@ -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;
- Index: WebCore/platform/ColorData.gperf
- ===================================================================
- --- WebCore/platform/ColorData.gperf (revision 61698)
- +++ WebCore/platform/ColorData.gperf (working copy)
- @@ -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
- Index: WebCore/platform/graphics/Color.cpp
- ===================================================================
- --- WebCore/platform/graphics/Color.cpp (revision 61698)
- +++ WebCore/platform/graphics/Color.cpp (working copy)
- @@ -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;
- Index: WebKit/chromium/ChangeLog
- ===================================================================
- --- WebKit/chromium/ChangeLog (revision 61698)
- +++ WebKit/chromium/ChangeLog (working copy)
- @@ -1,3 +1,21 @@
- +2010-06-23 Andras Becsi <abecsi@webkit.org>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Undefined reference errors when linking due to gperf and inlining.
- + webkit.org/b/29244
- +
- + 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:
- +
- 2010-06-23 Yuzo Fujishima <yuzo@google.com>
- Reviewed by Shinichiro Hamaji.
- Index: WebKit/chromium/src/WebEntities.cpp
- ===================================================================
- --- WebKit/chromium/src/WebEntities.cpp (revision 61698)
- +++ WebKit/chromium/src/WebEntities.cpp (working copy)
- @@ -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 xmlEntitie
- false);
- else
- populateMap(m_entitiesMap,
- - wordlist,
- - sizeof(wordlist) / sizeof(Entity),
- + wordList(),
- + wordListSize(),
- true);
- }
- Index: WebKit/qt/ChangeLog
- ===================================================================
- --- WebKit/qt/ChangeLog (revision 61698)
- +++ WebKit/qt/ChangeLog (working copy)
- @@ -1,3 +1,22 @@
- +2010-06-23 Andras Becsi <abecsi@webkit.org>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Undefined reference errors when linking due to gperf and inlining.
- + webkit.org/b/29244
- +
- + 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-06-23 David Boddie <dboddie@trolltech.com>
- Reviewed by Simon Hausmann.
- Index: WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
- ===================================================================
- --- WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (revision 61698)
- +++ WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (working copy)
- @@ -1322,7 +1322,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::
- 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(';');
Add Comment
Please, Sign In to add comment