|
|
This CL implements tagging of functions and methods with function types.
For every class, we now generate a setSignature call which attaches properties to the constructor recording the method signatures, the static function signatures, and the names of all of the static methods. This call also attaches a getter to every static method which returns the type of the function. Methods are only decorated with runtime types when torn off. At a tear-off, the type is looked up in the constructor, and then attached to the bound function.
Top level functions and statement level functions get annotated with their type immediately after their declaration. We could consider moving all of the top level function annotations to the end of the file, but for now I've left it inline.
Closures (function expressions) get wrapped in calls to a dart.fn helper, with type information attached in one of various forms. This is currently the least attractive part of this CL. We may want to iterate on the syntax for this.
I've added some support for NSM checking to the dsend/dcall case as well.
We may wish to iterate on the syntax, and on the runtime representation of types, but this should move us forward from a functionality standpoint.
BUG=
R=jmesserly@google.com, vsm@google.com
Committed: https://github.com/dart-lang/dev_compiler/commit/636b3401b62022f7ef563c720baaf1e200c6f8f1
Total comments: 46
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+4744 lines, -914 lines) |
Patch |
 |
M |
lib/runtime/dart/_foreign_helper.js
|
View
|
1
2
|
2 chunks |
+31 lines, -29 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_interceptors.js
|
View
|
1
2
|
15 chunks |
+152 lines, -17 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_internal.js
|
View
|
1
2
|
36 chunks |
+270 lines, -2 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_isolate_helper.js
|
View
|
1
2
|
27 chunks |
+184 lines, -35 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_js_helper.js
|
View
|
1
2
|
111 chunks |
+505 lines, -220 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_js_names.js
|
View
|
1
|
4 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_js_primitives.js
|
View
|
1
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_native_typed_data.js
|
View
|
1
2
|
23 chunks |
+293 lines, -3 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/async.js
|
View
|
1
2
|
171 chunks |
+824 lines, -353 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/collection.js
|
View
|
1
2
|
81 chunks |
+649 lines, -29 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/convert.js
|
View
|
1
2
|
76 chunks |
+418 lines, -22 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/core.js
|
View
|
1
2
|
68 chunks |
+382 lines, -39 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/isolate.js
|
View
|
1
2
|
11 chunks |
+41 lines, -10 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/math.js
|
View
|
1
2
|
11 chunks |
+63 lines, -14 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/typed_data.js
|
View
|
1
|
20 chunks |
+21 lines, -0 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart_runtime.js
|
View
|
1
2
3
4
5
6
7
8
|
12 chunks |
+214 lines, -28 lines |
0 comments
|
Download
|
 |
M |
lib/src/codegen/js_codegen.dart
|
View
|
1
2
3
4
5
6
7
8
|
11 chunks |
+129 lines, -38 lines |
0 comments
|
Download
|
 |
M |
lib/src/codegen/reify_coercions.dart
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
lib/src/js/nodes.dart
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+10 lines, -1 line |
0 comments
|
Download
|
 |
M |
lib/src/js/printer.dart
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+7 lines, -4 lines |
0 comments
|
Download
|
 |
M |
test/browser/runtime_tests.js
|
View
|
1
2
3
4
5
6
7
8
9
|
3 chunks |
+271 lines, -9 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/8invalid-chars.in+file_name.js
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/BenchmarkBase.js
|
View
|
1
2
|
3 chunks |
+25 lines, -4 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/DeltaBlue.js
|
View
|
1
2
|
15 chunks |
+98 lines, -4 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/cascade.js
|
View
|
1
2
|
7 chunks |
+17 lines, -12 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/constructors.js
|
View
|
1
2
|
6 chunks |
+27 lines, -0 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/covariance.js
|
View
|
1
2
|
2 chunks |
+10 lines, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/dir/html_input_a.js
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/dir/html_input_d.js
|
View
|
1
|
1 chunk |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/fieldtest.js
|
View
|
1
2
|
6 chunks |
+12 lines, -5 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/map_keys.js
|
View
|
1
|
2 chunks |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/methods.js
|
View
|
1
2
|
1 chunk |
+19 lines, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/methods.txt
|
View
|
1
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/misc.js
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/names.js
|
View
|
1
2
|
4 chunks |
+10 lines, -2 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/opassign.js
|
View
|
1
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/sunflower/dom.js
|
View
|
1
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/sunflower/sunflower.js
|
View
|
1
2
|
6 chunks |
+9 lines, -4 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/temps.js
|
View
|
1
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/try_catch.js
|
View
|
1
|
7 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
M |
test/codegen/methods.dart
|
View
|
1
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
Total messages: 14 (1 generated)
|