Under certain conditions front-end currently generates as{TypeError}
type checks in constant expressions. Support evaluating these type
checks as constant expressions instead of rejecting them.
Change-Id: Id432c4c5062d7bab89c29fef308b42b2cbd64de8
Reviewed-on: https://dart-review.googlesource.com/41761
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This reverts commit 12407c3ea0.
Reason for revert: co19/Language/Expressions/Object_Identity/double_t01 fails in -c dartkp -r dart_precompiled mode.
Original change's description:
> [kernel] Don't always treat doubles as constants
>
> Previously, when the VM parsed a doubles from the dill file it passed
> control over to the constant evaluator which would then case the
> value and canonicalize it.
> That doesn't really seem to make sense when its not used in a const
> context, nor is it done the same way for integers for instance.
>
> This CL changes that and treats doubles the same way as integers.
>
> Below timings are statistics run through "ministat" based on 5 runs
> of each configuration (now and before). The timings is for running
> the dill file with the VM, i.e. the dill file was precompiled via
> fasta.
>
> Program adding 50,000 doubles to a list and prints the last one:
>
> -56.6 +/- 28.2389
> -10.9988% +/- 5.48753%
> (~510 ms -> ~460 ms)
>
> Program adding 1,000,000 doubles to a list and prints the last one:
>
> -3177.2 +/- 263.54
> -31.4643% +/- 2.60987%
> (~10 seconds -> ~7 seconds)
>
> Hello world program:
>
> No difference proven at 95.0% confidence
>
> Change-Id: I7dd748e759b3e433bc806b2ef2505d29f0b109b6
> Reviewed-on: https://dart-review.googlesource.com/42000
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Jens Johansen <jensj@google.com>
TBR=ahe@google.com,vegorov@google.com,jensj@google.com
Change-Id: If8efa9917c009f2df68a3ef00331ab45bf8bf67b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/41981
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Previously, when the VM parsed a doubles from the dill file it passed
control over to the constant evaluator which would then case the
value and canonicalize it.
That doesn't really seem to make sense when its not used in a const
context, nor is it done the same way for integers for instance.
This CL changes that and treats doubles the same way as integers.
Below timings are statistics run through "ministat" based on 5 runs
of each configuration (now and before). The timings is for running
the dill file with the VM, i.e. the dill file was precompiled via
fasta.
Program adding 50,000 doubles to a list and prints the last one:
-56.6 +/- 28.2389
-10.9988% +/- 5.48753%
(~510 ms -> ~460 ms)
Program adding 1,000,000 doubles to a list and prints the last one:
-3177.2 +/- 263.54
-31.4643% +/- 2.60987%
(~10 seconds -> ~7 seconds)
Hello world program:
No difference proven at 95.0% confidence
Change-Id: I7dd748e759b3e433bc806b2ef2505d29f0b109b6
Reviewed-on: https://dart-review.googlesource.com/42000
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This reverts commit c9700040c3.
Revert "[vm] Fix Fuchsia's Platform::Save/RestoreConsoleConfiguration."
This reverts commit 365f7b5a8b.
Reason for revert: newlines not printed correctly on Windows after
spawning a Dart VM process.
fixes#32172
Change-Id: I155752370bed7798fe91defdc61ccfe9f666b725
Reviewed-on: https://dart-review.googlesource.com/41840
Reviewed-by: Zach Anderson <zra@google.com>
snapshot is a Dart2 snapshot or a Dart1 snapshot.
This will be used by the flutter engine to initialize itself
correctly based on the snapshot provided.
Change-Id: I06adaac74b350f96aa6ebb55887e4a81f09fbd14
Reviewed-on: https://dart-review.googlesource.com/41082
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
The list of recognized methods in the VM includes information about
result type. If there is no known/concrete result cid, the list
contains dynamic. When StaticCallInstr for recognized method is created,
its result type was pulled from the list even if it was dynamic.
This change avoids setting result type to dynamic in such case
and fixes the assertion for conflicting result types from the list of
recognized methods and from global type inference.
Now, if list of recognized methods has dynamic, and inferred type
is available, the latter will be used.
Change-Id: I7da7313f93ca08a142226026a4645124c30cfd8f
Reviewed-on: https://dart-review.googlesource.com/41080
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This the second part of fixing #32077 - dealing with mints.
Example:
The runtime of a program adding 100,000 different mints to
a list and prints the last one:
Before: ~12.5 seconds
Now: ~1.2 seconds.
Change-Id: Iad6da1749886bab4e4d3941748cdbab51661c2c3
Reviewed-on: https://dart-review.googlesource.com/41161
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This was causing an assert to fail in tonic, which was expecting the
field to be either a null handle, a String handle, or a Library handle.
Change-Id: I78b44a26c4e0689ad10c5c92e9d757a5c2dc7cc8
Reviewed-on: https://dart-review.googlesource.com/41081
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This reverts commit 3e967d3d76.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Create isolate from the platform kernel when running VM tests under dartk.
>
> Status of tests which now start failing has been updated.
>
> Ability to run the vm tests in strong mode has also been added. The
> status of tests which fail in strong mode will be updated when the vm
> tests are moved under the strong mode tests on the bots.
>
> Change-Id: I95f94c09dd0ebbf1fe661ee1f6e0c3e7b07509bd
> Reviewed-on: https://dart-review.googlesource.com/40642
> Commit-Queue: Siva Chandra <sivachandra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
TBR=sivachandra@google.com,asiva@google.com
Change-Id: I6144bbe882cdf56ee6be3132c6f9dec2cbafcb47
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/41026
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Status of tests which now start failing has been updated.
Ability to run the vm tests in strong mode has also been added. The
status of tests which fail in strong mode will be updated when the vm
tests are moved under the strong mode tests on the bots.
Change-Id: I95f94c09dd0ebbf1fe661ee1f6e0c3e7b07509bd
Reviewed-on: https://dart-review.googlesource.com/40642
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This the first part of fixing #32077 - dealing with doubles.
Example:
The runtime of a program adding 100,000 different doubles to
a list and prints the last one:
Before: ~12 seconds
Now: ~1.3 seconds.
Change-Id: I7f64b8763fdd37dae5d32d3275f8b9c991d4e43a
Reviewed-on: https://dart-review.googlesource.com/40300
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Currently front-end embeds absolute paths to build time locations into
Kernel binaries. Reporting those to user make stack trace unreadable and
also breaks stack trace filters that attempt to filter out implementation
frames from dart:async:
#1 _RootZone.runUnary (file:///Users/vegorov/src/dart/sdk/sdk/lib/async/zone.dart:1381:54)
same frame in legacy mode looks like this:
#1 _RootZone.runUnary (dart:async/zone.dart:1381)
This CL changes stack frame formatting so that even in Dart 2 mode result looks
closer to legacy mode result.
This is a workaround for https://github.com/dart-lang/sdk/issues/32087
Change-Id: Ic69cb039ff7d40d0e8e5340a9c1dc067427479ea
Reviewed-on: https://dart-review.googlesource.com/40522
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Slightly alter async/await transformation in such a way that
:await_jump_var/:await_ctx_var are set before _awaitHelper(...) is invoked -
just like in the AST transformer used by the legacy pipeline. This guarantees
that recursive invocations will continue from the right "jump" point (instead of
continuing from the current jump point).
Fixes https://github.com/dart-lang/sdk/issues/32098
Change-Id: I8899669ceefe3f2edba6531897834b2c275efada
Reviewed-on: https://dart-review.googlesource.com/40520
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This CL corrects handling of overflows in range analysis to
account for wrap-around (which happens with new integer semantics).
* If there is an overflow while doing computations in range
analysis, the resulting range is approximated as full int64 range.
* For symbolic range boundaries 'symbol + offset', offset is checked
to stay within [kMinInt64 - kSmiMin, kMaxInt64 - kSmiMax] in order
to guarantee that overflow doesn't occur.
Issue: https://github.com/dart-lang/sdk/issues/31920
Change-Id: I2c16adbe3597e9b718ed2f6ce7210426fcc9e6a6
Reviewed-on: https://dart-review.googlesource.com/39423
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This change helps in confining flag manipulation to just the embedder.
When we are ready to turn all dart 2 flags to true by default, the
change can be confined to just the VM.
Change-Id: I4ac550c331b1f236a2bd9d0453b7c567eb0c05d3
Reviewed-on: https://dart-review.googlesource.com/38881
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>