Commit graph

8589 commits

Author SHA1 Message Date
Stephen Adams 15673bc410 Move instantiation classes to separate file
Change-Id: I393ca0deaff07fa764d7821295b89a0edcf8c920
Reviewed-on: https://dart-review.googlesource.com/c/86401
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-12-07 17:43:31 +00:00
Jenny Messerly 41e0ae9399 [dartdevc] fix libraries.yaml to mark dart:isolate unsupported
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>
2018-12-04 21:51:02 +00:00
Jenny Messerly d3c3341b8a [dartdevc] fix conditional imports in kernel backend
Change-Id: I694b67624dff65099ca8cb8147d2b56a3532cd6c
Reviewed-on: https://dart-review.googlesource.com/c/85880
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-12-04 18:39:46 +00:00
Lasse Reichstein Holst Nielsen 1231244ede Add version information to SDK changes that have happened after 2.0.
Change-Id: I4f49731c446d49e8b49e5c1c29ebcab85e085864
Reviewed-on: https://dart-review.googlesource.com/c/84430
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-11-30 07:55:26 +00:00
Kevin Moore 17a7f513c3 Fix up pubspec for pkg:compiler
Removed unused dependencies
Correctly reference repo packages via dependency_overrides
Fix pubspecs for pkg: js_ast, js_runtime, sdk_library_metadata

