Commit Graph

410 Commits

Author SHA1 Message Date
Jenny Messerly 384678e4b3 port DDC's code_generator to Kernel
Change-Id: I2b6a5f56a69f5d3a965aefc3f8d4550d5940ac5a
Reviewed-on: https://dart-review.googlesource.com/17980
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-11-04 22:17:56 +00:00
Jenny Messerly f2478e5526 fix SDK for fuzzy arrows change to main function
Change-Id: I7b7d5b64c1694b0cd4d5b6d8b13231db236617cc
Reviewed-on: https://dart-review.googlesource.com/18688
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2017-11-04 08:20:24 +00:00
Lasse R.H. Nielsen adcb6a7399 Make main invocation not fail strong-mode type checking.
Bug: http://dartbug.com/31270
Change-Id: Id6ad2a429d5dc44b437a0fdd8fb4889d3dccf194
Reviewed-on: https://dart-review.googlesource.com/18480
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-03 16:06:00 +00:00
Jenny Messerly 1dfa9d2320 fix DDC SDK for Symbol.computeUnmangledName
Change-Id: I8b793744339dd934833f6188b5b8267d4dad1746
Reviewed-on: https://dart-review.googlesource.com/17864
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2017-11-01 20:38:06 +00:00
Jacob Richman 8b221d13a4 Fix ddc debugger_test Fix regression in custom formatters due to change in metadata signatures to use Object.__proto__ instead of a null __proto__.
Bug:
Change-Id: I68fdb980e777b7c3f335fd6b57181134e3159cc3
Reviewed-on: https://dart-review.googlesource.com/17060
Commit-Queue: Jacob Richman <jacobr@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2017-10-31 19:45:27 +00:00
Alan Knight dfcce6d012 Make trapRuntimeErrors false by default
Bug:
Change-Id: I4e631113b00d5c39feaee74f4895a2e1f75641d0
Reviewed-on: https://dart-review.googlesource.com/17620
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
2017-10-31 18:59:59 +00:00
Jenny Messerly 0aa6801f8a fix function type printing in DDC to match VM
Change-Id: I2e15d34c8a40d9ed86b44f5c3db7052fb7c8a783
Reviewed-on: https://dart-review.googlesource.com/14780
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-27 22:35:20 +00:00
Jenny Messerly 5a4100b595 add a workaround to async/await for DDC's ignore cast fail unsoundness
Change-Id: Ic5e58d31b6b5d46bf74a3c7363e19fca239cdc21
Reviewed-on: https://dart-review.googlesource.com/17040
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2017-10-27 20:12:39 +00:00
Jenny Messerly 77775c5292 Unroll mixins in DDC, so each mixin application is generated
This is for compatibility with Kernel, as well as fixing several bugs,
and generally being a more robust architecture.

This may also perform better than the current design.

Notable fixes include several issues around deferred classes.

Change-Id: I1b6f44ebdf6304b10b47d19026156a25e04146ef
Reviewed-on: https://dart-review.googlesource.com/16337
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-10-27 04:26:44 +00:00
Jenny Messerly 07f189703a Optimize DDC's async/await code to avoid unnecessary zone registration
Other improvements:
* avoids an extra intermediate future in `async`, and unnecessary type tests
* uses optimized type tests instead of older isSubtypeOf
* avoids an extra closure for async/async*
* avoids Function.apply for async/async*/sync*
* avoids an extra cosure for sync* if the arguments are not modified

Change-Id: I897708387fce59a97696f05b01cc668f1043fe5c
Reviewed-on: https://dart-review.googlesource.com/16332
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-10-27 01:07:04 +00:00
Jennifer Messerly 697e531c17 fix IdentityMap setter concurrent modification detection
Change-Id: Ib999210cf5709a4cef6a14a8d7fafe7b516f09c9
Reviewed-on: https://dart-review.googlesource.com/13641
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-13 20:57:24 +00:00
Zachary Anderson dcd275fa74 [dart:io] Begins work on mocking support
Change-Id: I770ed9485a934af07e570fbad3f3fb84ebef973d
Reviewed-on: https://dart-review.googlesource.com/3302
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-10-10 17:39:12 +00:00
Jennifer Messerly 32eb7e3612 fix #30944, mark specific nodes with source information
This change fixes bugs that users see when we mark declaration code,
while also reducing the source map size (improving startup & reducing
the load on devtools). The SDK source map is reduced by 41%.

