Bug 181714 - Generated bindings for derived dictionaries are not regenerated when the base dictionary changes
Summary: Generated bindings for derived dictionaries are not regenerated when the base...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-16 19:42 PST by Andy Estes
Modified: 2020-08-25 09:09 PDT (History)
11 users (show)

See Also:


Attachments
Patch (3.35 KB, patch)
2020-08-24 03:32 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (50.12 KB, patch)
2020-08-24 06:33 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (50.03 KB, patch)
2020-08-25 08:33 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2018-01-16 19:42:18 PST
Consider the following two IDL files:

Base.idl:
    dictionary Base {
        unsigned long baseField;
    }

Derived.idl
    dictionary Derived : Base {
        unsigned long derivedField;
    }

When JSDerived.cpp is generated, its convertDictionary() implementation contains the code to convert both baseField and derivedField. JSBase.cpp's convertDictionary() has its own convertDictionary() to convert baseField, but JSDerived.cpp does not rely on it.

If I add a second field to Base.idl and rebuild, JSBase.cpp is updated to convert the new field, but JSDerived.cpp is not updated, so it still only converts the original two fields.

It seems like JSDerived.cpp's convertDictionary() should be calling JSBase.cpp's convertDictionary() to convert the base class fields. Either that or the bindings generator should be regenerating all dictionaries that inherit from Base.
Comment 1 youenn fablet 2020-08-24 00:20:51 PDT
We hit that issue in https://bugs.webkit.org/show_bug.cgi?id=215722
Comment 2 youenn fablet 2020-08-24 03:32:18 PDT
Created attachment 407094 [details]
Patch
Comment 3 youenn fablet 2020-08-24 06:33:20 PDT
Created attachment 407097 [details]
Patch
Comment 4 Darin Adler 2020-08-24 12:08:00 PDT
Comment on attachment 407097 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407097&action=review

> Source/WebCore/bindings/scripts/preprocess-idls.pl:244
> +    my $makefileDeps = "#Supplemental dependencies\n";

Normally we’d have a space after the "#" in a comment.

> Source/WebCore/bindings/scripts/preprocess-idls.pl:258
> +    $makefileDeps .= "#Dictionaries dependencies\n";

Ditto.

> Source/WebCore/bindings/scripts/preprocess-idls.pl:261
> +        my $dependencies = $dictionaryDependencies{$derivedDictionary};
> +        $makefileDeps .= "JS${derivedDictionary}.cpp: ${dependencies}\n";

Not sure we benefit from the local variable here.
Comment 5 youenn fablet 2020-08-25 08:33:19 PDT
Created attachment 407191 [details]
Patch for landing
Comment 6 EWS 2020-08-25 09:08:25 PDT
Committed r266120: <https://trac.webkit.org/changeset/266120>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407191 [details].
Comment 7 Radar WebKit Bug Importer 2020-08-25 09:09:21 PDT
<rdar://problem/67740737>