Commit Graph

1618 Commits

Author SHA1 Message Date
Zachary Anderson 2948f8c1b7 Reland: [dart:io] Moves Http code into a separate library.
This moves Http code into dart:_http. dart:io then imports and
re-exports dart:_http. This is the first stage of moving
dart:_http into its own pub package.

This CL was reverted due to a failure in the Flutter engine build
which happened due to an incomplete change in gen_snapshot.cc, and to
update sdk/lib/libraries.yaml and sdk/lib/libraries.json

Change-Id: Ie90c77ef631aea7a163774b58e8ccbaf71a24d3c
Reviewed-on: https://dart-review.googlesource.com/7588
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-21 19:21:25 +00:00
Vijay Menon d8083faecc Regen DDC SDK
TBR=jmesserly@google.com

Bug:
Change-Id: Icecb6576b4f5c70fdcfb0e220543a96e3621da92
Reviewed-on: https://dart-review.googlesource.com/7580
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-09-21 17:18:02 +00:00
Zach Anderson 64bf1b49b0 Revert "[dart:io] Moves Http code into a separate library."
Reverting for broken Flutter build and kernel platform compilation test. It looks like the new _http library is missing from various snapshots. Not sure why this didn't fail locally.

This reverts commit ac9ff3f3af.

Change-Id: I7fbc2f842cf1380793e7af9fb869cacd14682885
Reviewed-on: https://dart-review.googlesource.com/7600
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-21 15:57:59 +00:00
Zachary Anderson ac9ff3f3af [dart:io] Moves Http code into a separate library.
This moves Http code into dart:_http. dart:io then imports and
re-exports dart:_http. This is the first stage of moving
dart:_http into its own pub package.

Change-Id: Icd33232a97b3d75511ef7ec88b01fd47cdcf5a23
Reviewed-on: https://dart-review.googlesource.com/6420
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-09-21 15:10:22 +00:00
Vijay Menon 8470c871d6 Enable polyfill in d8 modules
This enables running benchmarks (e.g., DeltaBlue) on d8.  d8 tip (with
es6 modules) appears quite a bit faster than the latest dev nodejs (with common modules).

Change-Id: Iedcc97fac57c48b925ae7c1b6cba4bbedeba4d0b
Reviewed-on: https://dart-review.googlesource.com/7443
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-20 22:47:21 +00:00
Jennifer Messerly 3224db05be fix #30792 -- fix variables shadowing parameters in an async function
Change-Id: I40667f607450af8695aafc613358d401cd395af2
Reviewed-on: https://dart-review.googlesource.com/7042
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-20 20:09:25 +00:00
Florian Loitsch 38bf70d7ac Use generic functions in zones.
Migrated from https://chromiumcodereview.appspot.com/2893893002/

Change-Id: I0bd6dc1438eb1e6762e7760a08b5a760b07d4b10
Reviewed-on: https://dart-review.googlesource.com/4942
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-09-20 15:46:06 +00:00
Ryan Macnak 3d21a46b72 Limit preserialized JSON for timeline events from Dart code to the arguments.
Avoids string copies in C++ and map copies in Dart.

Also remove some vestiages of removed feature that allowed an embedder to add pre-encoded events to the timeline.

Change-Id: I962a67093ba461c991d9169b0391c44af1d489db
Bug: https://github.com/dart-lang/sdk/issues/30787
Reviewed-on: https://dart-review.googlesource.com/6762
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-19 23:29:55 +00:00
Vijay Menon 6ce85d5f99 Revert "Remove support for functions in asserts in DDC."
This reverts commit 8140e1db64.

Change-Id: If505903ba475324392d6c6bcdae3392f523aadc8
Reviewed-on: https://dart-review.googlesource.com/7107
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-09-19 21:46:13 +00:00
Gary Roumanis 07e9cfedad Load exception event
Dispatch load exception so that others can react without capturing the corresponding error. Will be used in conjunction with https://github.com/dart-lang/test/pull/682

Bug:
Change-Id: I19458ac01ba013cac6ad5408b3b763777e50ca4e
Reviewed-on: https://dart-review.googlesource.com/6644
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Gary Roumanis <grouma@google.com>
2017-09-18 19:12:52 +00:00
Bob Nystrom 8140e1db64 Remove support for functions in asserts in DDC.
These are not supported in Dart 2.0:

