diff options
| author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
|---|---|---|
| committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
| commit | 41386e9cb918eed93b3f13648cbef387e371e451 (patch) | |
| tree | a97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/create_hash_table | |
| parent | e15dd966d523731101f70ccf768bba12435a0208 (diff) | |
| download | WebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz | |
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/create_hash_table')
| -rwxr-xr-x | Source/JavaScriptCore/create_hash_table | 52 |
1 files changed, 8 insertions, 44 deletions
diff --git a/Source/JavaScriptCore/create_hash_table b/Source/JavaScriptCore/create_hash_table index 6fa78cea2..397976b06 100755 --- a/Source/JavaScriptCore/create_hash_table +++ b/Source/JavaScriptCore/create_hash_table @@ -41,8 +41,6 @@ my @keys = (); my @attrs = (); my @values = (); my @hashes = (); -my @table = (); -my @links = (); my $hasSetter = "false"; @@ -78,8 +76,6 @@ while (<IN>) { @attrs = (); @values = (); @hashes = (); - @table = (); - @links = (); $inside = 0; } elsif (/^(\S+)\s*(\S+)\s*([\w\|]*)\s*(\w*)\s*$/ && $inside) { @@ -94,11 +90,6 @@ while (<IN>) { if ($att =~ m/Function/) { push(@values, { "type" => "Function", "function" => $val, "params" => (length($param) ? $param : "") }); #printf STDERR "WARNING: Number of arguments missing for $key/$val\n" if (length($param) == 0); - } elsif ($att =~ m/Accessor/) { - my $get = $val; - my $put = "nullptr"; - $hasSetter = "true"; - push(@values, { "type" => "Accessor", "get" => $get, "put" => $put }); } elsif (length($att)) { my $get = $val; my $put = "0"; @@ -164,6 +155,8 @@ sub leftShift($$) { sub calcCompactHashSize() { + my @table = (); + my @links = (); my $compactHashSize = ceilingToPowerOf2(2 * @keys); $compactHashSizeMask = $compactHashSize - 1; $compactSize = $compactHashSize; @@ -254,31 +247,16 @@ sub output() { my $nameEntries = "${name}Values"; $nameEntries =~ s/:/_/g; - my $nameIndex = "${name}Index"; - $nameIndex =~ s/:/_/g; - print "\n#include \"JSCBuiltins.h\"\n"; print "\n#include \"Lookup.h\"\n" if ($includelookup); - if ($useNameSpace) { print "\nnamespace ${useNameSpace} {\n"; print "\nusing namespace JSC;\n"; } else { print "\nnamespace JSC {\n"; } - - print "\nstatic const struct CompactHashIndex ${nameIndex}\[$compactSize\] = {\n"; - for (my $i = 0; $i < $compactSize; $i++) { - my $T = -1; - if (defined($table[$i])) { $T = $table[$i]; } - my $L = -1; - if (defined($links[$i])) { $L = $links[$i]; } - print " { $T, $L },\n"; - } - print "};\n\n"; - - my $packedSize = scalar @keys; - print "\nstatic const struct HashTableValue ${nameEntries}\[$packedSize\] = {\n"; + my $count = scalar @keys + 1; + print "\nstatic const struct HashTableValue ${nameEntries}\[$count\] = {\n"; my $i = 0; foreach my $key (@keys) { my $firstValue = ""; @@ -290,11 +268,6 @@ sub output() { $firstCastStr = "static_cast<NativeFunction>"; $firstValue = $values[$i]{"function"}; $secondValue = $values[$i]{"params"}; - } elsif ($values[$i]{"type"} eq "Accessor") { - $firstCastStr = "static_cast<NativeFunction>"; - $secondCastStr = "static_cast<NativeFunction>"; - $firstValue = $values[$i]{"get"}; - $secondValue = $values[$i]{"put"}; } elsif ($values[$i]{"type"} eq "Property") { $firstCastStr = "static_cast<PropertySlot::GetValueFunc>"; $secondCastStr = "static_cast<PutPropertySlot::PutValueFunc>"; @@ -316,21 +289,12 @@ sub output() { $intrinsic = "RegExpTestIntrinsic" if ($key eq "test"); } - if ($values[$i]{"type"} eq "Function") { - my $tableHead = $name; - $tableHead =~ s/Table$//; - print " #if JSC_BUILTIN_EXISTS(" . uc($tableHead . $key) .")\n"; - print " { \"$key\", (($attrs[$i]) & ~Function) | Builtin, $intrinsic, { (intptr_t)static_cast<BuiltinGenerator>(" . $tableHead . ucfirst($key) . "CodeGenerator), (intptr_t)$secondValue } },\n"; - print " #else\n" - } - print " { \"$key\", $attrs[$i], $intrinsic, { (intptr_t)" . $firstCastStr . "($firstValue), (intptr_t)" . $secondCastStr . "($secondValue) } },\n"; - if ($values[$i]{"type"} eq "Function") { - print " #endif\n" - } + print " { \"$key\", $attrs[$i], $intrinsic, (intptr_t)" . $firstCastStr . "($firstValue), (intptr_t)" . $secondCastStr . "($secondValue) },\n"; $i++; } + print " { 0, 0, NoIntrinsic, 0, 0 }\n"; print "};\n\n"; - print "static const struct HashTable $name =\n"; - print " \{ $packedSize, $compactHashSizeMask, $hasSetter, $nameEntries, $nameIndex \};\n"; + print "extern const struct HashTable $name =\n"; + print " \{ $compactSize, $compactHashSizeMask, $hasSetter, $nameEntries, 0 \};\n"; print "} // namespace\n"; } |
