Web platforms do not support dart:isolate--`dartdevc` already treats it
as false, but this fix is needed if using `--kernel` and conditional
imports (which are handled by the front_end rather than dev_compiler).
Change-Id: I479a4846c6073f986a4ce7a0739ed0a25b1bd35b
Reviewed-on: https://dart-review.googlesource.com/c/86085
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This change extends/fixes the exiting "pattern recognition" which tries
to recognize the pattern
v2 <- LoadClassIdInstr(v1)
BranchIf v2 == IntegerConstant(cid)
Furthermore we start inlining the recognized `ClassID.getID` method very
early in the pipeline. This allows the VM to recognize the above
pattern and insert redefinitions before the actual inlining pass.
Furthermore we special-case two very hot methods in utf8 decoding by
manually having two loops, one of which is guarded by a class-id check
against the _Uint8ArrayView class, which is most common. (In the future
we would like to unify the typed data layouts so we no longer need to
use `ClassId.getID`, thereby also allowing non core library code to use
this).
This improves dart-aot by
* 31%+ for a protobuf decoding benchmark we care about
Issue https://github.com/dart-lang/sdk/issues/31954
Change-Id: I7181bbf096aabe303634fd3b2bff9cc96d69719c
Reviewed-on: https://dart-review.googlesource.com/c/85443
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Fixes#35273
Previous wording made it seem like the behavior was the same as
`identical`.
Change-Id: Ib7fdb183a26a4e2b3c849dd72cb515aa1652028d
Reviewed-on: https://dart-review.googlesource.com/c/85465
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This reverts commit d7cf6959bb.
Reason for revert: This causes crashes on the vm-obfuscate builder at https://ci.chromium.org/p/dart/builders/luci.dart.ci.sandbox/vm-kernel-precomp-obfuscate-linux-release-x64
like
FAILED: dartkp-dart_precompiled release_x64 corelib_2/linked_hash_map_test
Expected: Pass
Actual: Crash
Unexpected compile error.
--- Command "vm_compile_to_kernel" (took 11.000189s):
DART_CONFIGURATION=ReleaseX64 /b/s/w/ir/cache/builder/sdk/pkg/vm/tool/gen_kernel --aot --platform=out/ReleaseX64/vm_platform_strong.dill -o /b/s/w/ir/cache/builder/sdk/out/ReleaseX64/generated_compilations/dartkp/tests_corelib_2_linked_hash_map_test/out.dill /b/s/w/ir/cache/builder/sdk/tests/corelib_2/linked_hash_map_test.dart --packages=/b/s/w/ir/cache/builder/sdk/.packages -Ddart.developer.causal_async_stacks=true
exit code:
0
--- Command "precompiler" (took 583ms):
DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/gen_snapshot --snapshot-kind=app-aot-assembly --assembly=/b/s/w/ir/cache/builder/sdk/out/ReleaseX64/generated_compilations/dartkp/tests_corelib_2_linked_hash_map_test/out.S --obfuscate --sync-async --ignore-unrecognized-flags --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/out/ReleaseX64/generated_compilations/dartkp/tests_corelib_2_linked_hash_map_test/out.dill
exit code:
-6
stderr:
Warning: This VM has been configured to obfuscate symbol information which violates the Dart standard.
See dartbug.com/30524 for more information.
===== CRASH =====
version=2.2.0-edge.83712405657ff736033380cb24b0bd5a62fc3692 (Tue Nov 27 16:56:07 2018 +0000) on "linux_x64"
si_signo=Segmentation fault(11), si_code=1, si_addr=0xd1400050e5f
Dumping native stack trace for thread 2b71
[0x000056001fc426c7] Unknown symbol
[0x000056001fc426c7] Unknown symbol
[0x000056001fe5763d] Unknown symbol
[0x000056001fe4c99c] Unknown symbol
[0x000056001fe6166a] Unknown symbol
[0x000056001fe59c0c] Unknown symbol
Original change's description:
> [VM] Inline ClassID.getID() eagerly, extend pattern matching logic to recognize it, use it to special case ascii decoding
>
> This change extends/fixes the exiting "pattern recognition" which tries
> to recognize the pattern
>
> v2 <- LoadClassIdInstr(v1)
> BranchIf v2 == IntegerConstant(cid)
>
> Furthermore we start inlining the recognized `ClassID.getID` method very
> early in the pipeline. This allows the VM to recognize the above
> pattern and insert redefinitions before the actual inlining pass.
>
> Furthermore we special-case two very hot methods in utf8 decoding by
> manually having two loops, one of which is guarded by a class-id check
> against the _Uint8ArrayView class, which is most common. (In the future
> we would like to unify the typed data layouts so we no longer need to
> use `ClassId.getID`, thereby also allowing non core library code to use
> this).
>
> This improves dart-aot by
> * 31%+ for a protobuf decoding benchmark we care about
>
>
> Issue https://github.com/dart-lang/sdk/issues/31954
>
> Change-Id: Ia567b92b7e76ff28eda1726deaafda32732ed8f5
> Reviewed-on: https://dart-review.googlesource.com/c/85281
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Jenny Messerly <jmesserly@google.com>
> Commit-Queue: Martin Kustermann <kustermann@google.com>
TBR=vegorov@google.com,kustermann@google.com,jmesserly@google.com,johnniwinther@google.com,sra@google.com
Change-Id: I912b0768c32cbb00297ce48db29dbdbea44c14fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/85441
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
This change extends/fixes the exiting "pattern recognition" which tries
to recognize the pattern
v2 <- LoadClassIdInstr(v1)
BranchIf v2 == IntegerConstant(cid)
Furthermore we start inlining the recognized `ClassID.getID` method very
early in the pipeline. This allows the VM to recognize the above
pattern and insert redefinitions before the actual inlining pass.
Furthermore we special-case two very hot methods in utf8 decoding by
manually having two loops, one of which is guarded by a class-id check
against the _Uint8ArrayView class, which is most common. (In the future
we would like to unify the typed data layouts so we no longer need to
use `ClassId.getID`, thereby also allowing non core library code to use
this).
This improves dart-aot by
* 31%+ for a protobuf decoding benchmark we care about
Issue https://github.com/dart-lang/sdk/issues/31954
Change-Id: Ia567b92b7e76ff28eda1726deaafda32732ed8f5
Reviewed-on: https://dart-review.googlesource.com/c/85281
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
In Dart 2.0 types are enforced at signature boundaries, so most of the
type checks on arguments are serving no other purpose other than
disalllowing `null`. Make that explicit in these checks.
Unnecessary checks were discovered by searching for "if (\w+ is" and
filtering down to the checks that match exactly against a type argument.
Checks in any files related to "js" or "dart2js" are left alone.
In a few places there will be a user visible behavior change where
ArgumentErrors will reference "not null" instead of "not a String" etc.
Client code should not be relying on these details and the new messages
should be more clear.
Updated checks take a few forms:
- ArgumentError.checkNotNull
- Changing `value is SomeType` to `value != null` where it's combined
with other conditions.
- Where non-null values are already guaranteed or allowed, drop the
check.
Other changes:
- Use single line short circuit returns or throws where possible.
- In some places change an ArgumentError to a RangeError for
consistency.
- Some minor formatting changes with the latest dartfmt.
Change-Id: I761dd5cc325ccdbf6506d6db8cfa9246218c1f98
Reviewed-on: https://dart-review.googlesource.com/c/81501
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
This:
- exposes the feature as an experiment flag
- cleans up the code to prevent issues with strong-mode checks
- provides only a single implementation, but lets users use a hook to tailor the feature to their needs.
Change-Id: I3bf277b76b7503235c35bfbf83356c953405ff6f
Reviewed-on: https://dart-review.googlesource.com/c/84880
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Change-Id: Ic0bd821b3966c9ec2e92052ed2046b01e5fdd1cb
Reviewed-on: https://dart-review.googlesource.com/c/84124
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
And make tweaks to Uri and StreamController equality
Change-Id: I63f85f67209442684e50b7c2e0011531893f294e
Reviewed-on: https://dart-review.googlesource.com/c/82781
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
This was an idea that never manifested.
This has thus been unused code for more than a year.
Change-Id: Ib7c373a988a220e515d873d7a9e815cecfab178c
Reviewed-on: https://dart-review.googlesource.com/c/82225
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
The current DateTime class takes DateTime objects as arguments,
and then tries to access private members.
That does not work if someone else implements the DateTime interface.
Fixes#34962
BUG= http://dartbug.com/34962
Change-Id: I7191fe42f5b6efc1c7da5ed8e22b892b18f872f7
Reviewed-on: https://dart-review.googlesource.com/c/81828
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
These are guarateed by the type system now.
Change-Id: I6d68a0284761805ae14f8c26d68469018c2a0e1d
Reviewed-on: https://dart-review.googlesource.com/c/81186
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
the VM exits before the Observatory server has a chance to
start listening.
Bug: 34839
Change-Id: I2a5dfe69a197fe054dd041af3ea4e07da736b226
Reviewed-on: https://dart-review.googlesource.com/c/81381
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Fixed a number of standard lints
Change-Id: I36e535c6dc91f3c7407c66a8089c38e0463bee83
Reviewed-on: https://dart-review.googlesource.com/c/81700
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
In the places where other utilities like `RangeError.checkNotNegative`
are used it reads nicer to call through a similar signature than to
follow a conditional with the utility.
Change-Id: Idd89b2934020fb55e57a22c39773fd7879d1c28f
Reviewed-on: https://dart-review.googlesource.com/c/81287
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Also mention it in the `external const factory Symbol` constructor.
This only relevant for constant expressions that may be used as
switch case expressions or constant map keys.
See #32557.
Bug: http://dartbug.com/32557
Change-Id: Ie82799f3f0d39c21c10765338a7dfeb74a582add
Reviewed-on: https://dart-review.googlesource.com/c/81242
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Going through the closure seems to add 100+ms to the connect flow.
Change-Id: I3ba413a333a403628cb9d8320c91448c3ac7072c
Reviewed-on: https://dart-review.googlesource.com/c/80524
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
mDNS queries (and many other local queries) should be allowed to set
their TTL to 255. This patch enables that on all platforms.
On macOS in particular, a system service reserves the mDNS port. The
socket option SO_REUSEPORT is required in addition to SO_REUSEADDR to
successfully bind there; the flag is also supported on Linux, so this
patch allows it to be used there as well (but prints an error message if
it's used on any other platform).
I could use some guidance as to tests for this - is it support availble
for running tests only on specific platforms?
Bug: https://github.com/dart-lang/sdk/issues/34799 and
Change-Id: I29b620d8ec04343f356a8171bae3d385ddfa9564
https://github.com/dart-lang/sdk/issues/34782
Reviewed-on: https://dart-review.googlesource.com/c/80082
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Fixed a typo or 2. Ran the entire file through a basic spell check and it's good now
Closes#34773https://github.com/dart-lang/sdk/pull/34773
GitOrigin-RevId: ccde23a5880ec5904d838e5c2bc2a747c5d3ebb6
Change-Id: I154bd90376a4ea4b7a8d736382b19a44fc41e5b0
Reviewed-on: https://dart-review.googlesource.com/c/79500
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>