https://github.com/dart-lang/sdk/issues/30326
Change-Id: I2e177a647c43af2bf7f37ff382234b12b8c2286c
Reviewed-on: https://dart-review.googlesource.com/4182
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-15 23:37:06 +00:00
Jennifer Messerly 67b9d3b9f9 fix metadata reflection for fields
Change-Id: I25d69eea235b0824c49320212706e66945480034
Reviewed-on: https://dart-review.googlesource.com/6024
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
2017-09-15 00:08:17 +00:00
Jennifer Messerly 5522bb1aa9 fix #29004, unify compiler code for emitting classes
Change-Id: If3a58d364f8f125a3bc1ab5e1fc47c6b43328637
Reviewed-on: https://dart-review.googlesource.com/5140
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-13 21:05:06 +00:00
Jennifer Messerly 67f82b4eee optimize == in some more cases
Change-Id: Icdda25e85c8d3ab3805c7f0ab180c6e88e47f8ed
Reviewed-on: https://dart-review.googlesource.com/4580
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-13 02:02:41 +00:00
Jennifer Messerly e14b589991 fix #30636, improve stack trace for anon closures variable declarations
Change-Id: I193c6cca765821193cdcaa62ddfbf961f1333428
Reviewed-on: https://dart-review.googlesource.com/4183
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-13 00:19:02 +00:00
Harry Terkelsen b7666dd327 dart2js: Remove lookup map support
Change-Id: Id435dc0f54165285c0d291d2e1c984da92bfd22a
Reviewed-on: https://dart-review.googlesource.com/5284
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-09-12 20:16:12 +00:00
Vijay Menon d5c913ef95 Fix null analysis on constants with unknown value
Terry is landing the test for this.  We were throwing on this:

  const u4 = const String.fromEnvironment("XXXXX");

  void main() {
    print(u4.toString());
  }

Change-Id: I5ad158978ce9a19c2d5a3b65a39beae1676fe7b1
Reviewed-on: https://dart-review.googlesource.com/5042
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2017-09-11 22:28:53 +00:00
Vijay Menon f95daf6168 Fix DDC stack trace mapping
This supersedes https://dart-review.googlesource.com/c/sdk/+/4614.

Patch 1 is the unmodified source_map_stack_trace.dart. Patch 2 is my fixes for DDC.

Change-Id: I30c6fad4bdc75061edbacc5fc75482af98e29bbb
Reviewed-on: https://dart-review.googlesource.com/4960
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-09-11 21:52:41 +00:00
Jennifer Messerly dc81668848 fix #30659, type tests in enums
Change-Id: I9cecc2a90889276af3cf75b6fa7a1b8f79778167
Reviewed-on: https://dart-review.googlesource.com/4609
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-08 22:47:16 +00:00
Leaf Petersen b78fea7129 Restore subtyping between Dart classes and anonymous JS classes
Bug:
Change-Id: I9e7e78d1f309fb814644245d6fd281d3b9110589
Reviewed-on: https://dart-review.googlesource.com/4160
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-07 23:56:38 +00:00
Jennifer Messerly afe4e6c7af fix tearoff equality against null
Two different optimizations conflicted (in the SDK, == methods must take care to consider a null value, but at the same time tearoff == was optimized), so it fixes that. Also adds a test for this.

Change-Id: I3d6fef7cae9df2fcbb9c276ae4e48490fd62eabb
Reviewed-on: https://dart-review.googlesource.com/4180
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-09-07 22:49:52 +00:00
Jennifer Messerly b075ae01ca fix #30640, give names to async/async*/sync* functions
this will help stack traces

Change-Id: I76a26f87f7690a1a97f3bc40721240232550ed3f
Reviewed-on: https://dart-review.googlesource.com/4121
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-07 20:28:23 +00:00
Jennifer Messerly 1e9c2e109b fix #30634, optimize generic functions in DDC
this removes the extra closure that is unnecessary

Change-Id: I1f1a6c1e7fd378bd8dc4807c8ce77968b1e94319
Reviewed-on: https://dart-review.googlesource.com/3745
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-07 18:04:24 +00:00
Vijay Menon a068f82684 Bump stack trace limit
Change-Id: I509832879681f39f2592180166e53070eb6f8ae9
Reviewed-on: https://dart-review.googlesource.com/4060
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-09-07 16:31:34 +00:00
Jennifer Messerly ab226fd40c optimize Object members in DDC
This should improve performance of these members in most cases:
- toString
- operator ==
- hashCode
- runtimeType
- noSuchMethod

