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

Issue 1195523002: Handle dynamic as bottom inside of function type reps (Closed)

Created:
5 years, 6 months ago by Leaf
Modified:
5 years, 6 months ago
Reviewers:
vsm, Jennifer Messerly
CC:
dev-compiler+reviews_dartlang.org
Base URL:
git@github.com:dart-lang/dev_compiler.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Handle dynamic as bottom inside of function type reps. This changes the way we handle dynamic at runtime to be more correct and cleaner. We now simply emit dynamic as dynamic instead of as core.Object. There are now two ways to construct a function type: one can construct a fuzzy function type (the default), or a definite function type. The constructor for a fuzzy function type replaces all uses of dynamic with bottom. This function type is used for all type annotations. Definite function types do not replace dynamic with bottom. These only occur as the runtime type of actual functions, for which we really know the type. Because we now eagerly sort this out when we create the function type, the subtyping code doesn't need to deal with this. This allows some additional subtyping: closures which actually are typed to take dynamic would previously not have been allowed to be cast to something with a concrete argument type. Now this is allowed (see the change in runtime_tests.js for an example of this). This fixes #107. BUG= R=vsm@google.com Committed: https://github.com/dart-lang/dev_compiler/commit/ed8722d9b1b9850395b658acf55fa5f3a0195c0c

Patch Set 1 #

Total comments: 6

Patch Set 2 : Bug fix #

Total comments: 4

Patch Set 3 : Fix typo in comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+859 lines, -765 lines) Patch
M lib/runtime/_classes.js View 4 chunks +3 lines, -7 lines 0 comments Download
M lib/runtime/_rtti.js View 1 4 chunks +41 lines, -10 lines 0 comments Download
M lib/runtime/_types.js View 1 2 10 chunks +104 lines, -25 lines 0 comments Download
M lib/runtime/dart/_foreign_helper.js View 3 chunks +8 lines, -8 lines 0 comments Download
M lib/runtime/dart/_interceptors.js View 5 chunks +9 lines, -9 lines 0 comments Download
M lib/runtime/dart/_internal.js View 18 chunks +61 lines, -61 lines 0 comments Download
M lib/runtime/dart/_isolate_helper.js View 18 chunks +71 lines, -71 lines 0 comments Download
M lib/runtime/dart/_js_helper.js View 15 chunks +44 lines, -44 lines 0 comments Download
M lib/runtime/dart/_js_mirrors.js View 8 chunks +12 lines, -12 lines 0 comments Download
M lib/runtime/dart/_native_typed_data.js View 14 chunks +34 lines, -34 lines 0 comments Download
M lib/runtime/dart/async.js View 97 chunks +195 lines, -195 lines 0 comments Download
M lib/runtime/dart/collection.js View 51 chunks +106 lines, -106 lines 0 comments Download
M lib/runtime/dart/convert.js View 26 chunks +54 lines, -54 lines 0 comments Download
M lib/runtime/dart/core.js View 18 chunks +27 lines, -27 lines 0 comments Download
M lib/runtime/dart/isolate.js View 6 chunks +7 lines, -7 lines 0 comments Download
M lib/runtime/dart/js.js View 11 chunks +34 lines, -34 lines 0 comments Download
M lib/runtime/dart/math.js View 1 chunk +2 lines, -2 lines 0 comments Download
M lib/runtime/dart/mirrors.js View 4 chunks +7 lines, -7 lines 0 comments Download
M lib/runtime/dart_runtime.js View 1 chunk +1 line, -0 lines 0 comments Download
M lib/src/codegen/js_codegen.dart View 6 chunks +16 lines, -28 lines 0 comments Download
M test/browser/runtime_tests.js View 1 chunk +4 lines, -5 lines 0 comments Download
M test/codegen/expect/BenchmarkBase.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/codegen/expect/DeltaBlue.js View 1 chunk +1 line, -1 line 0 comments Download
M test/codegen/expect/cascade.js View 1 chunk +1 line, -1 line 0 comments Download
M test/codegen/expect/constructors.js View 2 chunks +2 lines, -2 lines 0 comments Download
M test/codegen/expect/covariance.js View 2 chunks +3 lines, -3 lines 0 comments Download
M test/codegen/expect/fieldtest.js View 2 chunks +3 lines, -3 lines 0 comments Download
M test/codegen/expect/functions.js View 2 chunks +2 lines, -2 lines 0 comments Download
M test/codegen/expect/methods.js View 1 chunk +1 line, -1 line 0 comments Download
M test/codegen/expect/misc.js View 1 chunk +1 line, -1 line 0 comments Download
M test/codegen/expect/names.js View 2 chunks +2 lines, -2 lines 0 comments Download
M test/codegen/expect/sunflower/sunflower.js View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (1 generated)
Leaf
5 years, 6 months ago (2015-06-17 21:56:23 UTC) #2
vsm
https://codereview.chromium.org/1195523002/diff/1/lib/runtime/_rtti.js File lib/runtime/_rtti.js (right): https://codereview.chromium.org/1195523002/diff/1/lib/runtime/_rtti.js#newcode118 lib/runtime/_rtti.js:118: function getFunctionType(obj) { Do we still use this method? ...
5 years, 6 months ago (2015-06-17 22:43:13 UTC) #3
Leaf
https://codereview.chromium.org/1195523002/diff/1/lib/runtime/_rtti.js File lib/runtime/_rtti.js (right): https://codereview.chromium.org/1195523002/diff/1/lib/runtime/_rtti.js#newcode118 lib/runtime/_rtti.js:118: function getFunctionType(obj) { On 2015/06/17 22:43:13, vsm wrote: > ...
5 years, 6 months ago (2015-06-17 22:53:08 UTC) #4
vsm
https://codereview.chromium.org/1195523002/diff/20001/lib/runtime/_classes.js File lib/runtime/_classes.js (right): https://codereview.chromium.org/1195523002/diff/20001/lib/runtime/_classes.js#newcode174 lib/runtime/_classes.js:174: return types.definiteFunctionType.apply(null, parts); Should these really be definite for ...
5 years, 6 months ago (2015-06-17 23:14:38 UTC) #5
vsm
lgtm after chatting with leaf offline
5 years, 6 months ago (2015-06-17 23:42:33 UTC) #6
Leaf
https://codereview.chromium.org/1195523002/diff/20001/lib/runtime/_classes.js File lib/runtime/_classes.js (right): https://codereview.chromium.org/1195523002/diff/20001/lib/runtime/_classes.js#newcode174 lib/runtime/_classes.js:174: return types.definiteFunctionType.apply(null, parts); On 2015/06/17 23:14:38, vsm wrote: > ...
5 years, 6 months ago (2015-06-17 23:44:37 UTC) #7
Leaf
5 years, 6 months ago (2015-06-17 23:46:43 UTC) #8
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
ed8722d9b1b9850395b658acf55fa5f3a0195c0c (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698