Commit graph

8235 commits

Author SHA1 Message Date
Jingjie Y. ??? 88127f10e4 Clean up num#toStringAsPrecision docs
Closes #32895
https://github.com/dart-lang/sdk/pull/32895

GitOrigin-RevId: a628456dcaebb200a2f1e3022169197a6b7d1248
Change-Id: I8bc0edb17d6aa713717954a5e592e64805246574
Reviewed-on: https://dart-review.googlesource.com/51280
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-05-30 13:38:18 +00:00
Ryan Macnak c30af41b96 Reapply "[mirrors] Add IsolateMirror.loadUri."
- Forward only kImportTag requests to DFE. This restores the current handling of a kScriptTag request when loading the kernel isolate in the simulators.
 - Mark dynamic_load_test as failing in the reload stress tests (reload fails to preserve library identity).

Change-Id: Ibe6f0a3505b99736a38d566abf3b2151505d7a7e
Reviewed-on: https://dart-review.googlesource.com/56706
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-05-29 22:01:01 +00:00
Johnni Winther 6b7f3d5f54 Share non-generic signatures through init.types
Change-Id: Ie132bbe805780022c91e5578c8dc4636c3c4cc8b
Reviewed-on: https://dart-review.googlesource.com/56671
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-28 07:40:24 +00:00
Ryan Macnak de545b4079 Revert "[mirrors] Add IsolateMirror.loadUri."
This reverts commit ad4cfa0260.

Reason for revert: Assertion failures on DBC

Original change's description:
> [mirrors] Add IsolateMirror.loadUri.
> 
> This allows a programmer to dynamically load code into an isolate. The closest existing API is Isolate.spawnUri, but communication with the dynamically loaded code in that case is limited to asynchronous message passing of JSON-like objects.
> 
> Change-Id: Icb23e9dacfb0035622c119f11d4e0f892ba2ccd1
> Reviewed-on: https://dart-review.googlesource.com/45363
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=rmacnak@google.com,zra@google.com,asiva@google.com,kmillikin@google.com

Change-Id: I80669188b9f40b3b527e8e268ade0d0d514a8753
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/56640
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-24 20:03:40 +00:00
Ryan Macnak ad4cfa0260 [mirrors] Add IsolateMirror.loadUri.
This allows a programmer to dynamically load code into an isolate. The closest existing API is Isolate.spawnUri, but communication with the dynamically loaded code in that case is limited to asynchronous message passing of JSON-like objects.

Change-Id: Icb23e9dacfb0035622c119f11d4e0f892ba2ccd1
Reviewed-on: https://dart-review.googlesource.com/45363
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-24 17:07:15 +00:00
Ben Konyi 3ab7cf0590 Revert "[dart:io] Revert recent non-utf8 path handling"
This reverts commit 42bcdcd332.

Change-Id: I11fb7db2aac3b7dc15cb35a22fea38b31069cbc0
Reviewed-on: https://dart-review.googlesource.com/55502
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-05-23 21:01:44 +00:00
Terry Lucas cf87b84f7d Support Promise to Future for both DDC and dart2js.
APIs in the newer Chrome IDLs support more JS style promises. The Dart web libraries now hookup those promises and return a Dart Future.
Additionally, a new type maplike is exposed in the IDL this is exposed too.

Change-Id: I44175877eb95f4d910586d42c0139fb182483f82
Reviewed-on: https://dart-review.googlesource.com/49800
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-23 04:08:14 +00:00
Stephen Adams 3ccd5a06f5 [js_runtime] Fix for 'o is FutureOr<T>' with function type T
Change-Id: I0533d565f7edf87ea9ac45e56e1e192658ec5849
Reviewed-on: https://dart-review.googlesource.com/55982
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-22 16:43:54 +00:00
Leaf Petersen 580e486386 Make CastStreamSubscription.onData handle a null callback
Fixes #33166

Change-Id: I52e8bcb6c782c84e8a474b0fc40ada24f31bf602
Reviewed-on: https://dart-review.googlesource.com/55984
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-05-22 16:24:57 +00:00
Zach Anderson e7495e427c [dart:io] Adds X509Certificate.der and X509Certificate.pem
fixes #33115

