Changeset 171264 in webkit


Ignore:
Timestamp:
Jul 19, 2014 11:07:43 AM (10 years ago)
Author:
mrowe@apple.com
Message:

<https://webkit.org/b/135085> Ensure that make_names.pl generates the same result when run multiple times.

Perl 5.18 introduced hash randomization. This results in the iteration order of hashes being different
from one run to the next. To ensure identical output we can iterate over the hash keys in sorted order.

Reviewed by Alexey Proskuryakov.

  • bindings/scripts/StaticString.pm:

(GenerateStrings):
(GenerateStringAsserts):

  • dom/make_names.pl:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r171261 r171264  
     12014-07-19  Mark Rowe  <mrowe@apple.com>
     2
     3        <https://webkit.org/b/135085> Ensure that make_names.pl generates the same result when run multiple times.
     4
     5        Perl 5.18 introduced hash randomization. This results in the iteration order of hashes being different
     6        from one run to the next. To ensure identical output we can iterate over the hash keys in sorted order.
     7
     8        Reviewed by Alexey Proskuryakov.
     9
     10        * bindings/scripts/StaticString.pm:
     11        (GenerateStrings):
     12        (GenerateStringAsserts):
     13        * dom/make_names.pl:
     14
    1152014-07-19  Zan Dobersek  <zdobersek@igalia.com>
    216
  • trunk/Source/WebCore/bindings/scripts/StaticString.pm

    r166120 r171264  
    3434    my @result = ();
    3535
    36     while ( my ($name, $value) = each %strings ) {
    37         push(@result, "static const LChar ${name}String8[] = \"${value}\";\n");
     36    for my $name (sort keys %strings) {
     37        push(@result, "static const LChar ${name}String8[] = \"$strings{$name}\";\n");
    3838    }
    3939
    4040    push(@result, "\n");
    4141
    42     while ( my ($name, $value) = each %strings ) {
     42    for my $name (sort keys %strings) {
     43        my $value = $strings{$name};
    4344        my $length = length($value);
    4445        my $hash = Hasher::GenerateHashValue($value);
     
    6768    push(@result, "#ifndef NDEBUG\n");
    6869
    69     while ( my ($name, $value) = each %strings ) {
     70    for my $name (sort keys %strings) {
    7071        push(@result, "    reinterpret_cast<StringImpl*>(&${name}Data)->assertHashIsCorrect();\n");
    7172    }
  • trunk/Source/WebCore/dom/make_names.pl

    r166128 r171264  
    120120    print F StaticString::GenerateStrings(\%parameters);
    121121
    122     while ( my ($name, $identifier) = each %parameters ) {
     122    for my $name (sort keys %parameters) {
    123123        print F "DEFINE_GLOBAL(AtomicString, $name)\n";
    124124    }
     
    129129    print F StaticString::GenerateStringAsserts(\%parameters);
    130130
    131     while ( my ($name, $identifier) = each %parameters ) {
     131    for my $name (sort keys %parameters) {
    132132        # FIXME: Would like to use static_cast here, but there are differences in const
    133133        # depending on whether SKIP_STATIC_CONSTRUCTORS_ON_GCC is used, so stick with a
Note: See TracChangeset for help on using the changeset viewer.