This is needed for better highlighting optional new/const. I think the
main reason is that 'new' is highlighed and we knew that this is a
new instance creation. Constructors are also highlighed in the default
color scheme. But class names are not. So, to make code look colorful
again, we need to highlight class names in instance creations.
R=brianwilkerson@google.com, devoncarew@google.com
Change-Id: I8fde0b4aa5243e94d7ba575a74d52d31d3b665bb
Reviewed-on: https://dart-review.googlesource.com/42021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Instead of extending the TreeVisitor which provides an incorrect
implementation of all methods, merely implement the TreeVisitor to
require an implementation in CloneVisitor.
Change-Id: Ied7d3b8062ee380e766c737e844a24b0b746312d
Reviewed-on: https://dart-review.googlesource.com/41926
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@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>
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>
When writing a dill file, certain things are written to the
BufferedSink via addBytes.
In the case where the BufferedSink currently has nothing buffered and is
given a input that is deemed small, prior to this CL, the data was added
directly to the underlying sink. As such a million _sink.addBytes([42])
in a row would make at least 900,000 (the buffer size is 100,000) calls
to the underlying sink.
For `new File(path).openWrite()` that takes a while.
This CL fixes it by always buffering the small writes, reducing the
number of calls to the underlying sink to 10 in the above case.
Change-Id: I097f490d57b0a27b3175d6bb4ef513851acc503e
Reviewed-on: https://dart-review.googlesource.com/41740
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Previously, importing a nonexisting "dart:" uri resulted in a crash in
fasta. This CL introduces a test and fixes the problem.
Fixes#31172.
Change-Id: I61b2668466f2567e5e5dcaff3203f0c5ee9a885f
Reviewed-on: https://dart-review.googlesource.com/36401
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This is a step towards removing the option --strong-mode because
it's supposed to be on by default.
Change-Id: I25da0038d12e359f9c628beb2f92293295f00185
Reviewed-on: https://dart-review.googlesource.com/39983
Reviewed-by: Jens Johansen <jensj@google.com>
It's no longer necessary to guard against $runtime != none in most
cases because running test.py with --runtime=none will treat runtime
failure expectations as Pass.
Change-Id: Ieaff9957ad951066d93a3303af5499c7655d67a6
Reviewed-on: https://dart-review.googlesource.com/41567
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>