diff options
Diffstat (limited to 'JavaScriptCore/create_hash_table')
-rwxr-xr-x | JavaScriptCore/create_hash_table | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/JavaScriptCore/create_hash_table b/JavaScriptCore/create_hash_table index 4184500..6078f97 100755 --- a/JavaScriptCore/create_hash_table +++ b/JavaScriptCore/create_hash_table @@ -247,27 +247,49 @@ sub output() { print "\nnamespace JSC {\n"; } my $count = scalar @keys + 1; + print "#if ENABLE(JIT)\n"; + print "#define THUNK_GENERATOR(generator) , generator\n"; + print "#else\n"; + print "#define THUNK_GENERATOR(generator)\n"; + print "#endif\n"; print "\nstatic const struct HashTableValue ${nameEntries}\[$count\] = {\n"; my $i = 0; foreach my $key (@keys) { my $firstValue = ""; my $secondValue = ""; + my $castStr = ""; if ($values[$i]{"type"} eq "Function") { + $castStr = "static_cast<NativeFunction>"; $firstValue = $values[$i]{"function"}; $secondValue = $values[$i]{"params"}; } elsif ($values[$i]{"type"} eq "Property") { + $castStr = "static_cast<PropertySlot::GetValueFunc>"; $firstValue = $values[$i]{"get"}; $secondValue = $values[$i]{"put"}; } elsif ($values[$i]{"type"} eq "Lexer") { $firstValue = $values[$i]{"value"}; $secondValue = "0"; } - print " { \"$key\", $attrs[$i], (intptr_t)$firstValue, (intptr_t)$secondValue },\n"; + my $thunkGenerator = "0"; + if ($key eq "charCodeAt") { + $thunkGenerator = "charCodeAtThunkGenerator"; + } + if ($key eq "charAt") { + $thunkGenerator = "charAtThunkGenerator"; + } + if ($key eq "sqrt") { + $thunkGenerator = "sqrtThunkGenerator"; + } + if ($key eq "pow") { + $thunkGenerator = "powThunkGenerator"; + } + print " { \"$key\", $attrs[$i], (intptr_t)" . $castStr . "($firstValue), (intptr_t)$secondValue THUNK_GENERATOR($thunkGenerator) },\n"; $i++; } - print " { 0, 0, 0, 0 }\n"; + print " { 0, 0, 0, 0 THUNK_GENERATOR(0) }\n"; print "};\n\n"; + print "#undef THUNK_GENERATOR\n"; print "extern JSC_CONST_HASHTABLE HashTable $name =\n"; print " \{ $compactSize, $compactHashSizeMask, $nameEntries, 0 \};\n"; print "} // namespace\n"; |