RESOLVED FIXED Bug 103226
[JSC] Add support for overloaded constructors
https://bugs.webkit.org/show_bug.cgi?id=103226
Summary [JSC] Add support for overloaded constructors
Tommy Widenflycht
Reported 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
Attachments
Patch (64.94 KB, patch)
2012-12-17 06:07 PST, Tommy Widenflycht
no flags
Patch (66.46 KB, patch)
2012-12-17 07:27 PST, Tommy Widenflycht
no flags
Patch (28.97 KB, patch)
2012-12-18 07:53 PST, Tommy Widenflycht
no flags
Patch (28.99 KB, patch)
2012-12-19 01:56 PST, Tommy Widenflycht
no flags
Tommy Widenflycht
Comment 1 2012-12-17 06:07:01 PST
Tommy Widenflycht
Comment 2 2012-12-17 07:27:42 PST
Kentaro Hara
Comment 3 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?
Tommy Widenflycht
Comment 4 2012-12-18 07:53:33 PST
Tommy Widenflycht
Comment 5 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.
Tommy Widenflycht
Comment 6 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.
Kentaro Hara
Comment 7 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.
Tommy Widenflycht
Comment 8 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.
Kentaro Hara
Comment 9 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.
Tommy Widenflycht
Comment 10 2012-12-19 01:56:46 PST
WebKit Review Bot
Comment 11 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>
WebKit Review Bot
Comment 12 2012-12-19 02:52:58 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.