Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Issue 14261002: Make generator function data path more clear. (Closed)

Created:
7 years, 8 months ago by kojih
Modified:
7 years, 8 months ago
CC:
blink-reviews, Nate Chapin, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink@master
Visibility:
Public.

Description

Make generator function data path more clear. Currently almost all function pushes generated code to global vars. In this change, generated code is pushed by certain stuff(definition or declaration) instead of line by line. Due to that, now NamedPropertyGetter is generated by 1 function. Though it doesn't reduce the amount of code much, it improve readability and maintenability of the code generator. There remains still several work, for example namespace clearance. R=haraken@chromium.org BUG=229740 TEST=V8TestEventTarget.cpp (generated by run-bindings-tests) Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=148606

Patch Set 1 #

Patch Set 2 : revised #

Patch Set 3 : revised #

Patch Set 4 : revised #

Patch Set 5 : revised #

Patch Set 6 : revised #

Total comments: 18

Patch Set 7 : revised #

Total comments: 8

Patch Set 8 : updated #

Patch Set 9 : rebased to latest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+705 lines, -586 lines) Patch
M Source/bindings/scripts/CodeGeneratorV8.pm View 1 2 3 4 5 6 7 8 126 chunks +681 lines, -563 lines 0 comments Download
M Source/bindings/tests/results/V8TestEventTarget.cpp View 1 2 3 4 5 6 2 chunks +24 lines, -23 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
kojih
r?
7 years, 8 months ago (2013-04-15 08:45:59 UTC) #1
haraken
This looks like an ad-hoc fix that just increases a mess of the code generator. ...
7 years, 8 months ago (2013-04-15 09:36:01 UTC) #2
kojih
I think this is trade-off of generalization between specialization. I concern excessive specialization reduces flexibility ...
7 years, 8 months ago (2013-04-15 10:05:18 UTC) #3
kojih
s/between/and/
7 years, 8 months ago (2013-04-15 10:05:52 UTC) #4
haraken
> @implFunction is not enough in case of generating not function(such as define or > ...
7 years, 8 months ago (2013-04-15 10:25:35 UTC) #5
kojih
r?
7 years, 8 months ago (2013-04-16 02:21:27 UTC) #6
kojih
now GenerateImplementationNamedPropertyGetter have 2 array ref arguments for output generated code. This is because this ...
7 years, 8 months ago (2013-04-16 02:36:52 UTC) #7
kojih
It can return tuple ($codeA, $codeB). it might be one's preference.
7 years, 8 months ago (2013-04-16 03:13:56 UTC) #8
haraken
The patch looks like just a mechanical replacement and doesn't much improve the current mess. ...
7 years, 8 months ago (2013-04-16 04:31:20 UTC) #9
kojih
I don't understand difference between your idea and this implementation. This patch already hold 1 ...
7 years, 8 months ago (2013-04-16 05:00:50 UTC) #10
kojih
r? 1. replace push(@code, XXX to $code .= XXX 2. replace output args -> return ...
7 years, 8 months ago (2013-04-16 08:50:10 UTC) #11
haraken
https://codereview.chromium.org/14261002/diff/17001/Source/bindings/scripts/CodeGeneratorV8.pm File Source/bindings/scripts/CodeGeneratorV8.pm (right): https://codereview.chromium.org/14261002/diff/17001/Source/bindings/scripts/CodeGeneratorV8.pm#newcode37 Source/bindings/scripts/CodeGeneratorV8.pm:37: my @implStuff = (); Shall we rename it to ...
7 years, 8 months ago (2013-04-16 09:40:36 UTC) #12
kojih
updated. r? https://codereview.chromium.org/14261002/diff/17001/Source/bindings/scripts/CodeGeneratorV8.pm File Source/bindings/scripts/CodeGeneratorV8.pm (right): https://codereview.chromium.org/14261002/diff/17001/Source/bindings/scripts/CodeGeneratorV8.pm#newcode900 Source/bindings/scripts/CodeGeneratorV8.pm:900: OK. https://codereview.chromium.org/14261002/diff/17001/Source/bindings/scripts/CodeGeneratorV8.pm#newcode1311 Source/bindings/scripts/CodeGeneratorV8.pm:1311: my $out = ""; ...
7 years, 8 months ago (2013-04-16 11:00:06 UTC) #13
haraken
LGTM. abarth: Do you have any ideas to make the code building step better? https://codereview.chromium.org/14261002/diff/22001/Source/bindings/scripts/CodeGeneratorV8.pm ...
7 years, 8 months ago (2013-04-16 11:13:02 UTC) #14
kojih
got LGTM but updated. https://codereview.chromium.org/14261002/diff/22001/Source/bindings/scripts/CodeGeneratorV8.pm File Source/bindings/scripts/CodeGeneratorV8.pm (right): https://codereview.chromium.org/14261002/diff/22001/Source/bindings/scripts/CodeGeneratorV8.pm#newcode116 Source/bindings/scripts/CodeGeneratorV8.pm:116: my @code = @_; there's ...
7 years, 8 months ago (2013-04-16 11:39:27 UTC) #15
kojih
I confirmed no $out, $func, $stuff, $result in the code.
7 years, 8 months ago (2013-04-16 11:40:56 UTC) #16
haraken
abarth: Would you take a rough look at the patch? I'd like to ask your ...
7 years, 8 months ago (2013-04-17 11:15:45 UTC) #17
abarth-chromium
I'm not sure this CL is much of an improvement on the current code. I ...
7 years, 8 months ago (2013-04-17 21:17:34 UTC) #18
haraken
Thanks abarth. I agree with you. OK, so I'd like to LGTM the patch, since ...
7 years, 8 months ago (2013-04-18 00:54:36 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kojih@chromium.org/14261002/31001
7 years, 8 months ago (2013-04-18 02:02:09 UTC) #20
commit-bot: I haz the power
7 years, 8 months ago (2013-04-18 02:34:11 UTC) #21
Message was sent while issue was closed.
Change committed as 148606

Powered by Google App Engine
This is Rietveld 408576698