Stack traces and stepping should be more accurate after this change, but
if we identify any node(s) that need different marking, we now have
the tools to refine it further.

Change-Id: Ie50c6aca873be7b7c0f7c238a9db2001acbceb5c
Reviewed-on: https://dart-review.googlesource.com/10210
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2017-10-10 03:40:40 +00:00
Vijay Menon 05619da8ea Optimize String.length
Change-Id: I7e8481c8822d170492112704e04b92b19d5e5f2e
Reviewed-on: https://dart-review.googlesource.com/12340
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-10-10 00:22:36 +00:00
Vijay Menon a7e5d104bf Fill array on allocation
Fixes #31002

Change-Id: Idaee4ca544e567b4239098c852a040128e6b5d82
Reviewed-on: https://dart-review.googlesource.com/11242
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-10-05 20:04:24 +00:00
Jennifer Messerly 3a79c35f3c optimize maps/sets in DDC, fixes #29865
- string/int keys use identity maps
- construct the correct type rather than relying on factory constructors when possible
- checks if key has identity semantics and use that when possible
- avoid helper calls/casts/etc in implementations
- use native ES6 Map/Set key order tracking
- optimized constructor for map literals
- fixes #30466, const maps are now canonicalized correctly

Change-Id: Id44acf3d9bf8cb153a4755aa28df08fe91bfc633
Reviewed-on: https://dart-review.googlesource.com/8167
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-04 19:04:27 +00:00
Jennifer Messerly 3a907e5cab add a script to build DDC's SDK to a dill file
Change-Id: I93f9d55bd99a3b98ee823c38255e9a8081954a4b
Reviewed-on: https://dart-review.googlesource.com/10213
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-03 20:27:12 +00:00
Jennifer Messerly 05ba807d43 fix #30925, optimize x is T when x is null
Change-Id: Id99a2ce821c49c4dcce098fe119aab63e916b3ab
Reviewed-on: https://dart-review.googlesource.com/9792
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-02 20:45:29 +00:00
Jennifer Messerly 9978b808b4 implement NoSuchMethodError.withInvocation in DDC
Change-Id: If51546abb290d2956bacce9b5ae5adf6f2ca2d11
Reviewed-on: https://dart-review.googlesource.com/9429
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-28 23:39:43 +00:00
Jennifer Messerly 749d298b6c fix extension member discovery in DDC
In particular, some types like the base/mixin classes for Map in dart:collection did not work correctly.
This also has cleanups/optimizations to how DDC registers signatures, partially addressing #30499
Also fixes #29897, const maps are now immutable in DDC.

Change-Id: Icfdc7921d255a58a9e13908cf800832f787314ee
Reviewed-on: https://dart-review.googlesource.com/7442
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-28 23:21:43 +00:00
Vijay Menon 84cde41da5 Add NoSuchMethodError.withInvocation to DDC patch
TBR-jmesserly@google.com

Change-Id: I7352d0caefe12f3d8a10d1383cfb2ec983b1051b
Reviewed-on: https://dart-review.googlesource.com/9368
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-28 22:27:22 +00:00
Jennifer Messerly a784320a99 fix #30852 - if static field init throws, it should return null after
Change-Id: Ibf273deee51be4b187dbb6d4d7f66dc35dd16fed
Reviewed-on: https://dart-review.googlesource.com/8240
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-28 18:07:58 +00:00
Vijay Menon 2ba49b4ac0 Utility for building / running on d8
Change-Id: I8ba4c7ce37d9a5fcf7742ecfdac4c0df48dc9497
Reviewed-on: https://dart-review.googlesource.com/7845
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-26 16:09:51 +00:00
Leaf Petersen e0c2e8191f Eliminate fuzzy arrow from conversions_dart2js.dart
Bug:
Change-Id: Ide970d2a5353e53af9f0a73748b12b2fb770ebcb
Reviewed-on: https://dart-review.googlesource.com/7941
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-26 10:37:48 +00:00
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
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
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
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 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
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 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
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
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
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
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
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
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
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