Change-Id: I2077814f733c299dca7afe3f5ab4b380c2c886e4
Reviewed-on: https://dart-review.googlesource.com/c/85660
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-29 23:33:39 +00:00
Martin Kustermann f5d1229081 Reland "[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: I7181bbf096aabe303634fd3b2bff9cc96d69719c
Reviewed-on: https://dart-review.googlesource.com/c/85443
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-11-28 10:43:32 +00:00
Nate Bosch e25c744138 Clarify doc for Duration equals
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>
2018-11-28 08:29:57 +00:00
William Hesse faafdb4b2f Revert "[VM] Inline ClassID.getID() eagerly, extend pattern matching logic to recognize it, use it to special case ascii decoding"
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>
2018-11-27 18:15:36 +00:00
Martin Kustermann d7cf6959bb [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>
2018-11-27 13:14:27 +00:00
Nate Bosch 5a54f0eb57 Remove type checks that are already guaranteed
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>
2018-11-26 19:38:58 +00:00
Lasse R.H. Nielsen ed09a1e5f9 Update documentation of List.filled.
Change-Id: I3fa8275388adc958e003b50365075121095bc19a
Reviewed-on: https://dart-review.googlesource.com/c/85260
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-11-23 11:18:27 +00:00
Jonas Finnemann Jensen 4b51cea91b More docs for Timer.cancel()
Notably, it's worth documenting that calling `cancel()` twice is safe.

Change-Id: I35fdf3f8a810f78f296fc96750ec9ad4d81c6fc7
Reviewed-on: https://dart-review.googlesource.com/c/83744
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-11-21 10:54:59 +00:00
Sigmund Cherem 59e17553f9 Upgrade call-instrumentation logic.
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>
2018-11-20 20:10:01 +00:00
Kevin Moore c8e95cf3b5 More lint-driven cleanup of Core libs
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>
2018-11-14 16:23:22 +00:00
Sigmund Cherem 015f51c304 Fix windows sdk script
TBR=johnniwinther@google.com

Change-Id: Ibfb0b3657bcf0beb47ebd74874466ddfe9981a0e
Reviewed-on: https://dart-review.googlesource.com/c/84052
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-11-10 00:40:18 +00:00
Sigmund Cherem b484aada21 Remove library-root option - replace it with a libraries-spec option instead
Change-Id: Ie1df52cdaa7ab4381a4c1b94c61a1210f0f31b5f
Reviewed-on: https://dart-review.googlesource.com/c/83641
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-11-09 22:40:28 +00:00
Sam Rawlins 1a5f5e4caf Fix doc comment in HttpRequest.getString and other tweaks
Bug: https://github.com/dart-lang/sdk/issues/21578
Change-Id: I9ec333319922f27a216c1804d889198baf7e579b
Reviewed-on: https://dart-review.googlesource.com/c/82789
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-11-07 23:31:14 +00:00
Sam Rawlins e6e4039bc6 Correct HttpClient, HttpClientRequest, and HttpClientResponse docs.
Fixes #31528, #32408, #31966

Bug: https://github.com/dart-lang/sdk/issues/31528, https://github.com/dart-lang/sdk/issues/32408, https://github.com/dart-lang/sdk/issues/31966
Change-Id: I8072fc565e809fe51fb7e30109d5d43d44b96566
Reviewed-on: https://dart-review.googlesource.com/c/82783
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-11-07 17:31:53 +00:00
Sam Rawlins f7dab643ff Remove discontinued webproject.org links. Fixes #21482
Bug: https://github.com/dart-lang/sdk/issues/21482
Change-Id: Ie3becfa7eb9f233186629cf97bfcabe51efc8794
Reviewed-on: https://dart-review.googlesource.com/c/82790
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-11-06 22:20:51 +00:00
Sam Rawlins 8b465bc9e6 Document that addStream cannot be called while addStream is in progress.
Fixes #31478

Bug: https://github.com/dart-lang/sdk/issues/31478
Change-Id: I7ac08305133c58970d655fa589b1c3d948225000
Reviewed-on: https://dart-review.googlesource.com/c/82787
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-11-03 23:48:23 +00:00
Sam Rawlins 6f75e7a861 Document what happens if DataUri.parse() is passed bad data. Fixes #28679
Bug: https://github.com/dart-lang/sdk/issues/28679
Change-Id: I8fa71064b5b8f842d559276964fc001b8cc4668e
Reviewed-on: https://dart-review.googlesource.com/c/82786
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-11-03 23:41:23 +00:00
Sam Rawlins 2c70f80490 Fix doc comment for terminalLines. Womp womp. Fixes #31612
Bug: https://github.com/dart-lang/sdk/issues/31612
Change-Id: Ic95ae9ef8bb0ed18de939476a6d03739b80ecf5d
Reviewed-on: https://dart-review.googlesource.com/c/82785
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-11-03 22:38:59 +00:00
Sam Rawlins e083b61974 Add more documentation and examples to RegExp constructor. Fixes #32844
Bug: https://github.com/dart-lang/sdk/issues/32844
Change-Id: I658e83a8fc160f3d4e0e2cd1c6aa54f6964664e5
Reviewed-on: https://dart-review.googlesource.com/c/82782
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-11-03 14:59:29 +00:00
Sam Rawlins abbcecf7ad Fix various Encoding documentation. Fixes #31827, #31828, #31829, #31830, #31831
1. Override documentation for Codec.decoder and Codec.encoder so that
   mysterious type parameters `T` and `S` don't appear in documentation, e.g.
   https://api.dartlang.org/stable/2.0.0/dart-convert/Encoding/decoder.html.
   This fixes the documentation for subclasses, including AsciiCodec,
   Latin1Codec, Utf8Codec, and SystemEncoding.
2. Fix typo in `const AsciiCodec()`.
3. Override documentation for AsciiCodec.name.
4. Override documentation for Latin1Codec.name.
5. Override documentation for Utf8Codec.name.
6. Document `const SystemEncoding()`.

Bug: https://github.com/dart-lang/sdk/issues/31827, https://github.com/dart-lang/sdk/issues/31828, https://github.com/dart-lang/sdk/issues/31829, https://github.com/dart-lang/sdk/issues/31830, https://github.com/dart-lang/sdk/issues/31831
Change-Id: I292e1cbafff991b55ab67dba684692b686f3b8de
Reviewed-on: https://dart-review.googlesource.com/c/82788
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-11-03 14:59:18 +00:00
Kevin Moore 475eaee3c2 Cleanup some dynamic/Object promotion confusion from 5226b5c307
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>
2018-11-03 14:05:15 +00:00
Lasse R.H. Nielsen 5226b5c307 Remove some unnecessary dynamic invocations in the platform libraries.
Change-Id: Ia72033e37c4d8292eabd95aeff97e4cb29e81823
Reviewed-on: https://dart-review.googlesource.com/c/82204
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-11-02 11:32:03 +00:00
Nate Bosch ca512dc018 Fix typo in int docs, valus - values
Closes #35021

Change-Id: I1d317fc7a6a76ed9b29e014cd9cab08a0fd17b67
Reviewed-on: https://dart-review.googlesource.com/c/82542
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-11-02 09:27:25 +00:00
Jens Johansen 69f04aac12 Remove unused _ConstantHelper
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>
2018-11-01 08:44:36 +00:00
Lasse Reichstein Holst Nielsen 26121608a1 Make DateTime not assume arguments are instances of the same class.
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>
2018-10-31 07:29:48 +00:00
Keerti Parthasarathy 9f6aff7f52 Update doc comments for Iterable.singleWhere.
Change-Id: I29cc4265ce4f4d76830e0aa9b0bb7f62615504d1
Reviewed-on: https://dart-review.googlesource.com/c/82021
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2018-10-30 22:59:38 +00:00
qtbeee fa3df86c5f Update http status codes
Closes #34946
https://github.com/dart-lang/sdk/pull/34946

GitOrigin-RevId: 1ceac033effa8edea93d985e03aecce0ed833aea
Change-Id: Ia9580c131446ba41feacb889d7ff229f6f966821
Reviewed-on: https://dart-review.googlesource.com/c/81741
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-10-30 15:54:58 +00:00
Nate Bosch 7c845fa853 Remove some unnecessary type asserts
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>
2018-10-29 21:03:50 +00:00
asiva e6d3a45b6a [VM] Fix for issue 34839 Service isolate hangs during shutdown if
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>
2018-10-27 00:45:59 +00:00
Kevin Moore 79f8c8f9d8 cleanup dart:convert
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>
2018-10-26 23:05:24 +00:00
Devon Carew a67ae75471 Fix a typo in dart:io docs.
Change-Id: I970aef1e25b3c72b740b41a3384af8aa75fc4b41
Reviewed-on: https://dart-review.googlesource.com/c/81662
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-10-26 19:03:21 +00:00
Samir Jindel e23acaaf90 [vm/aot] Fix obfuscation.
Test Plan:

Make vm-kernel-precomp-obfuscate-linux-release-x64-try green, ensuring status file changes
reflect design gaps and not bugs.

Tested locally that obfuscated Flutter Gallery runs.

Change-Id: Ifcdc334de58f43c310e15b58dbcf6fe1597206f2
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-obfuscate-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/81009
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-26 13:00:33 +00:00
Aart Bik 74d058ef1b [vm/sdk] add missing vm entry-point pragma
Rationale:
This makes File/Directory/Link's fromRawPath
equivalent again, and unblocks the pending
loop-based inlining heuristic.

Reverted CL because of this bug:
https://dart-review.googlesource.com/c/sdk/+/81335

https://github.com/dart-lang/sdk/issues/34473
https://github.com/dart-lang/sdk/issues/32167

Change-Id: I769a8365ea32d6f6830d0dd8ef97fc6c2467fb90
Reviewed-on: https://dart-review.googlesource.com/c/81460
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-10-25 21:10:03 +00:00
Nate Bosch 655310ddf2 Add ArgumentError.checkNotNull utility
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>
2018-10-24 23:34:15 +00:00
Lasse R.H. Nielsen d693742648 Specify for all literals whether the object overrides Object.==.
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>
2018-10-24 09:07:50 +00:00
Nate Bosch 03eafc0b2e Add fromEntries on HashMap and LinkedHashMap
Closes #34818

Change-Id: I77b117c16169a5c5bd5655e851256930a2ea5a28
Reviewed-on: https://dart-review.googlesource.com/c/81188
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-10-23 20:53:34 +00:00
Stephen Adams f0a116d339 [dart2js] Some tear-off cleanup
Replace jsArguments with isIntercepted

Change-Id: I440a86fb411d3e278fa60ed86e5d43c5efb79033
Reviewed-on: https://dart-review.googlesource.com/c/80721
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-10-19 02:37:49 +00:00
Alexander Aprelev a4a3f95748 Avoid using future closure in http connect.
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>
2018-10-18 17:11:17 +00:00
Dan Field 6e23c3b3cb Support SO_REUSEPORT and IP_MULTICAST_TTL for datagram sockets.
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>
2018-10-17 01:48:52 +00:00
Terry Lucas 490421d166 Fixed Service Workers and any Promise/Future API with a Dictionary parameter.
APIs in dart:html (that take a Dictionary) will receive a Dart Map parameter.  The Map parameter
must be converted to a Dictionary before passing to the browser's API.  Before this change,
any Promise/Future API with a Map/Dictionary parameter never called the Promise and didn't
return a Dart Future - now it does.

This caused a number of breaks especially in Service Workers (register, etc.).  Here is a
complete list of the fixed APIs:

BackgroundFetchManager
    Future<BackgroundFetchRegistration> fetch(String id, Object requests, [Map options])

CacheStorage
    Future match(/*RequestInfo*/ request, [Map options])

CanMakePayment
    Future<List<Client>> matchAll([Map options])

CookieStore
    Future getAll([Map options])
    Future set(String name, String value, [Map options])

CredentialsContainer
    Future get([Map options])
    Future create([Map options])

DirectoryEntry
    Future<Entry> _getDirectory(String path, {Map options})
    Future<Entry> _getFile(String path, {Map options})

ImageCapture
    Future setOptions(Map photoSettings)

MediaCapabilities
    Future<MediaCapabilitiesInfo> decodingInfo(Map configuration)
    Future<MediaCapabilitiesInfo> encodingInfo(Map configuration)

MediaStreamTrack
    Future applyConstraints([Map constraints])

Navigator
    Future requestKeyboardLock([List<String> keyCodes])
    Future requestMidiAccess([Map options])
    Future share([Map data])

OffscreenCanvas
    Future<Blob> convertToBlob([Map options])

PaymentInstruments
    Future set(String instrumentKey, Map details)

Permissions
    Future<PermissionStatus> query(Map permission)
    Future<PermissionStatus> request(Map permissions)
    Future<PermissionStatus> revoke(Map permission)

PushManager
    Future permissionState([Map options])
    Future<PushSubscription> subscribe([Map options])

RtcPeerConnection
    REMOVED:  Future createAnswer([options_OR_successCallback,
                                   RtcPeerConnectionErrorCallback failureCallback,
                                   Map mediaConstraints])
    REMOVED:  Future createOffer([options_OR_successCallback,
                                  RtcPeerConnectionErrorCallback failureCallback,
                                  Map rtcOfferOptions])
    REMOVED:  Future setLocalDescription(Map description, VoidCallback successCallback,
                                         [RtcPeerConnectionErrorCallback failureCallback])
    REMOVED:  Future setLocalDescription(Map description, VoidCallback successCallback,
                                         [RtcPeerConnectionErrorCallback failureCallback])
    Future<RtcSessionDescription> createAnswer([Map options])
    Future<RtcSessionDescription> createOffer([Map options])
    Future setLocalDescription(Map description)
    Future setRemoteDescription(Map description)

ServiceWorkerContainer
    Future<ServiceWorkerRegistration> register(String url, [Map options])

ServiceWorkerRegistration
    Future<List<Notification>> getNotifications([Map filter])
    Future showNotification(String title, [Map options])

VRDevice
    Future requestSession([Map options])
    Future supportsSession([Map options])

VRSession
    Future requestFrameOfReference(String type, [Map options])

Window
    Future fetch(/*RequestInfo*/ input, [Map init])

WorkerGlobalScope
    Future fetch(/*RequestInfo*/ input, [Map init])


In addition, exposed Service Worker "self" as a static getter named "instance".  The
instance is exposed on four different Service Worker classes and can throw a InstanceTypeError
if the instance isn't of the class expected (WorkerGlobalScope.instance will always work
and not throw):