Change-Id: I7ccf5998b23e936040fe65792824f09d3f494cf7
Reviewed-on: https://dart-review.googlesource.com/55505
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2018-05-17 16:20:06 +00:00
Stephen Adams dc8e621451 [js_runtime] Avoid more casts
TBR=sigmund@google.com

Change-Id: I6400b13627c112a7a113350fdb9243353fcee6d3
Reviewed-on: https://dart-review.googlesource.com/55620
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-17 05:45:21 +00:00
Régis Crelier c60ea740cb [VM runtime] The 'checked' parameter of Isolate.spanwUri should control asserts
only, but not type checks in Dart2 strong mode (fixes #33120).

Change-Id: Ib8ca63aa3113b80243b6f8eb4015cb5c24140a88
Reviewed-on: https://dart-review.googlesource.com/55442
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-16 18:13:22 +00:00
Zach Anderson 42bcdcd332 [dart:io] Revert recent non-utf8 path handling
Reason for revert: Breaking API change blocks Flutter rolls. Reverting
to reconsider, work around, etc..

Revert "[ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used."

This reverts commit 916b9da48d.

Revert "[ VM ] Fixed tests for non-UTF8 paths on Windows / Macos."

This reverts commit 6327fe91c2.

Revert "[ VM ] Fix failing tests on Windows bots after non-UTF-8 paths change."

This reverts commit b51f4b7956.

Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS."

This reverts commit bcb36247d2.

Revert "Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS.""

This reverts commit 24450c79a5.

Change-Id: I756f74f4acdde168d0984fe130f05f9252366334
Reviewed-on: https://dart-review.googlesource.com/55441
Reviewed-by: Todd Volkert <tvolkert@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-05-16 15:47:10 +00:00
Johnni Winther 944ce140e2 Remove most imports of elements/elements.dart
Change-Id: I4ecd45286fab1171eab1e2d3d443a0441bbdc883
Reviewed-on: https://dart-review.googlesource.com/55180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Lasse R.H. Nielsen cdc520f459 Mark MirrorsUsed as deprecated.
Change-Id: I8e28f80581fdb22de5fd63d9a604252c95df14ee
Reviewed-on: https://dart-review.googlesource.com/55360
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Anders Sandholm <sandholm@google.com>
2018-05-16 09:51:18 +00:00
Lasse R.H. Nielsen bf77f064c1 Mark NoSuchMethodError constructor as deprecated.
Move implementation details into patch files, it does not belong in the interface.
Actually implement NoSuchMethod.withInvocation in dart2js.

Change-Id: I37049c258067b962d18eff42196e37aa127f0dea
Reviewed-on: https://dart-review.googlesource.com/55166
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-05-16 09:09:08 +00:00
Ben Konyi 916b9da48d [ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used.
Reland "Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String."

This reverts commit 4f549e2900.

Change-Id: Ia27c8c300beb178fa7b08ffe0bfcb2d61f65bbb5
Reviewed-on: https://dart-review.googlesource.com/55271
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-05-15 21:54:46 +00:00
Sigmund Cherem a06f7c9241 Remove dart:_isolate_helper.
The rest of the code was used in a single place, so I've moved the code to the
appropriate library.

Change-Id: Idd0416bf7365e3de05f20ab1184428ae7ae614b2
Reviewed-on: https://dart-review.googlesource.com/54745
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-15 00:21:28 +00:00
Stephen Adams b3649427bd js_runtime: avoid some implicit casts
Change-Id: I828d172db560f1a2ec8aefe7ea85980a50dee3aa
Reviewed-on: https://dart-review.googlesource.com/54746
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-14 23:53:37 +00:00
Ben Konyi 4f549e2900 Revert "Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String."
This reverts commit ba342a94ec.

Reason for revert: Bots are red.

Original change's description:
> Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String.
> 
> Continuation of PR #32583 by powdercloud
> 
> Fixes #29451
> 
> Change-Id: I4bdf24f9c8ead425a4f0cad33b642908f1ec203d
> Reviewed-on: https://dart-review.googlesource.com/51580
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,zra@google.com,tvolkert@google.com

Change-Id: I12850f178a13a75289d18af4e565bd73c59b14ad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/55060
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-05-14 23:40:29 +00:00
Ben Konyi ba342a94ec Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String.
Continuation of PR #32583 by powdercloud

Fixes #29451

Change-Id: I4bdf24f9c8ead425a4f0cad33b642908f1ec203d
Reviewed-on: https://dart-review.googlesource.com/51580
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-14 23:06:57 +00:00
Sigmund Cherem be77569d57 Remove old mirrors library now that the old-frontend is being deleted
Change-Id: Iea1cbb0c4422fa51e632ac03c9cd01e4916181fc
Reviewed-on: https://dart-review.googlesource.com/54744
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-14 21:38:07 +00:00
Sigmund Cherem 3c22fc9216 Allow null nonce
This should fix the bots for FF and safari.  (Chrome returns '', but FF and
Safari return a null value.)

TBR=sra@google.com

Change-Id: I9a402d3c9f4fed09b9181a8ec29f68ff6770e509
Reviewed-on: https://dart-review.googlesource.com/54714
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-11 20:41:59 +00:00
Sigmund Cherem c7683ad41b Support strict CSP in dart2js.
dart2js will now set the CSP nonce on scripts that are inserted for deferred
loads. Note that this change only applies to the default hunk loader. Custom
hooks need to set the nonce value manually.

Fixes https://github.com/dart-lang/sdk/issues/33061

Change-Id: I04abc7904dff22dad586690d175b87c77c3f1fe2
Reviewed-on: https://dart-review.googlesource.com/54702
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-11 17:41:07 +00:00
Stephen Adams ef6e19a83a [dart2js] Implementation of extractTypeVariables
Change-Id: I80272dade861e30440f64fe36c1bf4bb5cd2eb8a
Reviewed-on: https://dart-review.googlesource.com/54625
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-11 01:37:45 +00:00
Sigmund Cherem c25a9fd46b Remove support for dart:isolate in dart2js.
Change-Id: I1216a0ac91d8a1d13b441809596e1a8b5e51bb34
Reviewed-on: https://dart-review.googlesource.com/54526
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-10 01:20:17 +00:00
Adam Barth 779dc6eb85 Stop leaking file descriptors for HTTP clients
Previously, we would wait for a Future to terminate before destroying
the underlying raw socket. If that future never terminated, we would
leak the underlying file descriptor.

Now, the "force" codepath in close destroys the socket immediately
(similar to what it did previously for active sockets) and the non-force
codepath has a timeout, as requested by a TODO comment.

Change-Id: I021a93a40e4708ce93b4f1ae6c3f7289764bd69f
Reviewed-on: https://dart-review.googlesource.com/54442
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Adam Barth <abarth@google.com>
2018-05-09 21:33:09 +00:00
Zach Anderson 5afa2dca51 [dart:io] Fix ProcessStartMode.values
Change-Id: I1bdd98c7e86991e38d6bc7555620d784d595eb2d
Reviewed-on: https://dart-review.googlesource.com/54441
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-05-09 17:27:57 +00:00
Sigmund Cherem 3ec1b929e3 Remove dependencies on isolates.
This starts removing support for isolates. I've kept around the
isolate library for now, but I stopped injecting the isolate logic
unless you directly access an isolate API.

Concrete changes:

* Timer no longer uses the event queue: this was only used in worker
isolates, soon to be removed.

* Checking for whether the code is run within a worker is not dependent
   on initializing the isolates global state. This was important to allow
   deferred-loading to work without the isolate logic.

* Workers no longer track pending async calls correctly. This may make it possible
   to terminate worker isolates early, again this wont be relevant shortly.

Bug: https://github.com/dart-lang/sdk/issues/32684
Change-Id: I05025418e05c3641ba1a3bc34ea75ca558a28fbd
Reviewed-on: https://dart-review.googlesource.com/54160
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-09 16:36:26 +00:00
Lasse Reichstein Holst Nielsen 862a894de6 Make cast do the same things as retype.
Deprecate `retype` and forward it to `cast`.

Change-Id: Ie17ffdd1eef0d3f19582bf638c5349927c7b5ebd
Reviewed-on: https://dart-review.googlesource.com/53802
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-05-09 08:00:08 +00:00
Zach Anderson ac6ea06fd2 [dart:io] Switch ProcessStartMode back to an enum
Switching ProcessStartMode back to an enum due to problems with
package:process (https://github.com/google/process.dart/blob/master/lib/src/record_replay/run_manifest_entry.dart#L11)

Change-Id: I7db55a6a2107c9469d264e0539844363d729e0bf
Reviewed-on: https://dart-review.googlesource.com/54063
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-05-08 19:13:19 +00:00
Sigmund Cherem 410db09743 Do not convert the worker object in jsinterop, just like we do for window
This makes it possible to do:

  js.context['self'].addEventListener('message',
      allowInterop((e) => print('received')));

Change-Id: I202b6c881372a77c0ec41dd334e9aa76286d7796
Reviewed-on: https://dart-review.googlesource.com/54068
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-07 21:10:43 +00:00
Sigmund Cherem 5618373690 Copy timers to jsshell.js preamble
We should work on merging d8.js and this file, since they are almost identical.

Closes #7728

Change-Id: I4f754a4f59ad3b498eba7658d38cecc617bf784d
Reviewed-on: https://dart-review.googlesource.com/53860
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-05 01:02:56 +00:00
Devon Carew 5904247715 Fix a typo in socket.dart.
Change-Id: I92031ce05fde7b5292df8b0f32fe4fbe77d80923
Reviewed-on: https://dart-review.googlesource.com/53721
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-04 17:00:26 +00:00
Zach Anderson afb490adbc [dart:io] Provide modern Dart-styled constants
This CL updates dart:io but not dart:_http. It updates the sdk sources,
the patch files, and tests.

Change-Id: I64c3da407f09fa2bc6eec582049c4ae3a8afbe6d
Reviewed-on: https://dart-review.googlesource.com/52990
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-05-03 17:00:14 +00:00
Johnni Winther d13bf49870 Check type-variable bounds on generic methods
Closes #32711

Change-Id: I86c123f5a8b9eda393b276248cdd27d1b109354b
Reviewed-on: https://dart-review.googlesource.com/53201
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-03 09:36:58 +00:00
Johnni Winther 54b8ebd992 Support js-interop classes that implement generic types in Dart 2
This adds a special RTI representation for a type argument of a
(supertype of a) js-interop class, which effectively is the Dart 1
`dynamic` type.

Closes #32969

Change-Id: Ifd92b3fc6779d96d354ad929bd7c07a349299ae6
Reviewed-on: https://dart-review.googlesource.com/53002
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 08:37:11 +00:00
Stephen Adams d6a3b85ed2 Use factory methods for async/sync*/async* transforms
The static methods allow type parameters to be registered,
but this means that the type parameters will be dropped unless in strong mode.

Change-Id: I91c1977c287c14742df7d59b988e64ddc46f794d
Reviewed-on: https://dart-review.googlesource.com/52870
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-30 22:32:56 +00:00
Sigmund Cherem 004ee9cd12 Fix how we use Comparable.compare, so we have a function with the appropriate type in JSArray.sort
This is the same fix that was done here: https://github.com/dart-lang/sdk/blob/master/sdk/lib/collection/list.dart#L349

Change-Id: I6013dc96c67b487b0e96118028ef920a84f371b5
Reviewed-on: https://dart-review.googlesource.com/52701
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-26 00:32:02 +00:00
Keerti Parthasarathy 9eb09d825b Revert "Create _nullFuture and _falseFuture in the root zone."
This reverts commit 9bb085a1c6 due to
test failure in google3.

Change-Id: I63940e62bd97c83bc432db99b44c991e6c1e025e
Reviewed-on: https://dart-review.googlesource.com/52422
Reviewed-by: Dan Grove <dgrove@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2018-04-24 20:45:38 +00:00
Stephen Adams 42b5affddc js_runtime: recover sync* performance in strong mode
Put in types to avoid some implicit downcasts in _SyncStarIterator.

Change-Id: I0b04a20ccc84e20f95469a0515a054caf4cf4b34
Reviewed-on: https://dart-review.googlesource.com/52420
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-24 17:20:17 +00:00
Stephen Adams 81d779c41b Redo "Pass type argument into rewritten marked function"
TBR=sigmund@google.com

Change-Id: I0999ab52f76da185c601ce7105e4a8491c5e4edf
Reviewed-on: https://dart-review.googlesource.com/52262
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-21 01:14:49 +00:00
Johnni Winther be47fa67aa Fix dart2js subtyping
A<dynamic> is _not_ a subtype of A<int> in Dart 2

Change-Id: I0d1185b38192a06aaf9d8622a78c7384dfc287dc
Reviewed-on: https://dart-review.googlesource.com/52106
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-20 21:44:09 +00:00
Stephen Adams a5ea3c5e33 Revert "Pass type argument into rewritten marked function"
This reverts commit 25b3dbb7b3.

TBR=sigmund@google.com

Change-Id: If0e37738e1516efcb144bffbaf57cfc7d3028d13
Reviewed-on: https://dart-review.googlesource.com/52261
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-20 19:30:14 +00:00
Stephen Adams 25b3dbb7b3 Pass type argument into rewritten marked function
The values returned from calling sync*, async and async* are now parameterised.
Simple cases where the type has no type parameters are handled.

The next step is to introduce a signature-like j-model entity to compute the type in more complex cases.


Change-Id: I2e43088cc6383a70e3a3d3067ec7542694ee2d0a
Reviewed-on: https://dart-review.googlesource.com/51421
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-20 18:41:59 +00:00
Lasse R.H. Nielsen 973a1a0219 Remove uses of upper-case constants in remaining SDK code.
This includes Fasta, tools and observatory, so the checked-in SDK must
have the lower-case constants.

Change-Id: I8380ad041ad058f7d02ae19caccfecd434d13d75
Reviewed-on: https://dart-review.googlesource.com/50201
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-16 16:11:57 +00:00
Stephen Adams b0fafbd1f4 Clean up js_runtime parse/tryParse methods
Change-Id: Ibbb79650053fb6777e1694f2540f21bf699d6b52
Reviewed-on: https://dart-review.googlesource.com/51044
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-12 21:23:56 +00:00
Lasse R.H. Nielsen 7cc4d76a30 Add tryParse alternatives to parseFunctions.
Deprecate `onError` arguments to parse methods.

Change-Id: Iac1d87416abc8a73ce1853edffab49df8a8cb5fe
Reviewed-on: https://dart-review.googlesource.com/50723
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-12 13:16:49 +00:00
Stephen Adams a90a74cfd8 JSArray strong mode performance fixes
Replace

      var element = JS('', '#[#]', this, i);

with

      var element = JS<E>('', '#[#]', this, i);

to ensure 'element' has the static type E.

I would prefer

      E element = JS('', '#[#]', this, i);

but that makes legacy checked mode insert unneeded type assertions.

Change-Id: I74446ca7bfa748490347100093a94b9191ca6821
Reviewed-on: https://dart-review.googlesource.com/50860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-11 21:58:39 +00:00
Stephen Adams cbdf102d0c Use interceptor for reading type arguments
Type arguments that require a subsitution need the interceptor to
access the substitution function.

- Add an interceptor input to HTypeInfoReadVariable
- Add an entry point getRuntimeTypeArgumentIntercepted that takes the interceptor.
- Optimize uses that do not need the interceptor.

The interceptor is cheap to get from the context in the common case
that the type variable access is directly in an instance method.

A typical use (broken)

    var t1 = H.getRuntimeTypeArgument(receiver, "ListMixin", 0);

becomes

    var t1 = H.getRuntimeTypeArgumentIntercepted(this, receiver, "ListMixin", 0);

Change-Id: I2abe6a2b6e8d2cdb0ede1b7248dd8337830f8a0c
Reviewed-on: https://dart-review.googlesource.com/50640
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-11 21:25:26 +00:00