|
Insert covariance checks in strong mode.
"Covariance checks" are checks on certain parameters, necessary due to
the unsafe covariant subtyping rule for interface types.
The new pass generates a checked entry point for each method with
covariance checks. This entry point checks the parameters whose type
cannot be trusted, and then calls the actual method implementation.
Every typed call is then redirected to the checked entry point if the
interface taget declares any parameters with unsafe types, unless the
receiver is 'this'.
Dynamic calls and covariant overrides are not addressed by this CL,
these are still unchecked.
BUG=
R=kmillikin@google.com
Committed: https://github.com/dart-lang/sdk/commit/70a4d169c03516bfa9a0b7824558ed33a9f7910a
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+762 lines, -23 lines) |
Patch |
|
M |
pkg/kernel/lib/class_hierarchy.dart
|
View
|
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/kernel/lib/target/vm.dart
|
View
|
|
2 chunks |
+10 lines, -2 lines |
0 comments
|
Download
|
|
A |
pkg/kernel/lib/transformations/insert_covariance_checks.dart
|
View
|
|
1 chunk |
+516 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/kernel/lib/type_algebra.dart
|
View
|
|
2 chunks |
+27 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/kernel/lib/type_environment.dart
|
View
|
|
1 chunk |
+15 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/kernel/test/baseline_strong_mode_test.dart
|
View
|
|
2 chunks |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/kernel/testcases/closures/capture_closure.dart.expect
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
pkg/kernel/testcases/closures/capture_closure_parameter.dart.expect
|
View
|
1
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
pkg/kernel/testcases/closures/named_closure.dart.expect
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
pkg/kernel/testcases/closures/type_variables.dart.expect
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A |
pkg/kernel/testcases/input/covariant_generic.dart
|
View
|
|
1 chunk |
+45 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/kernel/testcases/spec-mode/covariant_generic.baseline.txt
|
View
|
|
1 chunk |
+38 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/kernel/testcases/strong-mode/DeltaBlue.baseline.txt
|
View
|
|
7 chunks |
+8 lines, -11 lines |
0 comments
|
Download
|
|
A |
pkg/kernel/testcases/strong-mode/covariant_generic.baseline.txt
|
View
|
|
1 chunk |
+44 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/kernel/testcases/strong-mode/optional.baseline.txt
|
View
|
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
pkg/kernel/testcases/strong-mode/void-methods.baseline.txt
|
View
|
|
2 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
|
A |
pkg/kernel/testcases/type-propagation/covariant_generic.baseline.txt
|
View
|
|
1 chunk |
+38 lines, -0 lines |
0 comments
|
Download
|
Total messages: 5 (2 generated)
|