We use it quite often during computing relevance of completion
suggestions. This brings the cost of ElementImpl.hasDeprecated from
7.55% to 0.77% during large completions.
Change-Id: Ie6d2b9ef6a825920a926711b5c3f75430e98af58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219904
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Fixes a bug where version strings with arbitrary characters are accepted as
digit separators.
Change-Id: I273f242155e421d994d324fce339e2f9889bc1fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219920
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
The implementation is extremely simple: wire strict-casts right
alongside implicit-casts in AnalysisOptionsImpl, AnalysisSession, and
TypeSystem. The flag is separate from implicit-casts because it is
_slightly_ stricter. The implicit-casts flag has some gaps in coverage
(like for-each iterables, and yield-each expressions). Filling these
gaps in implicit-casts would be expensive (requiring cleanup), and the
short-term goal is to deprecate the flag, so it is not important to
tidy it up.
A few extra bits are then added which are specific to strict-casts,
which improve the coverage.
Most of this change is the tests: tests are added for (theoretically)
each error code which could be reported as a result of strict-casts. The
test model using WithStrictCasts follows the model of WithStrictCasts,
which couples two tests into one assertion, ensuring the state of each
example code before and after strict-casts.
Bug: https://github.com/dart-lang/sdk/issues/36267
Change-Id: I52b2fc831fac3a5467ec7164df8fc1a1109e42ef
https://github.com/dart-lang/sdk/issues/33749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219847
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This reverts commit 6732808c40.
Reason for revert: Causes breakage in flutter framework tests, please see https://github.com/flutter/flutter/pull/93406 under the checks section.
Original change's description:
> Add a lock mechanism for quick fixes
>
> I'm not fond of this approach, so if you have alternative suggestions
> I'd be very interested in hearing them.
>
> Change-Id: I9646d564b63d921f5eed77bdfa4de082b65d9148
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219126
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I6d6fd2511a80e5fd457eed234baa4eb41210467e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219901
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
For future listener frames async unwinding produces frames with
`pc_offset` set to 0, because this frames correspond to closures
which will be invoked once the future completes. Such frames
are different from most other frames which correspond to real
call or yield locations within native code and have non-zero
`pc_offset`.
Because there is no call-/yield- site at 0 compiler does not emit
any source location information into CodeSourceMap and consequently
runtime can't produce much beyond file name in the stack trace for
these special frames.
To make matters worse ordering of code objects in the AOT snapshot
could affect symbolization of such frames - sometimes resulting in
an arbitrary token position being attached to the symbolized frame.
This CL adds more special handling of these frames into
StackTrace::ToCString and changes compiler to emit a dummy source
position descriptor for the start of every closure function.
This descriptor is encoded as
ChangePosition function.token_pos()
AdvancePC 0
in the CodeSourceMap. This entry is then handled specially when
generating DWARF.
This is reland of https://dart-review.googlesource.com/c/sdk/+/219781 with
fixes for ARM build.
TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy{,_lazy_non_symbolic}_test
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try
Change-Id: I06f80c1125422675758917ea12cdf2c70a2f6deb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219795
Auto-Submit: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This reverts commit 64d30f848b.
Reason for revert: breaks ARM build.
Original change's description:
> [vm] Fix symbolization of future listener frame.
>
> For future listener frames async unwinding produces frames with
> `pc_offset` set to 0, because this frames correspond to closures
> which will be invoked once the future completes. Such frames
> are different from most other frames which correspond to real
> call or yield locations within native code and have non-zero
> `pc_offset`.
>
> Because there is no call-/yield- site at 0 compiler does not emit
> any source location information into CodeSourceMap and consequently
> runtime can't produce much beyond file name in the stack trace for
> these special frames.
>
> To make matters worse ordering of code objects in the AOT snapshot
> could affect symbolization of such frames - sometimes resulting in
> an arbitrary token position being attached to the symbolized frame.
>
> This CL adds more special handling of these frames into
> StackTrace::ToCString and changes compiler to emit a dummy source
> position descriptor for the start of every closure function.
>
> This descriptor is encoded as
>
> ChangePosition function.token_pos()
> AdvancePC 0
>
> in the CodeSourceMap. This entry is then handled specially when
> generating DWARF.
>
> TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy{,_lazy_non_symbolic}_test
>
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try
> Change-Id: I80740dd2c3cb03d6c03c35e1b3bde2cacbe033e0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219781
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Clement Skau <cskau@google.com>
TBR=vegorov@google.com,cskau@google.com,sstrickl@google.com
Change-Id: I134ed9e5ccd1dbf3f7c07d046d92be298fe96eb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219794
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This reverts commit 6828fd752e as
internal use of flag that forced the original revert has been removed via 408658160 and
408425059 cls.
TEST=ci
Change-Id: I9d4ae3c01bef938ce6e111afedfdb1ca6525bdac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219840
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
For future listener frames async unwinding produces frames with
`pc_offset` set to 0, because this frames correspond to closures
which will be invoked once the future completes. Such frames
are different from most other frames which correspond to real
call or yield locations within native code and have non-zero
`pc_offset`.
Because there is no call-/yield- site at 0 compiler does not emit
any source location information into CodeSourceMap and consequently
runtime can't produce much beyond file name in the stack trace for
these special frames.
To make matters worse ordering of code objects in the AOT snapshot
could affect symbolization of such frames - sometimes resulting in
an arbitrary token position being attached to the symbolized frame.
This CL adds more special handling of these frames into
StackTrace::ToCString and changes compiler to emit a dummy source
position descriptor for the start of every closure function.
This descriptor is encoded as
ChangePosition function.token_pos()
AdvancePC 0
in the CodeSourceMap. This entry is then handled specially when
generating DWARF.
TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy{,_lazy_non_symbolic}_test
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try
Change-Id: I80740dd2c3cb03d6c03c35e1b3bde2cacbe033e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219781
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
TEST=Standard CQ
Change-Id: I8598e2102df2990396afa3e56ad4a41120c5dee0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219787
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Working with Uri, in form of _SimpleUri, was taking about 11%.
Now it _PubFilter is about 1%.
Change-Id: I35cd426d9c79e57cf85dcfe751ac57556f1a8b42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219849
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Otherwise it looks weird in Observatory, as if `Stopwatch.stop()`
uses all the time consumed by the awaited operation.
Change-Id: Ic33ab18ac7fc2d19f221d659d8b7989ed0d54a98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219848
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This cuts the time to produce not yet imported suggestions 2x.
We don't check for abort anymore, will use the given budget.
Change-Id: Id02b0dcd894f89affa00e4a67fc1e93dc7745215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219845
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Initial 'dart doc' command for the unified 'dart' developer tool,
over time replacing the exiting 'bin/dartdoc' tool.
Change-Id: Ib5639f9329bf5ed86375c97c5e485471934c56ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217980
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This adds [96404e0749864c9fbf8b12e1d424e8078809e00a] which fixes issue
where `pub publish` and `pub token add` hangs after reading from
`stdin`.
[cherry-pick-for-2.15.0]: https://github.com/dart-lang/pub/compare/cherry-pick-for-2.15.0
[96404e0749864c9fbf8b12e1d424e8078809e00a]: 96404e0749
Change-Id: I49dcafdcabc002568cb9d9fc6268ebdd0de1af10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219782
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
When we resolve a file partially, there is no fully resolved
CompilationUnit. So, anything we create for completion should be
based on element models and a resolved, or unresolved AstNode.
In a following CL I will make it possible to create instances of
DartCompletionRequest based on such element models and node.
Change-Id: Ief7e376588bb63f4d898e33299a9fd2014c88843
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219748
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The JavaScript-to-JavaScript async transform had an inconsisent
handling of switch statements that contained an await, but only in the
expression.
For now the special handling of the expression-only case is disabled.
Change-Id: Ia79ff3951d681ba933df638da7e0e518d401ed9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219746
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This code is effectively dead. The code used to report invalid cast
errors, but these have 100% been replaced by non-bool errors
(NON_BOOL_OPERAND, NON_BOOL_EXPRESSION, NON_BOOL_NEGATION_EXPRESSION)
which are reported in resolution.
The (bizarre, in my opinion) exception of implicit casts for
instance creation expressions had to be moved to
bool_expression_verifier. This is to satisfy an existing test case:
tests/co19_2/src/Language/Expressions/Booleans/Boolean_Conversion/definition_t02.dart
Adds many implicit casts to pre-null safety tests to ensure test
coverage; there were no tests of the old "implicit cast" errors.
Removes one old test from checker_test.
Removes checkForCast, refactoring the method it calls, which
simplifies both null safe and pre-null safe checking.
Removes an unused parameter in _checkFunctionTypeCasts.
I did not add tests for &&= or ||=, which are still not part of the
language.
Change-Id: I64c95aa7b05fff352e85c4a54fd2dd836864de83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219721
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This reverts commit aed481664d.
Reason for revert: breaks build
Original change's description:
> [VM/Service] Restructure the timeline flag setting code a bit to make it
> convenient for adding a Dart C API function for enabling
> timeline streams.
>
> TEST=cq
>
> Change-Id: I885288914e700bfd91605d3d04bba3c0c217656d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219620
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>
TBR=bkonyi@google.com,asiva@google.com
Change-Id: Ic2ec6094268f7e6c7a2892c9604dc7ca63603190
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219741
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
convenient for adding a Dart C API function for enabling
timeline streams.
TEST=cq
Change-Id: I885288914e700bfd91605d3d04bba3c0c217656d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219620
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>