Commit Graph

345 Commits

Author SHA1 Message Date
Jens Johansen 460df98213 [kernel] Use const lists for empty lists when not using growable lists anyway
When running dart2js in its "linker scenario" on a large internal app
this saves something along the lines of 140MB of memory.

Change-Id: I348f5c46ec430c5a486591897557bfef95d3b435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185827
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-02-22 10:36:38 +00:00
Johnni Winther 3892e95547 [cfe] Encode field references as @getters and @setters
This removes the @fields and @=fields canonical name
encodings that allowed for encoding of conflicting members
and didn't support field<->getter/setter conversion
between dills or between outline and full dill.

TEST=existing tests

Change-Id: Id15e58ad4d1847d2c98a688705e5945196146c6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184783
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-22 09:46:18 +00:00
Jens Johansen 433d59b917 [kernel] Add option to dill loader for not using growable lists; use in dart2js
Most lists created when loading a dill file are growable.
That's not always needed, though, and a non-growable list is more compact than
a growable one.

When running dart2js in its "linker scenario" on a large internal app
this saves something along the lines of 90MB of memory.

Change-Id: I113a73ed150efb56a5172ac7e1daf1d28f4bc188
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185825
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-02-22 09:31:08 +00:00
Johnni Winther cea1e14c68 [kernel] Make various AST fields non-nullable
Make Extension.name non-nullable
Make Class.name non-nullable
Make Extension.onType late non-nullable
Make LabeledStatement.body late non-nullable
Make SwitchCase.body late non-nullable

Change-Id: Iccf21fc800faa620c5d4b7bea68f74eec8bf62e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185083
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-18 17:52:27 +00:00
Johnni Winther 07ddd00e1b [cfe] Remove unneeded hide combinators
The front end previously enforced a stricter-than-spec requirement on
conflicting imports on its own code. The check was included of the
kernel snapshot and therefore always enforced, even in published sdks.

The extra check was removed a month ago and now tools/sdks/ have been
updated to use a later version of the sdk, so the unneeded hide
combinators can now be removed from the source code.

Closes #44667

TEST=existing

Change-Id: I1d1053b1ef9a40b6a918eef515a02d7b404906c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185084
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-18 14:23:10 +00:00
Johnni Winther ee0c0bcd57 Reland "[kernel] Ensure that visitors don't implicitly returns null"
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.

TEST=Refactoring

Change-Id: Ie8fa5d41b99850d9e4abb59634c72920c64128d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183691
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-10 07:51:52 +00:00
Johnni Winther 9bd9b3ccd6 [kernel] Use List.generate instead of List.filled in ast_from_binary.dart
In preparation for null safety migration, List.filled is replaced
with List.generate in ast_from_binary.dart where the element can be
created by a simple function expression.

Change-Id: I17bc68edebb8dc7d8918d87e9cdc38a9a8711682
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179761
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-09 13:58:03 +00:00
Johnni Winther b60e0aa5a1 Revert "[kernel] Ensure that visitors don't implicitly returns null"
This reverts commit ce81216885.

Reason for revert: Flutter dependency

Original change's description:
> [kernel] Ensure that visitors don't implicitly returns `null`
>
> This is in preparation to migrate package:kernel to null safety.
> For the visitor interfaces to support non-nullable return types, the
> implementations must avoid using `null` as return value in its base case.
>
> TEST=Refactoring
>
> Change-Id: Ie5e4153f8d3779d94957bb13b3d2d2a942040ff2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179760
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>

TBR=jensj@google.com,johnniwinther@google.com

Change-Id: I61b838d3371e6b1de2427716d056324c120be499
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183689
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-09 12:41:12 +00:00
Johnni Winther ce81216885 [kernel] Ensure that visitors don't implicitly returns null
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.

TEST=Refactoring

