Bug 103226 - [JSC] Add support for overloaded constructors
Summary: [JSC] Add support for overloaded constructors
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Tommy Widenflycht
URL:
Keywords:
Depends on: 105271
Blocks: 73064 98416
  Show dependency treegraph
 
Reported: 2012-11-26 01:27 PST by Tommy Widenflycht
Modified: 2012-12-19 02:52 PST (History)
10 users (show)

See Also:


Attachments
Patch (64.94 KB, patch)
2012-12-17 06:07 PST, Tommy Widenflycht
no flags Details | Formatted Diff | Diff
Patch (66.46 KB, patch)
2012-12-17 07:27 PST, Tommy Widenflycht
no flags Details | Formatted Diff | Diff
Patch (28.97 KB, patch)
2012-12-18 07:53 PST, Tommy Widenflycht
no flags Details | Formatted Diff | Diff
Patch (28.99 KB, patch)
2012-12-19 01:56 PST, Tommy Widenflycht
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommy Widenflycht 2012-11-26 01:27:25 PST
Bring the same functionality to JSC as V8.; see https://bugs.webkit.org/show_bug.cgi?id=100801
Comment 1 Tommy Widenflycht 2012-12-17 06:07:01 PST
Created attachment 179727 [details]
Patch
Comment 2 Tommy Widenflycht 2012-12-17 07:27:42 PST
Created attachment 179738 [details]
Patch
Comment 3 Kentaro Hara 2012-12-17 18:15:35 PST
Comment on attachment 179738 [details]
Patch

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

The overall approach looks good. But it looks like this patch is doing a lot of things at a breath. We might want to land the patch incrementally.

> Source/WebCore/ChangeLog:8
> +        Adding patch adds the same support for overloaded constructors to JSC as V8.

Typo: Adding patch => This patch

> Source/WebCore/ChangeLog:9
> +        As proof of implementation soundness WebSockets costom constrictor is removed.

Typo: constrictor => constructor

> Source/WebCore/ChangeLog:12
> +        The changes to bindings/scripts/CodeGeneratorJS.pm is quite extensive since
> +        I split up the enormous "doEverything()" function into a few smaller; this also meant
> +        that some generated code has been shuffled around.

Would you land these refactoring patches first? It's a bit difficult to verify that this patch is correct.

> LayoutTests/http/tests/websocket/tests/hybi/url-parsing-expected.txt:1
> -CONSOLE MESSAGE: Invalid url for WebSocket null
> +CONSOLE MESSAGE: Wrong url scheme for WebSocket http://127.0.0.1:8000/websocket/tests/hybi/null

Are we changing the current behavior?
Comment 4 Tommy Widenflycht 2012-12-18 07:53:33 PST
Created attachment 179940 [details]
Patch
Comment 5 Tommy Widenflycht 2012-12-18 07:57:55 PST
Comment on attachment 179738 [details]
Patch

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

>> Source/WebCore/ChangeLog:8
>> +        Adding patch adds the same support for overloaded constructors to JSC as V8.
> 
> Typo: Adding patch => This patch

Fixed.

>> Source/WebCore/ChangeLog:9
>> +        As proof of implementation soundness WebSockets costom constrictor is removed.
> 
> Typo: constrictor => constructor

Fixed.

>> Source/WebCore/ChangeLog:12
>> +        that some generated code has been shuffled around.
> 
> Would you land these refactoring patches first? It's a bit difficult to verify that this patch is correct.

Fixed.

>> LayoutTests/http/tests/websocket/tests/hybi/url-parsing-expected.txt:1
>> +CONSOLE MESSAGE: Wrong url scheme for WebSocket http://127.0.0.1:8000/websocket/tests/hybi/null
> 
> Are we changing the current behavior?

No, just unifying the output between JSC and V8.
Comment 6 Tommy Widenflycht 2012-12-18 07:58:52 PST
There's a bit more cleanup that could be done but I'll leave that to a follow-up patch to keep this one reasonable in size.
Comment 7 Kentaro Hara 2012-12-18 16:51:52 PST
Comment on attachment 179940 [details]
Patch

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

This is a great improvement.

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3774
> +            next if exists $fetchedArguments{$parameterIndex};

Why can the same parameterIndex appear twice in @neededArguments ?

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3980
> +            $numberOfConstructorParameters = 1024;

Nit: Let's use 255 as we're using 255 in other places.
Comment 8 Tommy Widenflycht 2012-12-19 01:48:34 PST
Comment on attachment 179940 [details]
Patch

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

>> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3774
>> +            next if exists $fetchedArguments{$parameterIndex};
> 
> Why can the same parameterIndex appear twice in @neededArguments ?

Honestly I have no idea... This is copied from the function overload generation and I kept it as is.

>> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3980
>> +            $numberOfConstructorParameters = 1024;
> 
> Nit: Let's use 255 as we're using 255 in other places.

Will fix.
Comment 9 Kentaro Hara 2012-12-19 01:49:48 PST
(In reply to comment #8)
> > Why can the same parameterIndex appear twice in @neededArguments ?
> 
> Honestly I have no idea... This is copied from the function overload generation and I kept it as is.

OK, then let' fix it in a follow-up patch if needed.
Comment 10 Tommy Widenflycht 2012-12-19 01:56:46 PST
Created attachment 180120 [details]
Patch
Comment 11 WebKit Review Bot 2012-12-19 02:52:52 PST
Comment on attachment 180120 [details]
Patch

Clearing flags on attachment: 180120

Committed r138138: <http://trac.webkit.org/changeset/138138>
Comment 12 WebKit Review Bot 2012-12-19 02:52:58 PST
All reviewed patches have been landed.  Closing bug.