The helpers for checking `null` and then dispatching to the method are now very small again. Also, because we can lookup symbolized names always, we can start taking advantage of this in our Map/Set implementations (for a follow up CL).

This also improves correctness of these helpers given JavaScript objects; we were previously falling back to calling a Dart method name like `.hashCode`, which is incorrect (except for `toString` where fallback is probably the correct behavior).

Change-Id: I39cbc80ca3e93ca7672652610b02bce899894da1
Reviewed-on: https://dart-review.googlesource.com/3427
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-09-06 08:12:11 +00:00
Vijay Menon beddf07fdc Refresh DDC SDK
TBR=jmesserly@google.com

Change-Id: I8d1ba8fafadc1d519c511187a36429088e3ce8d1
Reviewed-on: https://dart-review.googlesource.com/3405
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-06 00:10:28 +00:00
Jennifer Messerly 0d8d1af67f fix #30601, covariant checks for bounds were not working in some cases
This has a few related fixes:

fix #30461, DDC now generates covariant checks for superclasses with the correct substitution.

fix #29483, Analyzer can resolve the function type literal syntax correctly when used in type bounds and type arguments.

fix #30095, replace use of DDC's StrongModeError private type with TypeError.

It also has some refactoring to simplify how DDC emits the initialization code at the start of function/method bodies. We no longer jump through AST parent pointers.

Change-Id: I7001f98cd0e00299d77bace49e19aca305abf224
Reviewed-on: https://dart-review.googlesource.com/3100
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-09-05 22:44:19 +00:00
Zachary Anderson e2bce948ed [dart:io] Adds Platform.operatingSystemVersion
fixes #30018

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/3006873002 .
2017-09-01 22:08:48 -07:00
Vijay Menon 0999bffd39 Fix DDC SDK gen
TBR=terry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3011823003 .
2017-09-01 13:31:10 -07:00
Jennifer Messerly 7d142f6033 fix missing SDK symbols
in particular, this fixes the bug that `dartx.noSuchMethod` resulted in undefined

R=leafp@google.com

Review-Url: https://codereview.chromium.org/3010873002 .
2017-09-01 13:13:36 -07:00
Terry Lucas 0585e74b63 Fixed analyzer test to use dart2js not dartium
R=paulberry@google.com

Committed: https://github.com/dart-lang/sdk/commit/704de3bb3e27313c0eb6eb5ebc03173a5396dd1e
Review-Url: https://codereview.chromium.org/3004153002 .
2017-09-01 09:03:16 -07:00
Janice Collins 51cc9689b3 Remove corelib and corelib_strong and migrate last two remaining tests.
This includes a migration of linked_hash_map_from_iterable_test and
stacktrace_current_test, which were migrated without changes.

BUG=
R=rnystrom@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/3004073002 .
2017-09-01 08:11:15 -07:00
William Hesse a8cab7a205 Revert "Removed Dartium SDK libs"
This reverts commit 4a58918382.
That commit seems to have broken docgen on the html libraries.

BUG=
TBR=terry@google.com

Review-Url: https://codereview.chromium.org/3004173002 .
2017-09-01 00:47:57 +02:00
Jennifer Messerly c1e58bfb69 fix #30591, ensure all extension methods are generated
R=leafp@google.com

Review-Url: https://codereview.chromium.org/3011763002 .
2017-08-31 14:19:52 -07:00
Vijay Menon e96be63fd5 Fix ddc build_sdk step
R=leafp@google.com

Review-Url: https://codereview.chromium.org/3011753002 .
2017-08-31 13:53:18 -07:00
Leaf Petersen 1c94f7a604 Reland and refactor fuzzy arrow hints.
This restores the functionality from https://codereview.chromium.org/3012593002/, with some small refactors.

The test breakage that caused the revert is fixed in https://codereview.chromium.org/3004143002/ .

Also adds a couple of drive by fuzzy arrow fixes.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/3006893002 .
2017-08-31 12:18:51 -07:00
Terry Lucas 4a58918382 Removed Dartium SDK libs
First stage remove the libraries that are no longer part of 1.25 and beyond.

