Guest User

Untitled

a guest
May 29th, 2018
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.04 KB | None | 0 0
  1. Index: WebCore/ChangeLog
  2. ===================================================================
  3. --- WebCore/ChangeLog (revision 61617)
  4. +++ WebCore/ChangeLog (working copy)
  5. @@ -1,3 +1,35 @@
  6. +2010-06-22 Andras Becsi <abecsi@webkit.org>
  7. +
  8. + Reviewed by NOBODY (OOPS!).
  9. +
  10. + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
  11. + webkit.org/b/29244
  12. +
  13. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
  14. + to access the functionality provided. This resulted in debug build failure with newer gcc versions
  15. + because of a behaviour change of gcc, which disables C style inlining in debug mode.
  16. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
  17. + in their own compilation unit.
  18. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
  19. + for multiple inclusions of generated C files to access these functions.
  20. +
  21. + No new functionality added, no new tests needed.
  22. +
  23. + * WebCore.pri:
  24. + * WebCore.xcodeproj/project.pbxproj:
  25. + * css/CSSParser.cpp:
  26. + * css/makeprop.pl:
  27. + * css/makevalues.pl:
  28. + * html/DocTypeStrings.gperf:
  29. + * html/HTML5EntityParser.cpp:
  30. + * html/HTMLDocument.cpp:
  31. + * html/HTMLDocumentParser.cpp:
  32. + * html/HTMLEntityNames.gperf:
  33. + * html/PreloadScanner.cpp:
  34. + * make-hash-tools.pl:
  35. + * platform/ColorData.gperf:
  36. + * platform/graphics/Color.cpp:
  37. +
  38. 2010-06-22 Yuta Kitamura <yutak@chromium.org>
  39.  
  40. Reviewed by Alexey Proskuryakov.
  41. Index: WebCore/WebCore.pri
  42. ===================================================================
  43. --- WebCore/WebCore.pri (revision 61617)
  44. +++ WebCore/WebCore.pri (working copy)
  45. @@ -681,7 +681,7 @@ cssprops.wkScript = $$PWD/css/makeprop.p
  46. cssprops.output = $${WC_GENERATED_SOURCES_DIR}/CSSPropertyNames.cpp
  47. cssprops.input = WALDOCSSPROPS
  48. 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
  49. -cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES}
  50. +cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} $$cssprops.wkScript
  51. addExtraCompiler(cssprops)
  52.  
  53. # GENERATOR 6-B:
  54. @@ -689,7 +689,7 @@ cssvalues.wkScript = $$PWD/css/makevalue
  55. cssvalues.output = $${WC_GENERATED_SOURCES_DIR}/CSSValueKeywords.cpp
  56. cssvalues.input = WALDOCSSVALUES
  57. 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
  58. -cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES}
  59. +cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES} $$cssvalues.wkScript
  60. cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.h
  61. addExtraCompiler(cssvalues)
  62.  
  63. Index: WebCore/make-hash-tools.pl
  64. ===================================================================
  65. --- WebCore/make-hash-tools.pl (revision 61617)
  66. +++ WebCore/make-hash-tools.pl (working copy)
  67. @@ -26,35 +26,172 @@ use File::Basename;
  68. my $outdir = $ARGV[0];
  69. shift;
  70. my $option = basename($ARGV[0],".gperf");
  71. +my $hashToolsHeader = "$outdir/HashTools.h";
  72. +
  73. +sub createHashToolsHeader() {
  74. +
  75. +open HEADER, ">$hashToolsHeader" || die "Could not open $hashToolsHeader for writing";
  76. +print HEADER << "EOF";
  77. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  78. +
  79. +#ifndef HashTools_h
  80. +#define HashTools_h
  81. +
  82. +namespace WebCore {
  83. +
  84. +struct Entity {
  85. + const char* name;
  86. + int code;
  87. +};
  88. +
  89. +struct PubIDInfo {
  90. + enum eMode {
  91. + eQuirks,
  92. + eQuirks3,
  93. + eAlmostStandards
  94. + };
  95. +
  96. + const char* name;
  97. + eMode mode_if_no_sysid;
  98. + eMode mode_if_sysid;
  99. +};
  100. +
  101. +struct NamedColor {
  102. + const char* name;
  103. + int RGBValue;
  104. +};
  105. +
  106. +struct Property {
  107. + const char* name;
  108. + int id;
  109. +};
  110. +
  111. +struct Value {
  112. + const char* name;
  113. + int id;
  114. +};
  115. +
  116. +const Entity* findEntity(register const char* str, register unsigned int len);
  117. +const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len);
  118. +const NamedColor* findColor(register const char* str, register unsigned int len);
  119. +const Property* findProperty(register const char* str, register unsigned int len);
  120. +const Value* findValue(register const char* str, register unsigned int len);
  121. +
  122. +// Needed by Chromium
  123. +const Entity* wordList();
  124. +const int wordListSize();
  125. +
  126. +}
  127. +
  128. +#endif // HashTools_h
  129. +
  130. +EOF
  131. +close HEADER;
  132. +
  133. +}
  134. +
  135. +
  136.  
  137. switch ($option) {
  138.  
  139. case "HTMLEntityNames" {
  140.  
  141. - my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNames.cpp";
  142. + createHashToolsHeader();
  143. +
  144. + my $htmlEntityNamesImpl = "$outdir/HTMLEntityNames.cpp";
  145. + my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNamesHash.hpp";
  146. my $htmlEntityNamesGperf = $ARGV[0];
  147. shift;
  148.  
  149. + open ENTITIES, ">$htmlEntityNamesImpl" || die "Could not open $htmlEntityNamesImpl for writing";
  150. + print ENTITIES << "EOF";
  151. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  152. +
  153. +#include "HashTools.h"
  154. +
  155. +namespace WebCore {
  156. +#include "HTMLEntityNamesHash.hpp"
  157. +
  158. +const Entity* findEntity(register const char* str, register unsigned int len)
  159. +{
  160. + return HTMLEntityHash::findEntityImpl(str, len);
  161. +}
  162. +
  163. +const Entity* wordList()
  164. +{
  165. + return WebCore::wordlist;
  166. +}
  167. +
  168. +const int wordListSize()
  169. +{
  170. + return sizeof(WebCore::wordlist) / sizeof(Entity);
  171. +}
  172. +
  173. +}
  174. +
  175. +EOF
  176. + close ENTITIES;
  177. +
  178. system("gperf --key-positions=\"*\" -D -s 2 $htmlEntityNamesGperf > $htmlEntityNamesGenerated") == 0 || die "calling gperf failed: $?";
  179.  
  180. } # case "HTMLEntityNames"
  181.  
  182. case "DocTypeStrings" {
  183.  
  184. - my $docTypeStringsGenerated = "$outdir/DocTypeStrings.cpp";
  185. + my $docTypeStringsImpl = "$outdir/DocTypeStrings.cpp";
  186. + my $docTypeStringsGenerated = "$outdir/DocTypeStringsHash.hpp";
  187. my $docTypeStringsGperf = $ARGV[0];
  188. shift;
  189.  
  190. + open DOCTYPESTRINGS, ">$docTypeStringsImpl" || die "Could not open $docTypeStringsImpl for writing";
  191. + print DOCTYPESTRINGS << "EOF";
  192. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  193. +
  194. +#include "HashTools.h"
  195. +
  196. +namespace WebCore {
  197. +#include "DocTypeStringsHash.hpp"
  198. +
  199. +const PubIDInfo* findDoctypeEntry (register const char* str, register unsigned int len)
  200. +{
  201. + return DocTypeStringsHash::findDoctypeEntryImpl(str, len);
  202. +}
  203. +
  204. +}
  205. +
  206. +EOF
  207. + close DOCTYPESTRINGS;
  208. +
  209. system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?";
  210.  
  211. } # case "DocTypeStrings"
  212.  
  213. case "ColorData" {
  214.  
  215. - my $colorDataGenerated = "$outdir/ColorData.cpp";
  216. - my $colorDataGperf = $ARGV[0];
  217. + my $colorDataImpl = "$outdir/ColorData.cpp";
  218. + my $colorDataGenerated = "$outdir/ColorDataHash.hpp";
  219. + my $colorDataGperf = $ARGV[0];
  220. shift;
  221.  
  222. + open COLORDATA, ">$colorDataImpl" || die "Could not open $colorDataImpl for writing";
  223. + print COLORDATA << "EOF";
  224. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  225. +
  226. +#include "HashTools.h"
  227. +
  228. +namespace WebCore {
  229. +#include "ColorDataHash.hpp"
  230. +
  231. +const struct NamedColor* findColor (register const char* str, register unsigned int len)
  232. +{
  233. + return ColorDataHash::findColorImpl(str, len);
  234. +}
  235. +
  236. +}
  237. +
  238. +EOF
  239. + close COLORDATA;
  240. +
  241. system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?";
  242.  
  243. } # case "ColorData"
  244. Index: WebCore/WebCore.xcodeproj/project.pbxproj
  245. ===================================================================
  246. --- WebCore/WebCore.xcodeproj/project.pbxproj (revision 61617)
  247. +++ WebCore/WebCore.xcodeproj/project.pbxproj (working copy)
  248. @@ -373,6 +373,11 @@
  249. 1A569D230D7E2B82007C3983 /* runtime_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF40D7E2B82007C3983 /* runtime_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
  250. 1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CF50D7E2B82007C3983 /* runtime_root.cpp */; };
  251. 1A569D250D7E2B82007C3983 /* runtime_root.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF60D7E2B82007C3983 /* runtime_root.h */; settings = {ATTRIBUTES = (Private, ); }; };
  252. + 1A676E5D11CFC3E0002F85D5 /* HTMLEntityNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F4021198329A009D59D6 /* HTMLEntityNames.cpp */; };
  253. + 1A676E5E11CFC3E6002F85D5 /* CSSValueKeywords.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */; };
  254. + 1A676E6011CFC3EE002F85D5 /* ColorData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FB1198307D009D59D6 /* ColorData.cpp */; };
  255. + 1A676E6111CFC3FB002F85D5 /* CSSPropertyNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */; };
  256. + 1A676E6211CFC408002F85D5 /* DocTypeStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */; };
  257. 1A6938010A11100A00C127FE /* TextDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6937FF0A11100A00C127FE /* TextDocument.cpp */; };
  258. 1A6938020A11100A00C127FE /* TextDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6938000A11100A00C127FE /* TextDocument.h */; };
  259. 1A71D57B0F33819000F9CE4E /* IdentifierRep.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A71D5790F33819000F9CE4E /* IdentifierRep.cpp */; };
  260. @@ -21815,6 +21820,11 @@
  261. 200B190911C277D900DCCD3A /* ScriptBreakpoint.cpp in Sources */,
  262. 1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */,
  263. B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */,
  264. + 1A676E5D11CFC3E0002F85D5 /* HTMLEntityNames.cpp in Sources */,
  265. + 1A676E5E11CFC3E6002F85D5 /* CSSValueKeywords.cpp in Sources */,
  266. + 1A676E6011CFC3EE002F85D5 /* ColorData.cpp in Sources */,
  267. + 1A676E6111CFC3FB002F85D5 /* CSSPropertyNames.cpp in Sources */,
  268. + 1A676E6211CFC408002F85D5 /* DocTypeStrings.cpp in Sources */,
  269. );
  270. runOnlyForDeploymentPostprocessing = 0;
  271. };
  272. Index: WebCore/css/CSSParser.cpp
  273. ===================================================================
  274. --- WebCore/css/CSSParser.cpp (revision 61617)
  275. +++ WebCore/css/CSSParser.cpp (working copy)
  276. @@ -61,6 +61,7 @@
  277. #include "FloatConversion.h"
  278. #include "FontFamilyValue.h"
  279. #include "FontValue.h"
  280. +#include "HashTools.h"
  281. #include "MediaList.h"
  282. #include "MediaQueryExp.h"
  283. #include "Pair.h"
  284. @@ -88,9 +89,6 @@ extern int cssyyparse(void* parser);
  285. using namespace std;
  286. using namespace WTF;
  287.  
  288. -#include "CSSPropertyNames.cpp"
  289. -#include "CSSValueKeywords.cpp"
  290. -
  291. namespace WebCore {
  292.  
  293. static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
  294. Index: WebCore/css/makeprop.pl
  295. ===================================================================
  296. --- WebCore/css/makeprop.pl (revision 61617)
  297. +++ WebCore/css/makeprop.pl (working copy)
  298. @@ -41,15 +41,14 @@ print GPERF << "EOF";
  299. #include \"CSSPropertyNames.h\"
  300. %}
  301. %struct-type
  302. -struct Property {
  303. - const char* name;
  304. - int id;
  305. -};
  306. -%language=ANSI-C
  307. +struct Property;
  308. +%omit-struct-type
  309. +%language=C++
  310. %readonly-tables
  311. %global-table
  312. %compare-strncmp
  313. -%define lookup-function-name findProperty
  314. +%define class-name CSSPropertyNamesHash
  315. +%define lookup-function-name findPropertyImpl
  316. %define hash-function-name propery_hash_function
  317. %define word-array-name property_wordlist
  318. %includes
  319. @@ -72,6 +71,10 @@ print HEADER << "EOF";
  320. #ifndef CSSPropertyNames_h
  321. #define CSSPropertyNames_h
  322.  
  323. +#include <string.h>
  324. +
  325. +namespace WebCore {
  326. +
  327. enum CSSPropertyID {
  328. CSSPropertyInvalid = 0,
  329. EOF
  330. @@ -99,15 +102,17 @@ print HEADER << "EOF";
  331.  
  332. const char* getPropertyName(CSSPropertyID);
  333.  
  334. +} // namespace WebCore
  335. +
  336. #endif // CSSPropertyNames_h
  337.  
  338. EOF
  339.  
  340. close HEADER;
  341.  
  342. -system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
  343. +system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.hpp") == 0 || die "calling gperf failed: $?";
  344.  
  345. -open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing";
  346. +open C, ">>CSSPropertyNamesHash.hpp" || die "Could not open CSSPropertyNamesHash.hpp for writing";
  347. print C "static const char * const propertyNameStrings[$num] = {\n";
  348.  
  349. foreach my $name (@names) {
  350. @@ -116,6 +121,29 @@ foreach my $name (@names) {
  351.  
  352. print C << "EOF";
  353. };
  354. +
  355. +EOF
  356. +
  357. +close C;
  358. +
  359. +my $propertyNamesImpl = "CSSPropertyNames.cpp";
  360. +
  361. +open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing";
  362. +print PROPERTYNAMES << "EOF";
  363. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  364. +
  365. +
  366. +#include "CSSPropertyNames.h"
  367. +#include "HashTools.h"
  368. +
  369. +namespace WebCore {
  370. +#include "CSSPropertyNamesHash.hpp"
  371. +
  372. +const Property* findProperty (register const char* str, register unsigned int len)
  373. +{
  374. + return CSSPropertyNamesHash::findPropertyImpl(str, len);
  375. +}
  376. +
  377. const char* getPropertyName(CSSPropertyID id)
  378. {
  379. if (id < firstCSSProperty)
  380. @@ -125,7 +153,10 @@ const char* getPropertyName(CSSPropertyI
  381. return 0;
  382. return propertyNameStrings[index];
  383. }
  384. +
  385. +} // namespace WebCore
  386. +
  387. EOF
  388.  
  389. -close C;
  390. +close PROPERTYNAMES;
  391.  
  392. Index: WebCore/css/makevalues.pl
  393. ===================================================================
  394. --- WebCore/css/makevalues.pl (revision 61617)
  395. +++ WebCore/css/makevalues.pl (working copy)
  396. @@ -42,14 +42,13 @@ print GPERF << "EOF";
  397. #include \"CSSValueKeywords.h\"
  398. %}
  399. %struct-type
  400. -struct Value {
  401. - const char* name;
  402. - int id;
  403. -};
  404. -%language=ANSI-C
  405. +struct Value;
  406. +%omit-struct-type
  407. +%language=C++
  408. %readonly-tables
  409. %compare-strncmp
  410. -%define lookup-function-name findValue
  411. +%define class-name CSSValueKeywordsHash
  412. +%define lookup-function-name findValueImpl
  413. %define hash-function-name value_hash_function
  414. %define word-array-name value_word_list
  415. %includes
  416. @@ -72,6 +71,10 @@ print HEADER << "EOF";
  417. #ifndef CSSValueKeywords_h
  418. #define CSSValueKeywords_h
  419.  
  420. +#include <string.h>
  421. +
  422. +namespace WebCore {
  423. +
  424. const int CSSValueInvalid = 0;
  425. EOF
  426.  
  427. @@ -92,13 +95,16 @@ print HEADER << "EOF";
  428.  
  429. const char* getValueName(unsigned short id);
  430.  
  431. +} // namespace WebCore
  432. +
  433. #endif // CSSValueKeywords_h
  434. +
  435. EOF
  436. close HEADER;
  437.  
  438. -system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
  439. +system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.hpp") == 0 || die "calling gperf failed: $?";
  440.  
  441. -open C, ">>CSSValueKeywords.cpp" || die "Could not open CSSValueKeywords.cpp for writing";
  442. +open C, ">>CSSValueKeywordsHash.hpp" || die "Could not open CSSValueKeywordsHash.hpp for writing";
  443. print C "static const char * const valueList[] = {\n";
  444. print C "\"\",\n";
  445. foreach my $name (@names) {
  446. @@ -107,12 +113,38 @@ foreach my $name (@names) {
  447. print C << "EOF";
  448. 0
  449. };
  450. +
  451. +EOF
  452. +
  453. +close C;
  454. +
  455. +my $valueKeywordsImpl = "CSSValueKeywords.cpp";
  456. +
  457. +open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing";
  458. +print VALUEKEYWORDS << "EOF";
  459. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  460. +
  461. +#include "CSSValueKeywords.h"
  462. +#include "HashTools.h"
  463. +
  464. +namespace WebCore {
  465. +#include "CSSValueKeywordsHash.hpp"
  466. +
  467. +const Value* findValue (register const char* str, register unsigned int len)
  468. +{
  469. + return CSSValueKeywordsHash::findValueImpl(str, len);
  470. +}
  471. +
  472. const char* getValueName(unsigned short id)
  473. {
  474. if (id >= numCSSValueKeywords || id <= 0)
  475. return 0;
  476. return valueList[id];
  477. }
  478. +
  479. +} // namespace WebCore
  480. +
  481. EOF
  482.  
  483. -close C;
  484. +close VALUEKEYWORDS;
  485. +
  486. Index: WebCore/html/DocTypeStrings.gperf
  487. ===================================================================
  488. --- WebCore/html/DocTypeStrings.gperf (revision 61617)
  489. +++ WebCore/html/DocTypeStrings.gperf (working copy)
  490. @@ -1,21 +1,13 @@
  491. %struct-type
  492. -struct PubIDInfo {
  493. - enum eMode {
  494. - eQuirks,
  495. - eQuirks3,
  496. - eAlmostStandards
  497. - };
  498. -
  499. - const char* name;
  500. - eMode mode_if_no_sysid;
  501. - eMode mode_if_sysid;
  502. -}
  503. -%language=ANSI-C
  504. +struct PubIDInfo;
  505. +%omit-struct-type
  506. +%language=C++
  507. %readonly-tables
  508. %global-table
  509. %compare-strncmp
  510. +%define class-name DocTypeStringsHash
  511. %define initializer-suffix ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards
  512. -%define lookup-function-name findDoctypeEntry
  513. +%define lookup-function-name findDoctypeEntryImpl
  514. %define hash-function-name doctype_hash_function
  515. %includes
  516. %enum
  517. Index: WebCore/html/HTML5EntityParser.cpp
  518. ===================================================================
  519. --- WebCore/html/HTML5EntityParser.cpp (revision 61617)
  520. +++ WebCore/html/HTML5EntityParser.cpp (working copy)
  521. @@ -28,21 +28,9 @@
  522. #include "config.h"
  523. #include "HTML5EntityParser.h"
  524.  
  525. +#include "HashTools.h"
  526. #include <wtf/Vector.h>
  527.  
  528. -// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
  529. -#ifdef __GNUC__
  530. -// The main parser includes this too so we are getting two copies of the data. However, this way the code gets inlined.
  531. -#include "HTMLEntityNames.cpp"
  532. -#else
  533. -// Not inlined for non-GCC compilers
  534. -struct Entity {
  535. - const char* name;
  536. - int code;
  537. -};
  538. -const struct Entity* findEntity(register const char* str, register unsigned int len);
  539. -#endif
  540. -
  541. using namespace WTF;
  542.  
  543. namespace WebCore {
  544. Index: WebCore/html/HTMLDocument.cpp
  545. ===================================================================
  546. --- WebCore/html/HTMLDocument.cpp (revision 61617)
  547. +++ WebCore/html/HTMLDocument.cpp (working copy)
  548. @@ -64,6 +64,7 @@
  549. #include "FrameLoader.h"
  550. #include "FrameTree.h"
  551. #include "FrameView.h"
  552. +#include "HashTools.h"
  553. #include "HTML5DocumentParser.h"
  554. #include "HTMLBodyElement.h"
  555. #include "HTMLElementFactory.h"
  556. @@ -75,8 +76,6 @@
  557. #include "Settings.h"
  558. #include <wtf/text/CString.h>
  559.  
  560. -#include "DocTypeStrings.cpp"
  561. -
  562. namespace WebCore {
  563.  
  564. using namespace HTMLNames;
  565. Index: WebCore/html/HTMLDocumentParser.cpp
  566. ===================================================================
  567. --- WebCore/html/HTMLDocumentParser.cpp (revision 61617)
  568. +++ WebCore/html/HTMLDocumentParser.cpp (working copy)
  569. @@ -39,13 +39,14 @@
  570. #include "Frame.h"
  571. #include "FrameLoader.h"
  572. #include "FrameView.h"
  573. +#include "HashTools.h"
  574. #include "HTMLElement.h"
  575. #include "HTMLNames.h"
  576. -#include "LegacyHTMLTreeConstructor.h"
  577. #include "HTMLScriptElement.h"
  578. #include "HTMLViewSourceDocument.h"
  579. #include "ImageLoader.h"
  580. #include "InspectorTimelineAgent.h"
  581. +#include "LegacyHTMLTreeConstructor.h"
  582. #include "Page.h"
  583. #include "PreloadScanner.h"
  584. #include "ScriptController.h"
  585. @@ -55,8 +56,6 @@
  586. #include <wtf/ASCIICType.h>
  587. #include <wtf/CurrentTime.h>
  588.  
  589. -#include "HTMLEntityNames.cpp"
  590. -
  591. #define PRELOAD_SCANNER_ENABLED 1
  592.  
  593. using namespace WTF;
  594. Index: WebCore/html/HTMLEntityNames.gperf
  595. ===================================================================
  596. --- WebCore/html/HTMLEntityNames.gperf (revision 61617)
  597. +++ WebCore/html/HTMLEntityNames.gperf (working copy)
  598. @@ -25,15 +25,14 @@
  599. */
  600. %}
  601. %struct-type
  602. -struct Entity {
  603. - const char *name;
  604. - int code;
  605. -};
  606. -%language=ANSI-C
  607. +struct Entity;
  608. +%language=C++
  609. +%omit-struct-type
  610. %readonly-tables
  611. %global-table
  612. %compare-strncmp
  613. -%define lookup-function-name findEntity
  614. +%define class-name HTMLEntityHash
  615. +%define lookup-function-name findEntityImpl
  616. %define hash-function-name entity_hash_function
  617. %includes
  618. %enum
  619. Index: WebCore/html/PreloadScanner.cpp
  620. ===================================================================
  621. --- WebCore/html/PreloadScanner.cpp (revision 61617)
  622. +++ WebCore/html/PreloadScanner.cpp (working copy)
  623. @@ -38,25 +38,13 @@
  624. #include "Document.h"
  625. #include "Frame.h"
  626. #include "FrameLoader.h"
  627. +#include "HashTools.h"
  628. #include "HTMLLinkElement.h"
  629. #include "HTMLNames.h"
  630. #include <wtf/text/CString.h>
  631. #include <wtf/CurrentTime.h>
  632. #include <wtf/unicode/Unicode.h>
  633.  
  634. -// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
  635. -#ifdef __GNUC__
  636. -// The main tokenizer includes this too so we are getting two copies of the data. However, this way the code gets inlined.
  637. -#include "HTMLEntityNames.cpp"
  638. -#else
  639. -// Not inlined for non-GCC compilers
  640. -struct Entity {
  641. - const char* name;
  642. - int code;
  643. -};
  644. -const struct Entity* findEntity(register const char* str, register unsigned int len);
  645. -#endif
  646. -
  647. #define PRELOAD_DEBUG 0
  648.  
  649. using namespace WTF;
  650. Index: WebCore/platform/ColorData.gperf
  651. ===================================================================
  652. --- WebCore/platform/ColorData.gperf (revision 61617)
  653. +++ WebCore/platform/ColorData.gperf (working copy)
  654. @@ -1,13 +1,12 @@
  655. %struct-type
  656. -struct NamedColor {
  657. - const char *name;
  658. - int RGBValue;
  659. -};
  660. -%language=ANSI-C
  661. +struct NamedColor;
  662. +%omit-struct-type
  663. +%language=C++
  664. %readonly-tables
  665. %global-table
  666. %compare-strncmp
  667. -%define lookup-function-name findColor
  668. +%define class-name ColorDataHash
  669. +%define lookup-function-name findColorImpl
  670. %define hash-function-name colordata_hash_function
  671. %includes
  672. %enum
  673. Index: WebCore/platform/graphics/Color.cpp
  674. ===================================================================
  675. --- WebCore/platform/graphics/Color.cpp (revision 61617)
  676. +++ WebCore/platform/graphics/Color.cpp (working copy)
  677. @@ -26,13 +26,12 @@
  678. #include "config.h"
  679. #include "Color.h"
  680.  
  681. +#include "HashTools.h"
  682. #include "PlatformString.h"
  683. #include <math.h>
  684. #include <wtf/Assertions.h>
  685. #include <wtf/MathExtras.h>
  686.  
  687. -#include "ColorData.cpp"
  688. -
  689. using namespace std;
  690. using namespace WTF;
  691.  
  692. Index: WebKit/chromium/ChangeLog
  693. ===================================================================
  694. --- WebKit/chromium/ChangeLog (revision 61617)
  695. +++ WebKit/chromium/ChangeLog (working copy)
  696. @@ -1,3 +1,20 @@
  697. +2010-06-22 Andras Becsi <abecsi@webkit.org>
  698. +
  699. + Reviewed by NOBODY (OOPS!).
  700. +
  701. + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
  702. + webkit.org/b/29244
  703. +
  704. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
  705. + to access the functionality provided. This resulted in debug build failure with newer gcc versions
  706. + because of a behaviour change of gcc, which disables C style inlining in debug mode.
  707. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
  708. + in their own compilation unit.
  709. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
  710. + for multiple inclusions of generated C files to access these functions.
  711. +
  712. + * src/WebEntities.cpp:
  713. +
  714. 2010-06-22 Mikhail Naganov <mnaganov@chromium.org>
  715.  
  716. Reviewed by Pavel Feldman.
  717. Index: WebKit/chromium/src/WebEntities.cpp
  718. ===================================================================
  719. --- WebKit/chromium/src/WebEntities.cpp (revision 61617)
  720. +++ WebKit/chromium/src/WebEntities.cpp (working copy)
  721. @@ -31,9 +31,9 @@
  722. #include "config.h"
  723. #include "WebEntities.h"
  724.  
  725. -#include <string.h>
  726. -
  727. +#include "HashTools.h"
  728. #include "PlatformString.h"
  729. +#include <string.h>
  730. #include "StringBuilder.h"
  731. #include <wtf/HashMap.h>
  732.  
  733. @@ -41,15 +41,6 @@
  734.  
  735. using namespace WebCore;
  736.  
  737. -namespace {
  738. -// Note that this file is also included by HTMLDocumentParser.cpp so we are getting
  739. -// two copies of the data in memory. We can fix this by changing the script
  740. -// that generated the array to create a static const that is its length, but
  741. -// this is low priority since the data is less than 4K. We use anonymous
  742. -// namespace to prevent name collisions.
  743. -#include "HTMLEntityNames.cpp" // NOLINT
  744. -}
  745. -
  746. namespace WebKit {
  747.  
  748. void populateMap(WTF::HashMap<int, WebCore::String>& map,
  749. @@ -91,8 +82,8 @@ WebEntities::WebEntities(bool xmlEntitie
  750. false);
  751. else
  752. populateMap(m_entitiesMap,
  753. - wordlist,
  754. - sizeof(wordlist) / sizeof(Entity),
  755. + wordList(),
  756. + wordListSize(),
  757. true);
  758. }
  759.  
  760. Index: WebKit/qt/ChangeLog
  761. ===================================================================
  762. --- WebKit/qt/ChangeLog (revision 61617)
  763. +++ WebKit/qt/ChangeLog (working copy)
  764. @@ -1,3 +1,21 @@
  765. +2010-06-22 Andras Becsi <abecsi@webkit.org>
  766. +
  767. + Reviewed by NOBODY (OOPS!).
  768. +
  769. + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
  770. + webkit.org/b/29244
  771. +
  772. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
  773. + to access the functionality provided. This resulted in debug build failure with newer gcc versions
  774. + because of a behaviour change of gcc, which disables C style inlining in debug mode.
  775. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
  776. + in their own compilation unit.
  777. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
  778. + for multiple inclusions of generated C files to access these functions.
  779. +
  780. + * WebCoreSupport/FrameLoaderClientQt.cpp:
  781. + (WebCore::FrameLoaderClientQt::createPlugin):
  782. +
  783. 2010-06-22 Tasuku Suzuki <tasuku.suzuki@nokia.com>
  784.  
  785. Reviewed by Simon Hausmann.
  786. Index: WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
  787. ===================================================================
  788. --- WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (revision 61617)
  789. +++ WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (working copy)
  790. @@ -1322,7 +1322,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::
  791. for (unsigned i = 0; i < numqStyleSheetProperties; ++i) {
  792. CSSPropertyID property = qstyleSheetProperties[i];
  793.  
  794. - styleSheet += QString::fromLatin1(::getPropertyName(property));
  795. + styleSheet += QString::fromLatin1(getPropertyName(property));
  796. styleSheet += QLatin1Char(':');
  797. styleSheet += computedStyle(element)->getPropertyValue(property);
  798. styleSheet += QLatin1Char(';');
Add Comment
Please, Sign In to add comment