Change-Id: Ie5e4153f8d3779d94957bb13b3d2d2a942040ff2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179760
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-09 09:46:46 +00:00
Dmitry Stefantsov 63737581f8 [cfe] Encourage the use of the const NeverType objects
TEST=Covered by existing test base.
Change-Id: Ie858bd5a765d71fa4095eab3373a6ecdb063b260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183006
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-08 10:36:40 +00:00
Johnni Winther 6ce8d74761 [cfe] Add Function.futureValueType and serialize Let.fileOffset
Serializing Let.fileOffset supports positions in stacktraces resulting
from null aware expressions, like `if (o?.foo) ...` when `o` is `null`.

Adding Function.futureValueType supports the proper backend
implementation for the fix in
https://dart-review.googlesource.com/c/sdk/+/181303

Closes #44654

TEST=existing

Change-Id: Ie5939a248d3d8bf41388e8f435e4ba4195afeabd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182269
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-04 14:06:47 +00:00
Johnni Winther 2761782d60 [kernel] Move switch cases to helpers in ast_from_binary
Change-Id: If3e2854cd6f7118179766e179348fb02227f9798
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181384
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-27 18:56:59 +00:00
Johnni Winther 34fb48bb8a [kernel,front_end] Migrate first wave of pkg/kernel and pkg/front_end
Migrates libraries dependent only on already migrated libraries.

Change-Id: I0e85ee8dbc2afce031b92e0009e71c206a55af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179502
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-01-18 15:40:21 +00:00
Jens Johansen 4ea0bae02a [kernel] Tools and fixes wrt lazy loading and reachability
Change-Id: I191d338097b09ff2211d6d14c6013632190de629
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178980
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-13 14:20:28 +00:00
Johnni Winther b4d4316de0 [cfe] Rename stub kinds
ForwardingStub -> AbstractForwardingStub
ForwardingSuperStub -> ConcreteForwardingStub
MixinStub -> AbstractMixinStub
MixinSuperStub -> ConcreteMixinStub

TEST=refactoring

Change-Id: Ice76a41ce8e1071f553ed8fd3ecbb29c97377161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177129
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-29 16:54:55 +00:00
Johnni Winther 60702d4158 [cfe] Make field assignability immutable
Changes fields to be either mutable or immutable by construction.
This ensure that we don't create setter references for fields that
cannot be assigned to and is a prerequisite for replacing @fields/
@fields= canonical names with @getters/@setters.

TEST=existing expectation tests and verification

Change-Id: I70b9a504ee6f221b7c334ac02620feb0d5f7ae01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176665
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-28 16:11:14 +00:00
Johnni Winther 52db62dd65 [cfe] Use MixinSuperStub
This CL adds stub for each concrete mixed in member into mixin
applications. The body of the stub calls the original member via
a super call.

This addition means that resolution of super access now use the
stub and not the original declaration as the target, which means
that it will be correct even when mixed in members are cloned. For
this reason, dart2js no longer needs to perform its own super
member resolution.

When a super call targets a mixin super stub (after cloning) it
can be optimized away by redirecting the call to the `stubTarget`
of the call. This optimization is performed in dart2js.

Since dart2js now uses the correct super target, its runtime
mixin application needs to avoid overriding members already
declared in the mixin application. These members are the
forwarding super stubs which ensure that correct runtime types
when members with covariant parameters are implemented.


Change-Id: Iab71ffcc400aa6a683987bc20b9553a263ebc8e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176526
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-25 23:32:17 +00:00
Sigmund Cherem f376642572 [cfe]: include path to .dill file on version mismatch error messages
Change-Id: I8862abd55c111de2c81c5000539fb69268dcac06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176921
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-12-23 16:31:51 +00:00
Johnni Winther 5dbb6e245b [kernel,cfe,ddc] Add new method invocation node to package:kernel
This adds
* InstanceInvocation, DynamicInvocation, FunctionInvocation, and
   LocalFunctionInvocation, EqualsCall, and EqualsNull as a future
   replacement for MethodInvocation.
