Passes bodies are moved into compiler_pass{.cc,.h}.
Invoking a pass is just INVOKE_PASS(Name) now, instead of putting a bunch of
if-s and calls in compiler.cc or precompiler.cc.
We also consolidate ability to print IL and enable-disable passes under a
single flag --compiler-passes, e.g.
--compiler-passes=-Inlining,-CSE disable inlining and CSE passes
--compiler-passes=Inlining+ print IL after Inlining pass and all
subsequent passes
Change-Id: I90ff54b04a54f20099f5bf38dd45b16b8e3c4781
Reviewed-on: https://dart-review.googlesource.com/43968
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The VM uses normally strong mode types for LoadField instructions.
Though for certain fields we have known class-ids which we attach to the
Field instructions.
Before we had a case where the strong mode type was dynamic, but we had
a very specific cid for the Field. Though when using the [CompileType]
afterwards via [CompileType()->ToAbstractType()] it was returning
`dynamic`.
We should use CompileType::ComputeRefineType() to get the most specific
one of those two.
Issue https://github.com/dart-lang/sdk/issues/31798
Change-Id: Ib0b7a596449cba0bc53e118ee603b2039aa312b3
Reviewed-on: https://dart-review.googlesource.com/43422
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit 9ba8c08953.
Reason for revert: broke Flutter, to reproduce build Flutter engine with HEAD dart and try running animation benchmark in release or profile mode in --preview-dart-2, gen_snapshot would crash. Similarly this also breaks Flutter tests in --preview-dart-2 mode.
Original change's description:
> [VM runtime] Switch intrinsics from old to new Bigint implementation.
>
> Change-Id: I43dfbdf76267bb96d1b1ce4aeb695d02bb18b7f8
> Reviewed-on: https://dart-review.googlesource.com/44025
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Régis Crelier <regis@google.com>
TBR=alexmarkov@google.com,regis@google.com
Change-Id: I926cc72e1ed89d8631e33ebcc8198853c05a08dc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/44065
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Canonicalizer should not remove Redefinitions that have no uses before LICM
happens. Even though Redefinition itself has no uses it might be still
dominating uses of the original value - is we expect RenameUsesDominatedByRedefinitions
that is run before LICM to normalize the graph by routing those uses
through Redefinition.
Fixes https://github.com/dart-lang/sdk/issues/32322
Bug: 32322
Change-Id: Ice310aaf8ab62cd6d3ec575876c12e8634a91dce
Reviewed-on: https://dart-review.googlesource.com/44040
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
This CL adds auto-generation of entry points JSON file for standalone VM
during build (in runtime_kernel target, as it is only used for
kernel-based transformation).
pkg/vm/tool/precompiler2 script is changed to automatically pass
auto-generated entry points to gen_kernel.
New option --entry-points is added to pkg/vm/bin/gen_kernel.dart in order to
specify custom entry points files.
Checked-in entry_points.json is still used for testing and in gen_kernel
if --entry-points is not specified.
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I39c4461e48763f40d7565656dc33e23fc5d9c2cb
Reviewed-on: https://dart-review.googlesource.com/42521
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Because DBC still uses code patching to implement breakpoints, running a program from DBC AppJIT may trigger a crash attempting to set a breakpoint.
Change-Id: I5d761aacec6629be946d7d2510ec3f1e3f03f4a4
Reviewed-on: https://dart-review.googlesource.com/42584
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
reused to support new Bigint implementation) by introducing a global constant.
Add asserts and comments in old Bigint implementation.
Change-Id: Id647ffb6ae6557457ccf52fde4f0e6eb3d06c0b5
Reviewed-on: https://dart-review.googlesource.com/43280
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
This reverts commit 52d1b4e96d.
Reason for revert: Analyzer and DDC do not support the super-mixin fix and flag, so the new test fails on them. The test needs to either be marked as failing on them, or support needs to be added and work in the test framework.
Original change's description:
> Fix a bug in Kernel's mixin elimination
>
> Mixin elimination copied factory constructors from the mixin class to
> the mixin application class. This could be observed as an unbound
> type parameter which led to a crash in the VM. Fixes
> https://github.com/dart-lang/sdk/issues/32267.
>
> Change-Id: I87b70a35d11c364739d01e261adf5329d492d8cf
> Reviewed-on: https://dart-review.googlesource.com/42922
> Reviewed-by: Jens Johansen <jensj@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,jensj@google.com,kmillikin@google.com
Change-Id: I4a0bcf0b323c9adef7e5dc7d9019b6aafe40509d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/42960
Reviewed-by: William Hesse <whesse@google.com>
This reverts commit ef51b33f22.
Reason for revert: Issue from initial land was fixed in 076db33f03.
Original change's description:
> Revert "[kernel] Don't always treat doubles as constants"
>
> 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>
TBR=ahe@google.com,vegorov@google.com,jensj@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I3c20797f585057e8f77e917918926dcfa921df0a
Reviewed-on: https://dart-review.googlesource.com/42720
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Before this CL the constant propagator relied on two objects being identical
only if a.raw() == b.raw().
This is only the case if they have been canonicalized, which doubles and
ints shouldn't have to be.
This CL fixes it and introduces a few tests (one of which -cdartkp would have
failed prior to this CL).
NOTE: This should only change the behavior of precompiled mode, and only so
that it is more correct.
Change-Id: I4380ce4d3292fa15d728b0572403cb7ed4d0582c
Reviewed-on: https://dart-review.googlesource.com/42620
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
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>
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 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>