The added tests exhibit forwarding stubs injected into mixin
application classes. These are currently not handled fully or
consistently throughout the CFE and can lead to crashes and errors.
Change-Id: Ib6a14c6adc48daa35f4a3a8e5b705ec3cf7f606d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168652
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Even when non-nullable is enabled by default, enabling the experiment
explicitly should result in the experiment release version (and not
the experiment enabled version) to be used for opting in.
For this change, the semantics of parseExperimentalFlags was change
to _not_ normalize the flags to a full mapping including default values.
For this reason all uses of such maps are renamed to
'explicitExperimentalFlags'.
Closes#43879
Change-Id: I0d0262e68ec1403549abcfd305ae3a4404fe93e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168654
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Previously, if editing messages.yaml and making a mistake one could
end up with empty "codes_generated.dart" and
"fasta_codes_cfe_generated.dart" meaning that nothing could compile
before doing a `git checkout <file>` on it.
Now instead generate-messages will just not do that.
Change-Id: I072d805772201af218609e7e45e5a6a2316de593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168648
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The added messages handle the situation in which null safety is enabled
by default but is turned off either by language version or by explicitly
passing --enable-experiment=no-non-nullable
Change-Id: Iec43daf19a80f555e838635c83542fdb243b8ed4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168647
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This reverts commit 87d3e03bf8.
Reason for revert: Breaks internal builds (http://b/171258924)
Revert "[cfe] Use CombinedMemberSignature to create noSuchMethod forwarders"
This reverts commit 13b7a83d57.
Reason for revert: Depends on a commit that breaks internal builds
(http://b/171258924)
Revert "[cfe] Use CombinedMemberSignature for creating simple legacy member signatures"
This reverts commit 170f05f91b.
Reason for revert: Depends on a commit that breaks internal builds
(http://b/171258924)
Revert "[cfe] Use origin location for member signatures"
This reverts commit 354dcf4386.
Reason for revert: Depends on a commit that breaks internal builds
(http://b/171258924)
Change-Id: I51f524949f259351336a77f43847bf1d0d11f104
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168487
Reviewed-by: David Morgan <davidmorgan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
Lookup of the setter of an assignable static extension field loaded
from dill failed because the DillExtensionFieldBuilder didn't identify
itself as a field.
Change-Id: I379e0002ec8180b0ac1c5b1440bf9725a87e889e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168480
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
- make sure nested blocks scopes are visited
- make sure variable definitions do not leak beyond block scopes
- properly collect scopes for loops, if statements, constructors
- add calculation of fileEndOffsets for blocks
- save block file offsets to dill
- update binary format version
- change kernel readers and writers to read and write block offsets
- change vm readers to read and block offsets for new version
- add missing fileOffsets and fileEndOffsets on functions for
late fields
- add missing fileOffsets and fileEndOffsets on functions for
extensions
- add errors on failures to find scope
- find libraries for private fields correctly
- add more expression compilation tests
- add test to verify fileOffsets and fileEndOffsets are set for
SDK summary (will add full dill tests later)
Closes: https://github.com/dart-lang/sdk/issues/40278
Related: https://github.com/dart-lang/sdk/issues/34942
Change-Id: I5bc1bb645543045b689d8d61069ee77dc4ee9025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167541
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Changes the kernel representation of structs in two ways.
1. `_addressOf` field of `Struct` gets type `Object` because it will be
either `TypedData` or `Pointer` in structs by value CL.
2. Subtypes of `Struct` get a pragma `vm:ffi:struct-fields` which
contains a const list of the native types of the fields of the struct
which will be read in the VM to do compute the locations of structs
in the target ABI.
Split off from https://dart-review.googlesource.com/c/sdk/+/140290/23
to make that CL smaller. That CL will no longer have changes to the
kernel representation of FFI code after this CL lands separately.
These changes are not consumed in the VM in this CL, but they are tested
by the expect files.
Issue: https://github.com/dart-lang/sdk/issues/36730.
Change-Id: I5d3babd5be07f78c6d2bd80bbc1fd492c51bc01f
Cq-Include-Trybots: luci.dart.try:front-end-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167280
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Flow analysis was failing on our encoding of duplicate late variables.
We add an invalid expression as the initializer on duplicate variables
and flow analysis was seeing this as if the late variable had (declared)
initializer. Changed to use the `hasDeclaredInitializer` flag on
VariableDeclarationImpl to bypass flow analysis in the synthesized
initializer.
Closes#43689
Change-Id: I483caa3bbc3347eb547826e9615a40fe62b586d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167741
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Invalidations below the framework layer could lead to NPEs, since the framework class types will get
recreated. To ensure this doesn't happen, look them up each time.
Instead of checking the component for subtypes, use an isExtended API and the existing mixed in API to
get the same results. This should allow this check to work correctly with the new invalidation strategy.
Bug: https://github.com/dart-lang/sdk/issues/43760
Change-Id: I439c085540403e29083c74b2add642656b3fa0a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167441
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This changes the reported failure from Crash to something more specific
to the encounter error, like ExpectationFileMismatch. Validation errors
for the .yaml file still produce Crash, and so does a couple of the
checks on Component integrity that were also used outside
incremental_load_from_dill_suite.dart
Change-Id: I48aa8cb25198d24e986b0f354db2b370dc9b8ac8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167565
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Fields might be lowered to getter/setter pairs from source to
AST. This CL makes members able to show this for correct computation
of exports and handles scope patch-up when the relation isn't 1-to-1
between source and dill builders.
Change-Id: I5e4a711cd985730d320e582c3bd9d36602030992
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
- use parameter types passed to IncrementalCompiler.compileExpression
for compilation of the synthetic function containing the expression
- updated expression compiler tests
Note: some expressions that previously compiled wouldn't now
Example:
** package:test/library.dart **
class TestLibraryClass {
final int field;
final int _field;
TestLibraryClass(this.field, this._field);
}
** main.dart **
import 'package:test/library.dart';
void main() {
var instance = TestLibraryClass(1, 2);
print('$instance'); // Breakpoint here
}
Expression:
`instance._field`
Previously, the incremental compiler would compile the expression
to kernel due to the type of instance being Dynamic. That compilation
result made it impossible for dartdevc to generate correct code due
to missing type information.
Now, the compilation will fail with "Getter isn't defined"
error. To properly evaluate private fields now, we would need
the CFE to support a special mode for expression compilation
where private fields from other libraries are allowed.
Closes: https://github.com/dart-lang/sdk/issues/43469
Change-Id: Id8015c5e334115a82049fb2d1725db54dd3ea3dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166925
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
This CL stops trying to evaluate unevaluated constants if there's
(still) no environment, something that would happen before, e.g. if
there was something like this:
```
const original = String.fromEnvironment("original");
const copy1 = original;
const copy2 = copy1;
const copy3 = copy2;
const copy4 = copy3;
const copy5 = copy4;
```
Note that unevaluated constants only comes into play when there is
no environment.
Compiling a big internal app with dart2js takes the actual contant
evaluation part down from 8 point something seconds to 3 point
something seconds (-4662.67 ms +/- 537.29 ms, -54.4428% +/- 6.27357%)
and wall clock time (as reported by `/usr/bin/time -v`) down with
~9 seconds on the 8+ minutes run (-9.23 s +/- 6.70067 s,
-1.77065% +/- 1.28543%).
Maximum ram usage (`Maximum resident set size (kbytes)` reported by
`/usr/bin/time -v`) is down 700+ MB (-792367 +/- 364776,
-4.86424% +/- 2.23931%)
Change-Id: I1e1940a9e53de34cff2bcbd8eb938fdb23a22c83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166851
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>