R=alanknight@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/a18908461adc431af2ee0114ed5ea9ef781bfb67
Committed: https://github.com/dart-lang/sdk/commit/d96561af083777ac9529c75ae05b6e89f8f06a6c
Review-Url: https://codereview.chromium.org/3008563002 .
2017-08-31 07:17:23 -07:00
Terry Lucas f1269525a8 Revert: Removed Dartium SDK libs
Review-Url: https://codereview.chromium.org/3005913003 .
2017-08-30 20:47:07 -07:00
Terry Lucas d96561af08 Removed Dartium SDK libs
First stage remove the libraries that are no longer part of 1.25 and beyond.

R=alanknight@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/a18908461adc431af2ee0114ed5ea9ef781bfb67
Review-Url: https://codereview.chromium.org/3008563002 .
2017-08-30 20:07:15 -07:00
Leaf Petersen f606e559c5 Avoid relying on fuzzy arrow for arity check in _FutureListener
BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/3009893002 .
2017-08-30 14:18:52 -07:00
Leaf Petersen f185689873 Regen SDK.
No source changes, just a regen of dart_sdk.js since it seems to be
out of date.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/3011673002 .
2017-08-30 14:03:28 -07:00
Zachary Anderson d0295c873c [dart:io] Namespaces for file IO
Fuchsia requires the ability to sandbox Isolates w.r.t. file IO.
When a new Isolate starts, Fuchsia will pass the Isolate an object
called a namespace. We can translate the namespace object into a
file descriptor suitable for passing to the *at() family of
POSIX file system calls. The file system calls will then
have visibility only into the specified namespace.

We also plumb Namespaces through on all the other platforms as well to
make the change easier to test and so that in the future we can
implement e.g. per-isolate cwds.

This change adds a new internal class to dart:io called _Namespace,
which is implemented in a patch file. See:

sdk/lib/io/namespace_impl.dart
runtime/bin/namespace_patch.dart

The embedder can set up a non-default namespace by calling
_Namespace._setupNamespace during Isolate setup.

Instances of _Namespace have a native field that holds a pointer
to a native Namespace object. See:

runtime/bin/namespace.h

Calls from e.g. file_impl.dart are now also passed a
_Namespace object. The implementations in e.g. file.cc and
file_linux.cc then extract the namespace, and use it to compute a
file descriptor and path suitable for passing to e.g. openat().

related US-313

R=asiva@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/3007703002 .
2017-08-30 09:34:36 -07:00
Jennifer Messerly 353583fb10 fix how DDC finds its undefined constant
R=vsm@google.com

Review-Url: https://codereview.chromium.org/3009733002 .
2017-08-29 14:16:39 -07:00
Leaf Petersen bdfc674a54 SDK core library fuzzy arrow fixes.
Fix a couple of places in the core libraries that were relying on
fuzzy arrow (lack of) checking.

BUG=
R=lrn@google.com

Review-Url: https://codereview.chromium.org/3005653002 .
2017-08-29 14:03:38 -07:00
Terry Lucas 05ca90aa8c Removed Dartium test exceptions
R=alanknight@google.com

Committed: https://github.com/dart-lang/sdk/commit/84f079f24c75aec51a53c17f1ebe0027b2adbb0c
Review-Url: https://codereview.chromium.org/2983033002 .
2017-08-29 07:15:06 -07:00
Terry Lucas a18908461a Removed Dartium SDK libs
First stage remove the libraries that are no longer part of 1.25 and beyond.

R=alanknight@google.com

Review-Url: https://codereview.chromium.org/3008563002 .
2017-08-29 06:38:53 -07:00
Lasse R.H. Nielsen c8b6c19314 Revert "Add ticks counter to Timer."
Tests broken in DDC

Review-Url: https://codereview.chromium.org/3011503002 .
2017-08-28 13:14:09 +02:00
Lasse R.H. Nielsen 39c8f64ea3 Add ticks counter to Timer.
Avoid VM scheduling multiple timer events if it gets delayed. This doesn't
scale for processes that are suspended for extended amounts of time.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/3003853002 .
2017-08-28 12:57:45 +02:00
Jennifer Messerly 673af70fe1 restore FutureOr cast failure ignore
R=vsm@google.com

Review-Url: https://codereview.chromium.org/3003943002 .
2017-08-25 18:53:34 -07:00
Jennifer Messerly 4466c461f0 optimize extension member symbols in DDC, issue #30531
This approach preserves our current semantics. There's room for further optimizations, though, as it's still not as fast as string names

R=vsm@google.com

Review-Url: https://codereview.chromium.org/3002393002 .
2017-08-25 18:36:41 -07:00