*   SharedWorkerGlobalScope.instance
*   DedicatedWorkerGlobalScope.instance
*   ServiceWorkerGlobalScope.instance
*   WorkerGlobalScope.instance

R=vsm@google.com

Bug: #34202
Change-Id: I641ccbff7cc771465dd32c73db20eba5d6667939
Reviewed-on: https://dart-review.googlesource.com/c/74482
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-10-14 22:48:33 +00:00
Jonathan White aa9f0f911f Update stream.dart
Fixed a typo or 2. Ran the entire file through a basic spell check and it's good now

Closes #34773
https://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>
2018-10-12 16:46:35 +00:00
Peter von der Ahé 54ef78b7c5 Remove non-strong vm dill files from SDK
Change-Id: Ia9337ec090333902ea8fc2492f2ffdac1bcff2d1
Reviewed-on: https://dart-review.googlesource.com/c/79520
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-10-12 12:42:57 +00:00
Peter von der Ahé ddf67772bb Remove warning about inferring packages URI from dart2js
Change-Id: I37ee171b0359e1fa6720d7af9e403f4dfab76e9e
Reviewed-on: https://dart-review.googlesource.com/c/79480
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-10-12 07:37:23 +00:00
Stephen Adams bd223d0ec4 Add consistent_type_error_test
Change-Id: Ic48765468dcdd19371291a32514b9b04012a762a
Reviewed-on: https://dart-review.googlesource.com/c/79146
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-12 00:52:25 +00:00
Sigmund Cherem 9a6f811466 Report null error as a NoSuchMethodError
Change-Id: I04f978b99c75d0bba5128c07cdc56d9020529a5f
Reviewed-on: https://dart-review.googlesource.com/c/79085
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-10-10 20:07:44 +00:00
G?nter Z?chbauer 2da0b9f4f1 fix some typos
Closes #34738
https://github.com/dart-lang/sdk/pull/34738

GitOrigin-RevId: d211bbacfe65355cf7304c990ffb6c79d7a229cf
Change-Id: If690e6d378e543b300e1f6a353ceae73e39c29db
Reviewed-on: https://dart-review.googlesource.com/c/78900
Reviewed-by: Alexander Thomas <athom@google.com>
2018-10-10 19:15:30 +00:00