It's not generally safe to continue to use the Shadow nodes after they
have had their type inferred, because they give a false picture of the
tree. In this case it led to an assertion failure.
Move the assert to a place in the code where it is true. Use the
correct subexpression for subsequent check insertion. Clear the
parent pointer when Kernel nodes are removed from the tree to try to
catch problems like this.
Fixes https://github.com/dart-lang/sdk/issues/32050
Change-Id: I775747d7a6a5240d63881c8563c83cc84628e3d7
Reviewed-on: https://dart-review.googlesource.com/52525
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This makes the Flutter repo analysis about 6% faster.
Before: 56.9 57.4 56.9 57.3 56.5 56.9 56.6
After: 53.5 53.0 53.8 54.3 53.5 53.0 53.0
To see the different better, I ran lints 100 and 10 times for each file.
Before: 628 621 109 107 109
After: 338 333 77 75 76
To get these numbers we will need to make corresponding changes to lints,
to implement these interfaces, so that they are used instead or the
current visitors. I have these changes locally, but we would need to
publish analyzer first.
R=brianwilkerson@google.com, pquitslund@google.com
Change-Id: I8b4efe05f815082fe39c33c303bb92b7dac19f65
Reviewed-on: https://dart-review.googlesource.com/52644
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
When we infer that a function's return type is the expected one, we
need to make sure to use the greatest closure of that expectation.
Otherwise, the type UnknownType will leak out of type inference if it
occurs in the expectation.
Fixes https://github.com/dart-lang/sdk/issues/32847
Change-Id: I2ce65c6b38d701073e3071f03b8c3d52442c2f86
Reviewed-on: https://dart-review.googlesource.com/52521
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
This reduces small tagged integers on 64 bit platforms from 63 bits to
31 bits plus one tag bit.
This is a step on the way to compile-time-optional compressed pointers
on 64 bit platforms. See more about this at go/dartvmlearnings
This causes a slowdown for some uses of integers that don't fit in 31
signed bits, but because both x64 and ARM64 have unboxed 64 bit
integers now the performance hit should not be too bad.
This is a reapplication of
https://dart-review.googlesource.com/c/sdk/+/46244
It was reverted due to a compilation error on 32 bit
ARM with DBC.
R=vegorov@google.com
Change-Id: I943de1768519457f0e5a61ef0b4ef204b6a53281
Reviewed-on: https://dart-review.googlesource.com/51321
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Adding the flag to dart2js means we can change the 'best' set of flags
without updating the benchmarking insfrastructure.
Change-Id: I7b4015819fab8c79ae5736c76c3cb5eda94b57f5
Reviewed-on: https://dart-review.googlesource.com/52523
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
... and update more analyzer tests
Change-Id: Ieed123e16e7ae451cf2046253deb0c7773091417
Reviewed-on: https://dart-review.googlesource.com/52500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
- Drop the `copy_observatory` and pub get steps. Use a checked in
`dart2js.packages` file and build from the source tree.
- Invoke dart2js directly for the build command.
- Use the dart2js executable checked in to the SDK when it is available,
otherwise fall back on the dart VM and dart2js source.
- Manually synthesize a filered `packages` directory out of the source
directories for observatory and it's dependencies
- Remove transformer section of the pubspec since it's unused.
Bug: #32900
Change-Id: I35a19ffc8c3e732c68b65adf4595a6a51e28b94f
Reviewed-on: https://dart-review.googlesource.com/51740
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
This reverts commit 9bb085a1c6 due to
test failure in google3.
Change-Id: I63940e62bd97c83bc432db99b44c991e6c1e025e
Reviewed-on: https://dart-review.googlesource.com/52422
Reviewed-by: Dan Grove <dgrove@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
This reverts commit 3e1335edc3.
Reason for revert: crbug.com/836287 is resolved for Windows builders.
Original change's description:
> [infra] Temporarily remove Windows SDK builder from CQ
>
> TBR=sortie@google.com
>
> Bug: crbug.com/836287
> Change-Id: I3ec3eb378329f073afca0d1c30e0bd6425e9db00
> Reviewed-on: https://dart-review.googlesource.com/52450
> Reviewed-by: Alexander Thomas <athom@google.com>
TBR=sortie@google.com,athom@google.com
Change-Id: I17a47c053baf9a8e24cd280a28cd05ad9cb0cc66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: crbug.com/836287
Reviewed-on: https://dart-review.googlesource.com/52480
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Put in types to avoid some implicit downcasts in _SyncStarIterator.
Change-Id: I0b04a20ccc84e20f95469a0515a054caf4cf4b34
Reviewed-on: https://dart-review.googlesource.com/52420
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Allows a rule to depend on create_sdk and declare a part of the SDK as an input. Doing both is good style in GN, and is needed for polymorphism with a prebuilt SDK, which would have an empty dependency and an input to detect updates to the prebuilt artifacts.
Change-Id: Icbb05a1073c6b18517dd715fba047c80caa3e8cd
Reviewed-on: https://dart-review.googlesource.com/52401
Reviewed-by: Zach Anderson <zra@google.com>
Upper bounds are finalized in two steps, canonicalization coming second.
Change-Id: I0d7df9353fc26d91623eb7d8ee59a2c33a6eebf1
Reviewed-on: https://dart-review.googlesource.com/52200
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Implements a new strategy for closed world computation that takes
the static type of the receiver into account when processing dynamic
calls.
For this to work, the J-model needs to only contain live members,
meaning queries can no longer assume that a J-model member exists for
instance for JSString.split because it might not be live.
This is the initial implementation which only uses
ir.MethodInvocation.invocationTarget. Later we will use the static
type of the expression on ir.MethodInvocation, ir.PropertyGet, and
ir.PropertySet.
Change-Id: I2dcc5a9148f27127d4e89c414a7d24f90f9cf2a4
Reviewed-on: https://dart-review.googlesource.com/48480
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
To enable bytecode generation, toggle kEnableKernelBytecode flag at
the beginning of pkg/vm/lib/bytecode/gen_bytecode.dart.
This will also enable generation of bytecode in platform dill files.
Also, bytecode generation can be enabled using --gen-bytecode option of
pkg/vm/tool/gen_kernel.
In kernel binaries, the generated bytecode and constant pool are
placed into 'vm.bytecode' metadata attached to members.
pkg/vm/tool/dump_kernel tool can be used to disassemble
bytecode and print constant pool.
Differences between generated bytecode and original DBC are
described in pkg/vm/lib/bytecode/dbc.dart.
Format of constant pool is described in
pkg/vm/lib/bytecode/constant_pool.dart.
Currently, only a small subset of Dart language is supported.
Bytecode generator will not emit vm.bytecode metadata for a
member if its body has an unsupported operation.
Change-Id: I27d9a361dc779ea115e5676508ee757c1754e05d
Reviewed-on: https://dart-review.googlesource.com/49600
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
When recovering from an invalid annotation in a type variable
(e.g. "< @Foo.bar T >"), the parser could get stuck in an
infinite loop trying to recover. This fixes that situation.
Change-Id: If01e43b9eec575824329808eeb93437432830654
Reviewed-on: https://dart-review.googlesource.com/52300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>