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>
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>
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>
This change compiles opt-out libraries with opt-out semantics even when
sound null safety was requested. The compile-time error that libraries
cannot opt out with sound null safety is still produces but spurious errors
from interpreting opt-out as opt-in are avoided.
This also aligns the compilation of from-source with from-dill for the
case of opt-out libraries in face of sound null safety.
Closes#43327
Change-Id: I19d659219b7c7b357d15fc5f1ca4415fe1fc4592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166243
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This is no longer necessary with the VM only supporting the latest
version and kernel (optionally) including a git-checksum to match up
VM and dills.
Change-Id: Ifccfd0d12333cd99258100cda30e1536cc230bc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166024
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
DirectPropertyGet is a statically bound instance access used in the
VM mixin tranformation to encode fully resolved super access. The
access to `this.name` generated in `toString` of an enum is _not_
a statically bound instance access but just a regular instance access
whose runtime target happens to be known statically because the code
is generated. In JavaScript backend a statically bound instance access
requires a unique getter to avoid the dynamic lookup, and therefore,
though using DirectPropertyGet is an optimization
to the VM, it would be a regression to the JavaScript backends if
they didn't handle DirectPropertyGet as a PropertyGet.
This CL removes the misuse and thus enables JavaScript backends to
handle DirectPropertyGet with the intended semantics.
Change-Id: Ie41aefbf19e8c63244f10a1afda1ddbfdf7d3c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164085
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>