* InstanceGet, DynamicGet, InstanceTearOff, and FunctionTearOff as a
   future replacement for PropertyGet
* InstanceSet and DynamicSet as a future replacement of PropertySet
* StaticTearOff as an addition to StaticGet

TEST=pkg/front_end/test/binary_md_vm_tags_and_version_test.dart

This CL combines
* https://dart-review.googlesource.com/c/sdk/+/171729
* https://dart-review.googlesource.com/c/sdk/+/172649
* https://dart-review.googlesource.com/c/sdk/+/172650
* https://dart-review.googlesource.com/c/sdk/+/172651

using the initial encoding fo EqualsCall and EqualsNull

Change-Id: I98e020b5f2b405a812663bdcd2c05aba8efa74c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175480
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-14 10:55:48 +00:00
Jens Johansen 739393b290 [kernel] Fix and test readComponentSource
This was broken after constant coverage was recorded in dill because
reading the source then needed to have the link table too (which it
doesn't have when using readComponentSource).

Fixes https://github.com/flutter/flutter/issues/71851.

Change-Id: I90b6a185abd133c7d08fd335f69faf634684738b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175724
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-11 11:57:58 +00:00
Johnni Winther 3d19493f2d [cfe] Add flag to identify lowered locals
+ add predicate helpers to identify these and extract their
original names.

TEST=pkg/front_end/test/predicates/predicate_test.dart

Change-Id: I4d94c575d010b6b01c985eaf5392b9e0e979d044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175250
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-12-08 14:53:14 +00:00
Lasse R.H. Nielsen 6e29700e16 Update List constructor documentation, deprecate constructor.
Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 16:20:28 +00:00
Johnni Winther d51ab9b62a [cfe] Add ProcedureStubKind
The enum `ProcedureStubKind` together with the flag `isSynthetic`
replaces the flags `isForwardingStub`, `isForwardingSemiStub`,
`isNoSuchMethodForwarder` and `isMemberSignature`.

The semantics of the existing properties on `Procedure` is unchanged.

The new MixinStub and MixinSuperStub stub kinds are not used yet and
the stub target for NoSuchMethodForwarder is not set yet.

TEST=refactoring


Change-Id: I6e81970dbb4baf0229f43c2a0bf0d5e575e65043
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174462
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-02 16:35:58 +00:00
Jens Johansen 27ed7912af [kernel] Constant coverage recorded in dill
This adds the recorded constant coverage to the dill file.

runtimes for constant evaluation:
dart2js: No difference proven at 95.0% confidence
flutter gallery: No difference proven at 95.0% confidence
big internal app: No difference proven at 95.0% confidence

sdk sizes:
vm: ~0.0182%
dart2js: ~0.0137%
flutter: ~0.0197%

compile sizes:
dart2js: ~0.0179%
flutter gallery: ~0.0162%
big internal app: ~0.0414%

TEST=test was fixed.

Change-Id: I347751e4d96d4d62140d26ebe37960f46a0dfbfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171948
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-01 12:30:14 +00:00
Johnni Winther 79f36c9d49 [kernel] Rename readUInt to readUInt30 to match corresponding write-method.
TEST=Refactoring

Change-Id: I455c498065785909fb175a0b5fa82bd9d5b38f1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173524
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-11-24 08:50:38 +00:00
Johnni Winther 887ab360e5 Revert "[kernel] Ensure that visitors don't implicitly returns null"
This reverts commit 4a3f121341.

The changes broke flutter/engine

TEST=It's a revert!

Change-Id: I1e65e6cfab03795a21a64a96fe3ed72e6ba8ecd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172760
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-11-18 14:51:30 +00:00
Johnni Winther 4a3f121341 [kernel] Ensure that visitors don't implicitly returns null
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.

TEST=Refactoring

Change-Id: I9f9b318982148d844be9826a5f8c88374a9fc402
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172180
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-11-18 11:54:30 +00:00
Jens Johansen 0576d64a67 [CFE][kernel] Set parents on typedef children
Change-Id: Iccdd2b0c4c0062abc4e0cf50a2feadc4487941b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172563
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-11-17 17:52:18 +00:00
Dmitry Stefantsov ffc5ea67a1 [cfe] Read Null in a supertype position as an InterfaceType
Change-Id: I64927f996eee9e6928ee3a4303b39be4328ee0b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171727
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-11-12 16:51:07 +00:00
Johnni Winther b38821f39d [kernel] Enforce lints in pkg/kernel
Change-Id: I954f7632f22b552febed2a3140f81245277cb050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171581
Reviewed-by: Jens Johansen <jensj@google.com>
2020-11-11 12:51:28 +00:00
Johnni Winther 1930c07cd7 [cfe] Add flags to MethodInvocation and fileEndOffset to Block
The CL add a 'flags' to MethodInvocation with the properties isInvariant
and isBoundsSafe. The former is used for to marks safe calls in unified
collection encoding. Both can be used further by backends.

The CL also adds a 'fileEndOffset' to Block. This is current set for
block declared in used code.

In response to https://github.com/dart-lang/sdk/issues/43994
and https://github.com/dart-lang/sdk/issues/43965

Change-Id: I579fc2928331465dfc2c152ccfd21297b12cfdd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170695
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-09 07:36:44 +00:00
Dmitry Stefantsov d54e2bb568 [cfe,ddc,dart2js,vm] Add NullType
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/170342/
* https://dart-review.googlesource.com/c/sdk/+/170344/
* https://dart-review.googlesource.com/c/sdk/+/170345/
* https://dart-review.googlesource.com/c/sdk/+/170346/
* https://dart-review.googlesource.com/c/sdk/+/170347/

The reason for landing the 5 CLs as one CL is to prevent potential
troubles with bisecting over the branch because the change is fully
functional only with all 5 CLs.

Closes #40122.

TEST=Verified by changes in .expect files in pkg/vm/.
Bug: https://github.com/dart-lang/sdk/issues/40122
Change-Id: Ib8197802fdc69694387ae47ac990c58b3aaab7a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170689
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-06 12:43:52 +00:00
Jens Johansen 9ec87c2da0 [kernel] Field has 2 references
Change-Id: I9c946119e55256b9fbcbf3076ea008aaa1312e86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168949
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-03 16:02:16 +00:00
Jens Johansen 332ce76055 [CFE][kernel] Add 'invalid' nnbd mode; use when trying to out out when compiling in strong mode
Change-Id: I3d1a8da4378cd59e733fc796df38ae98aaf59d6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169881
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-03 14:12:56 +00:00
Johnni Winther 34cedb980c [kernel] Make Procedure.kind final
Change-Id: I1a97c483bd0110061f4a60d26d28ab625dbbc00b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169220
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-27 13:56:38 +00:00
Jens Johansen 2928af2b12 [kernel] Remove unused Class.level, ClassLevel enum and shift Library.flags down
ClassLevel and Class.level have been unused for (at least) years.
This CL removes them.
Library.flags furthermore had the first bit unused after the 'external'
flag was removed (last year I think).
This CL shifts it down so the actual flags doesn't start at bit 1.

Change-Id: Ie0afd150cad331ea694bc5fe2a20aafed22916cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169202
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-27 12:59:33 +00:00
Jens Johansen 741bb5ec4e [kernel] Change library nnbd bit encoding slightly
This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/169080
mostly changing the library nnbd bit encoding so that weak is uniquely
represented as "00" which is the default when nothing else is set.

Change-Id: I1cd31e8c1927fee29d579772fb6893cb28befbf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169200
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-27 11:53:48 +00:00
Jens Johansen bee48f6ed6 [CFE][kernel] Add more checks for NNBD settings mismatch
* When initializing from a dill in the incremental compiler check that
  the nnbd mode matches what we're asked to compile.
  If they don't, silently do not initialize from the file.
* When serializing and deserializing, assert that the individual
  libraries match the component compilation mode.
* When appending dill libraries in the CFE, assert that they match
  what we're asked to compile.
* Remove NonNullableByDefaultCompiledMode.Disabled -- it's not a thing
  anyway.

https://github.com/flutter/flutter/issues/68901

Change-Id: I2e68f17cb3a065c4352e4db7c8aee3c13747f23a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169080
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-26 15:23:56 +00:00
Jens Johansen 29fa4e8148 [CFE et al] Compile flutter platform as agnostic for test; set component mode more
Bug: dartbug.com/43844 dartbug.com/43807
Change-Id: Iba662f0955897244aaac86ceace73b213fa06319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168482
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-21 10:04:41 +00:00
Anna Gringauze f04bc85e4f Refined scope calculation in expression compiler
- 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>
2020-10-20 01:44:52 +00:00
Johnni Winther 8b07d1902c [kernel] Remove DirectPropertyGet/DirectPropertySet/DirectMethodInvocation
These nodes are no longer used.

Change-Id: I40c8df7376f0c40a4122c22d934fb3c6f6fd520d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165902
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-03 19:15:41 +00:00
Jens Johansen fc7de901ee [kernel] Make LogicalExpression operator an enum (and rename)
Change-Id: I6054e8e44133d2419582d74700c4223d51495978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165606
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-02 09:41:12 +00:00
Johnni Winther f4501b6e83 Reland "[kernel] Rename Name.name to Name.text"
Including a deprecated getter to avoid breaking dependent code outside
the Dart repo.

Change-Id: I365957b7c2da6e0cb5c71eb8d2906b0dc6ff18ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163062
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-17 06:10:49 +00:00
Johnni Winther c9576a1dac Reland "[cfe] Make fast path for adding simple member signatures"
Change-Id: If9aa575308a3932988259f36d217f6d402136388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162749
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 10:37:28 +00:00
Johnni Winther 644df9b9fb Revert "Reland: [kernel] Rename Name.name to Name.text"
This reverts commit c430a0ac0b.

Reason for revert: Will break flutter_frontend_server when rolled into google3

Original change's description:
> Reland: [kernel] Rename Name.name to Name.text
> 
> Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

TBR=jensj@google.com,johnniwinther@google.com

Change-Id: Ib6961f49dd416171c5d5935c490d79d6f7be779e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162748
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 08:22:55 +00:00
Johnni Winther c430a0ac0b Reland: [kernel] Rename Name.name to Name.text
Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 07:42:42 +00:00
Jason Simmons fc01707e44 Revert "[cfe] Make fast path for adding simple member signatures"
This reverts commit f7ff99e937.

Reason for revert: This caused a regression in Flutter:
https://api.cirrus-ci.com/v1/task/5181542404194304/logs/test_framework.log

Change-Id: I892690cb2c7dc626939ddbec99b6dffda3f6fc80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163000
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-09-15 23:53:45 +00:00
Daco Harkes 7302e01a79 Revert "[kernel] Rename Name.name to Name.text"
This reverts commit 3ff8dd2f51.

Reason for revert: Fails all CI builders. Possibly something landed
in the mean time.

Original change's description:
> [kernel] Rename Name.name to Name.text
> 
> Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
> Reviewed-by: Jens Johansen <jensj@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

TBR=jensj@google.com,johnniwinther@google.com

Change-Id: I2ffe526dabf37ae09d5e4ab1fbe514925f6e8768
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162744
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-09-15 15:21:35 +00:00
Johnni Winther 3ff8dd2f51 [kernel] Rename Name.name to Name.text
Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-15 14:27:22 +00:00
Johnni Winther f7ff99e937 [cfe] Make fast path for adding simple member signatures
Change-Id: I9eae2bbd048738a9620ed39c2210c5890428e14b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162704
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-15 12:06:31 +00:00