This is a reland of 2bafc322fd
Original change's description:
> [vm/wasm] Boilerplate for package:wasm
>
> So far this just builds the wasmer library, copies it into the sdk
> directory, loads the library, and allows you to compile WASM modules.
> You can't actually do anything with the modules yet.
>
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Change-Id: I7d7cfe5721bbe38a6afe76f326518e714d236ed4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158367
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I8056df1e301acde2772ba2273148faa53d03173e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159321
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
So far inference of LoadIndexed type was based on the reaching type
of array. However, in certain cases array definition type may provide
somewhat less accurate but more useful information about generic type of
array. This change improves inference of LoadIndexed type to also take
definition type into account.
Benchmarks in JIT mode with null safety:
MegaFieldHasGetterOnce +8-13%
MegaFieldIndirect +14-31%
MegaFieldHasGetterOnceIndirect +11-32%
MegaOnlyOverriddenOnceIndirect +11-26%
MegaOnlyOverriddenOnce +13-29%
MegaNeverOverriddenIndirect +40-55%
MegaNeverOverridden +36-52%
MegaField +47-59%
MegaOverriddenEvery2nd -23-24%
(This regression is due to an additional method inlining.)
Change-Id: I8ec3342ab05543f810f8415d6fea7cf2e2cdb3c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159521
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL basically change two things about the sorting:
* Entities are not sorted according to metadata. Metadata just follows
along. Before "@a class B {}" would come before "class A {}" because
"@" comes before "c". Now "class A {}" comes first because "A" < "B".
* Sorting happens on a token level, i.e. "F<int>" will now come before
"F2<int>" because "F" < "F2" whereas before it was the other way
around because "F2" < "F<" (because "2" < "<").
None of it really matters as long as sorting is done the same way when
comparing the outlines.
Doing it this way makes it faster and actually brings the runtime
(in benchmarks) less than the old (now deleted) textual outline.
Change-Id: Ib1d887ab0c14519316c8e9a3da38f0dd49b4104f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159041
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The sync operations on a MultiStreamController did not check whether
sending events at the current time was allowed.
That could lead to `null` dereferencing errors when doing operations
on the controller after a cancel, and could cause events to appear
out of order.
Change-Id: I06b86a78959dfcaa402f74e2980a9d515f097dc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159442
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This version generally produce the same output (with slight variations
for spacing between some elements as well as for unassociated metadata)
but is slightly slower in modelled (i.e. sorting) mode.
The slow-down is remedied (so the whole thing actually becomes slighly
faster) if sorting slightly differently than the old version. That is
for another CL though.
Change-Id: Id19df710dff965250bfb7cf51d8756394cbe2067
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159080
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This is to make sure that lookup can be done without getting a safepoint, which might be needed if class needs to be finalized.
Change-Id: I6ed52a56d53369327df0b85d7b04cf41a46ac690
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159188
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
TODO: follow-up with an `extensions_test`
Change-Id: Ie3d18229daf347885128d02e4b751436a8a0643f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159560
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Specifically, don't rely on climbing up from VariableDeclaration(s).
R=brianwilkerson@google.com
Change-Id: I70225ce0b55f9ee2b3405e8a678cc2c854b2af6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
I got tired of wading through the giant list and guessing at which one
matches the options I want to run the tests on, so I added filtering.
If you pass any of the common options like "-m", "-r", etc. when also
passing "--list-configurations", then it only prints configurations
that match those options.
Also, by default it only prints configurations that match the current
host OS.
Eventually, I would like *running* tests to work the same way, where
passing "-c" means "find me a config in the test matrix with this
compiler. But this seems like a good start.
Also, I removed the slow way that test.dart calls test.py to handle
--list-configurations now that those are all in the same package.
Change-Id: Ifabb415a9fad889afc12cfcd7dd81bd02c918612
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158980
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
information
When dartdev and the VM service are enabled, the service should avoid
advertising its connection information until after DDS has connected in
order to prevent race conditions between DDS and external clients.
Fixes https://github.com/dart-lang/sdk/issues/42727
Change-Id: If6393f085e9147af628997a1f8936e84f9d8310c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157462
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Use abstract type of constant for BoolConstantTypeInformation
as the AbstractValueDomain may have something more precise than 'bool'
for a true/false constant.
Evaluate short-circuit `&&` and `||` for constant inputs.
This can occur with named and -Dxxx= defined constants.
TODO: we should consider adding a node like a guarded-phi to
select an input, with possible boolean conversions on inputs.
Change-Id: I7f54503db87f6a6d2034ca59c16b4f1ff69ebbb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159323
Reviewed-by: Christian Altamirano <coam@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This CL lets DillTypeAliasBuilder implement typeVariables and type
and adds a few test that crashed before.
The tests crashed similar to
https://github.com/dart-lang/sdk/issues/43084
so it's assumed that the issue is fixed too.
Change-Id: I735a5d56cf2073be2a1c5f1fa142d98420ef9d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Previously, all boxed native field slots were marked not nullable.
However, several boxed native fields are in fact nullable, which means
that even generated IL that appropriately checks these fields for null
can break in optimized code when the null checks are removed.
Also add some helper utilities for working with representations.
Change-Id: I22703d14cfbadbabeae74179476dea47ace12161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159280
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
This is a reland of 7fc61e77e2
Original change's description:
> [build] Use Goma from depot_tools instead of $HOME/goma
>
> Goma will only be distributed with depot_tools in the future.
>
> Change-Id: Ia7a7faf76f2562bde97d4f88cfe5db02ba76b561
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152652
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Alexander Thomas <athom@google.com>
Change-Id: I6793b6003a40816a8b336273118f6ad983295800
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157380
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Closes https://github.com/dart-lang/sdk/issues/43022
Real static errors were added in a previous CL. This simply removes
TODOs to address that and removes a TODO to handle contexts. Static
error testing doesn't support testing for contexts.
Change-Id: Id27fadeb77484a3556fdfdf4c50c8cd67ce2d9a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159381
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
I also removed the support for updating overrides. I realized, after I'd
started to implement it, that we can't capture enough information in the
text file to be able to update overrides. I have an idea for an
alternative, but would love to hear any thoughts you might have.
Change-Id: I2c55e944384869f853e32238995c659aab49f520
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159380
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
- Wait for the file writes to complete before exiting.
- Only accept the arguments that are actually used.
- Consistently read the arguments that are passed.
Change-Id: I913b8bd35135495cb5e94e4f88555997aea42e54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159181
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Previously, MethodInvocationResolutionTest contained a bunch of useful
tests that should pass in both legacy and null-safety modes (with some
minor changes to expectations), but they were only run in legacy mode
(and a very small set of tests were run in null-safety mode). This CL
moves those tests to a mixin so that they get run in both modes.
This is necessary because in follow-up CLs I will be changing the type
analysis rules for method invocations in null safety mode (in
accordance with
https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/number-operation-typing.md),
and I want to make sure not to lose test coverage.
Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: I263d8422bc2d110dcc7954c7521bd084b7ea839e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Postfix increments and decrements are null-shorting expressions
(e.g. `x?.y++.isEven` only calls `isEven` if `x` was non-null), but it
is still being decided whether postfix `!` should be null shorting
(i.e. whether `x?.y!` should fail if `x` is null). See
https://github.com/dart-lang/language/issues/1163.
Previously, the analyzer was inconsistent about whether it considered
`!` to participate in null shorting; as a result, when analyzing an
expression like `x?.y!`, the analyzer would fail to call
`FlowAnalysis.nullAwareAccess_end`, resulting in corrupted flow
analysis state, which could lead to a crash.
This change makes the analyzer treat `!` as *not* participating in
null shorting, which is consistent with what is currently written in
the spec and implemented in the CFE.
Fixes#43093.
Change-Id: Ie69c5c29f226fe1a0282d0e7a1e079778dc700c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159147
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
For recognized list factories, which take constant type arguments,
compiler can infer full generic type in addition to cid.
This helps remove AssertAssignable when creating List<List<...>> with
List.generate constructor.
Havlak +3.7-10% in JIT mode with null safety.
Change-Id: I0a050c9a0d3604ffcfd1a0afa0f123a07e9ac03a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159185
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Previously, empty list literals were generated as
List<E>._fromLiteral(const [])
List._fromLiteral checks if the argument is an empty list and
calls _GrowableList<E>(0) in such case.
If List._fromLiteral is not inlined, this adds an unnecessary overhead.
Now empty list literals are generated more directly as
_GrowableList<E>(0)
Havlak +15.58% in AOT mode with null safety.
Change-Id: I6723e1e912cd0bbcbbb622f928d912c554217e5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159201
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>