Commit graph

9101 commits

Author SHA1 Message Date
Stephen Adams 964c9d8c20 [dart2js] new-rti: debug print of named type variable miss
Change-Id: Ib344442c1dc15136408df761852e901abf4b80c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127221
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-12-09 23:20:33 +00:00
Nicholas Shahan 2015c55277 [dartdevc] Remove ability to run analyzer based DDC
This is the first step in deleting legacy DDC!
* Default all invocations of DDC to run the kernel version.
* Disable all tests that run analyzer DDC.
* Detect the most likely case when invoked with an analyzer
  summary and print instruction to update build_web_compilers
  dependency.

I will follow up with deletions, and a rename of the test configurations/
builders to reclaim the names (ddc vs ddk, dartdevc vs dartdevk).

Issue #38777

Change-Id: I1477f0274b6b7f345a5e19d2b3f93797c454a09e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127067
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-09 22:11:22 +00:00
Régis Crelier b37f391f34 [VM/nnbd] Make runtimeType return a non-nullable type when the NNBD experiment is enabled.
The nullability of runtimeType must be consistent with the nullability of
a class DeclarationType. Currently, it is always kLegacy. However, this
needs to be set to kNonNullable when the NNBD experiment is enabled.
Note that the nullability of the null instance remains kNullable.

Change-Id: I4ba974c2551c3a7fbd190b02175804090f9b48b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125721
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-12-09 18:27:04 +00:00
Régis Crelier 8894b88467 [VM/nnbd] Implement syntactic type equality.
Legacy types are considered equal to their non-nullable variant.
Type hash is modified to be consistent with the new definition.

Change-Id: If90f7f13cf77e519d5b90b57d9dbf4988f71be13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126283
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-12-09 18:18:59 +00:00
Ben Konyi 16e7647c86 [ VM / dart:typed_data ] Fixed issue where null could be passed for simd types in AOT
Arguments to simd type constructors were being checked in the bootstrap
natives entrypoint but not elsewhere. Checking for null in Dart code
ensures that we don't accidentally miss these checks in AOT.

The changes to sdk_nnbd are required in order to ensure the number of
arguments passed to native code match the number of arguments from the
non-NNBD implementation (we needed to remove the implicit type args
parameter).

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

Change-Id: Iaf7d8790c154f1e85db613b6dc84004c8013df9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126905
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-12-09 15:29:27 +00:00
Sigmund Cherem 16bc1806ea (html) remove type parameter from callback argument
This was a case missed when fixing #33891, and fixes #36798

Change-Id: I96e177a7d8020635e191d829afdec45f888658a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127500
Reviewed-by: Alan Knight <alanknight@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-12-06 19:02:02 +00:00
Jonas Termansen daa400bada [sdk] Fix all uses of the view() constructor to always use offsetInBytes.
The list being viewed can sometimes itself be a sublist view, but the
default view() constructor doesn't take that into account, and instead the
caller needs to be aware of the case. This change makes all such uses use
offsetInBytes, even in cases that's not needed, so it's trivial to audit
that it's always used correctly. In the cases it's not needed, it just gets
the value 0 and it's a no-operation. In the cases it's needed, it fixes a
bug, such as in _WebSocketProtocolTransformer.add().

Closes #39589

Change-Id: I6e9bd5510f48ce378bdec2c64b56fe789dfb27ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127165
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2019-12-06 10:37:00 +00:00
Kallen Tu e11cf75bd9 [dart2js] Propagate kernel variance to emit annotations in RTI table.
Change-Id: I4612c50828f5d85115e15838e2cc2117446b07ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127201
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-12-06 01:26:58 +00:00
asiva b99599bae1 More cleanup of the loader code.
Change-Id: I8ee048f2a06f8aa54cb5efb832740a53b2bd042d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127444
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-12-05 23:07:55 +00:00
asiva f7aff739bd Fix Isolate.packageRoot to account for the fact that it returns a Future.
Change-Id: If4b7c3a66aa3071beadf29a57ac84a8e2228ffb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127341
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-12-05 19:23:19 +00:00
asiva 5ff9a2ed37 Cleanup the loader code to remove some unused pieces.
Change-Id: I026b2b0dfb964c2dd67a9022260e4aba9c019e9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125444
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-12-05 02:44:18 +00:00
Alexander Markov f56b0f6907 [vm/aot/tfa] Whole-program constant propagation
Size:
flutter_gallery total size -2.48% (arm), -2.3% (arm64)
flutter_gallery instructions size -2.91% (arm), -2.77% (arm64)
velocity_tracker_bench total size -7.5% (arm), -7.1% (arm64)

Performance:
SkeletalAnimation +46.02% (Intel Core i5), +37.75% (Intel Xeon), +24.86% (arm), +39.75% (arm64).
FfiMemory.Pointer* +44-64% (x64)
FfiMemory.PointerPointer +436-465% (x64), +443% (arm64).

Issue: https://github.com/dart-lang/sdk/issues/37710

Change-Id: I6221bfa02b165ccc17d4ee8b857bb89212febaff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125936
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-12-04 19:19:29 +00:00
Martin Kustermann 1bbbc9f599 [vm/aot] Check in test to ensure in PRODUCT mode we don't retain any code in dart:vmservice_io/dart:_vmservice
The CL also updates a number of pragma annotations to be conditional on
non-product mode.

Change-Id: Ia00b5089d54bbb8f6f6006ef67d65859ab56c132
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127004
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-12-04 15:30:58 +00:00
Clement Skau f9327d3bac [SDK] Adds --lazy-async-stack support for async*.
Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I53cd334243649901ea8e0f9799d9f41c126e3627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126729
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-04 12:47:48 +00:00
Nicholas Shahan 2a13b1fe26 Reland "[dartdevc] Break dart:_debugger dependency on dart:html"
Original change was broken by the fact that DDC expects all types marked as
native have all their superclasses marked as native when the super classes are
compiled.

In this case `MapMixin` from dart:collection was not being marked as native and
the only reason it was working before was that the library dependency enforced
the necessary order.

* Now `MapMixin` is explicitly marked as native.
* Added a test case to use some of the API on `window.localStorage` that is
  inherited from the MapMixin class.

Change-Id: I1584bfb86179016ee12c2acc5cfbbe81d086841e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126906
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-04 00:51:18 +00:00
Zichang Guo bf69257c5f [dart:io] socket profiler in dart:io
Add socket profiler functionality through service extension.

Change-Id: I717b72fbb1c53503dfb8fa08789417c18300565d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124582
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-12-02 19:11:18 +00:00
Lasse Reichstein Holst Nielsen 3f32196958 Make LateInitialziationError abstract and uninstantiable.
Change-Id: I82ad71f3db9a7c04d87cad62662760f1b104ad68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126733
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-12-02 15:03:37 +00:00
Johnni Winther 5013ce6e5d [cfe] Use correct types and errors in late lowering
Change-Id: I6e7dcbd96e151a69fc67a6cd5e5af1620760b02a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126647
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-12-02 15:00:18 +00:00
Kallen Tu 73fdf19b56 [dart2js] Add variance table to RTI and updated subtyping wrt variance.
Change-Id: Iac4c28d295e883997acdc2e6c7084739e60be9fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126403
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-11-27 18:45:25 +00:00
Ivan Inozemtsev 3e5ae6adaf Revert "[dartdevc] Break dart:_debugger dependency on dart:html"
This reverts commit 134e0e28cd.

Reason for revert: breaks internal tests

Original change's description:
> [dartdevc] Break dart:_debugger dependency on dart:html
> 
> Change-Id: I6b259429f3e78d0540147a8c99b9adbd026a8328
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126120
> Reviewed-by: Mark Zhou <markzipan@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

TBR=sigmund@google.com,alanknight@google.com,nshahan@google.com,markzipan@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ia785538a5e082a8da0857bd11d2c42061ec63d29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126500
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2019-11-27 10:38:10 +00:00
Clement Skau d5dbf10672 [SDK] Adds non-eager async stack frame collector.
This is done by collecting all frames on the current stack until an async/async* frame is hit
which has yielded before (i.e. is not in sync-async case).
From there on it finds the closure of the async/async* frame and starts traversing the listeners:
  while (closure != null) {
    yield_index = closure.context[Context::kAsyncJumpVarIndex]
    pc = closure.function.code.pc_descriptors.LookupPcFromYieldIndex(yield_index);
    <emit pc in frame>
    closure = closure.context[Context::kAsyncCompleterVarIndex]._future._resultOrListeners.callback;
  }

Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: I97030d22e529bf8a74ecd30a8a2589cfe57ad330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122644
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-26 11:51:27 +00:00
Nicholas Shahan 134e0e28cd [dartdevc] Break dart:_debugger dependency on dart:html
Change-Id: I6b259429f3e78d0540147a8c99b9adbd026a8328
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126120
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-25 17:55:55 +00:00
Sigmund Cherem 603fd7881f (ddc) Fix deps tracking for the ddc sdk.
The compile_platform template assumes that the output will be in the root-out-dir, and because of that the generated .deps file contains relative paths that only work if the output is in that folder.

It would be nice to fix compile_platform to be more flexible about this, but for now moving the output up fixes the issue that modifications in the sdk were not triggering a rebuild.

Change-Id: Ifc1e7adb23d6911a9f71c341b7968e0a9b1d4973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126122
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-23 00:21:58 +00:00
Vijay Menon 8295efc541 Revert "Revamp patch_sdk.dart mainly to use libraries.json."
This reverts commit 3c9e924073.

This CL was breaking the internal build.

Change-Id: Ic4e6df070f2a87ac88ef97f0e6b07d53c13ceadc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125925
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2019-11-21 14:36:55 +00:00
Sigmund Cherem 3c9e924073 Revamp patch_sdk.dart mainly to use libraries.json.
This will make it possible to use the script to create a patched sdk
for dart2js and the vm (some followup needed), which will be useful
to migrate their libraries to nnbd.

In the future, we should be able to leverage this new logic to
write tests that ensure our sdk is warning-free (there are > 80 real
warnings today even on the non-nnbd sdk)

In detail, this CL includes:

* loading the libraries data from libraries.json, this removes the need for a
   hand-crafted libraries.dart that replicates the data in libraries.json.

* auto-generates a libraries.dart in the patched sdk that can be used to run
 dartanalyzer or to compile an sdk with dartdevc-legacy.

* script simplifications in patch_sdk.dart
    * removed tracking of modification stamps. This didn't appeared to be
      used by the ninja rules. I believe it was used to reduce local
      iteration cycles when we were first developing the sdk itself.

    * use Uri directly instead of package:path - this simplifies things,
      especially since the libraries_specification is Uri-based as well.

    * switch to use package:args for parsing options

 * added an option to merge part files in a single file. I've noticed that the
 analyzer provides some false positive errors in part files, but once merged
 they are no longer shown. In particular, we are clearly hitting limitations of
 dartanalyzer on the patched sdk. At this time the old patch-script generated
 an sdk with 1500 warnings, this new script reduces it to 500 (not sure why),
 with merging of part files it goes down to 80.


Change-Id: I6bbaf92ef4554f00c8bf6b38d19bf79d44fb3e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-20 22:51:42 +00:00
Simon Lightfoot 867a6e0e52 [dart:core] Update DartTime.parse to support arbitrary precision fractional seconds.
Update DartTime.parse to support arbitrary precision fractional seconds. So it now conforms to ISO8901 and RFC3339 standards.

Closes #24205

Closes #39350
https://github.com/dart-lang/sdk/pull/39350

GitOrigin-RevId: 66f15b6e646a65b7955c7b617647b8edfd680481
Change-Id: Ife2211e6cce5922b59cdde0d30ed3ef887cffcf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124903
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2019-11-20 18:16:19 +00:00
Matthew Cliatt b188632458 Fix syntax error in Symbol doc example
Closes #39453
https://github.com/dart-lang/sdk/pull/39453

GitOrigin-RevId: c9c951d74eb12061421854b014a202086388b166
Change-Id: I77435339832e830fc62d0ca3d0cc51065daf67e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125722
Reviewed-by: Michael Thomsen <mit@google.com>
2019-11-20 11:40:05 +00:00
Michael Thomsen 61c453f0fe Hide dart:cli in api docs
This is experimental, and not ready for general consumption, so we shouldn't be advertizing it

Closes #39462
https://github.com/dart-lang/sdk/pull/39462

GitOrigin-RevId: f7c88230ed4dfea516ffd4d0ec280ab599f2512e
Change-Id: I9db6b20749911c9386a56419765143071c2697e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125800
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-11-20 11:32:01 +00:00
Kevin Moore 8342ec2c71 Fix pub.dev URLs throughout SDK repo
Change-Id: I5bcb7c40be12ee1dc887620281b4807469d67bbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125729
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2019-11-20 11:30:48 +00:00
Sigmund Cherem 19144db89f Use compile_platform to build the sdk.dill
This moves ddc to use the same logic to compile the sdk.dill as all other
backends. This will also enable us in a subsequent CL to generate the dart_sdk.js
files from a precompiled .dill file, and hence improve overall caching on local
rebuilds.


Change-Id: I02e178baa5497a5bee2de42e3423176ca97ceaef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125446
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-19 00:24:48 +00:00
Nicholas Shahan baa2d8125f [dartdevc] Cleanup dynamic calls and downcasts in _BigIntImpl
This is some preparation for the NNBD migration where the existing downcasts and
possible nullable accesses will be errors.

- Downcasts have been replaced with covariant parameters.
- Local variables have either been declared with a specific type or given
  initial values so that they can become non-nullable in the future.
- Remove a pointless `is! int` type check. The parameter is an int.

Change-Id: I3a0358d83a181eee5576c2062128d89d197ba3e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125303
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-19 00:16:43 +00:00
Ben Konyi cfd226a27f [ dart:http ] Fix issue where setting HttpClient.enableTimelineLogging wasn't actually enabling timeline logging
Change-Id: I12134eaf1cd79516376d266b9919535987f7703b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125565
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-11-18 22:17:55 +00:00
Lasse Reichstein Holst Nielsen 7b67303318 Make json.fuse(utf8) work correctly.
Change-Id: Ie4d5164759c1d4a8c19e216bfac50b116271f1a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125342
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-11-16 13:45:59 +00:00
Ben Konyi 1c12878d05 [ dart:io ] Added timeline events for HttpClient connections and requests
Setting the `enableTimelineLogging` property of `HttpClient` to true results in
timeline events being created for HTTP connections and HTTP requests.
Timeline events contain general connection information, including:
  - Request type
  - Status code
  - Request / response headers
  - Cookies
  - Non-sensitive proxy information
  - Relevent error messages for failed connections

Change-Id: Ibe16a312ab5398c9ae886ea07bea5ca70b63e440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-11-16 00:46:46 +00:00
Nicholas Shahan 6239777983 [dart2js] Fix a few missing and one unneeded covariants
Change-Id: Ic5fe4ec2230b233301c628fee8436471a0dbfdb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125445
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-16 00:08:06 +00:00
Sigmund Cherem a75ffc8956 Add non-NNBD language version marker to all sdk (non-nnbd) files
This is practically a copy of the change in
https://dart-review.googlesource.com/c/sdk/+/118040 but applied to the non-nnbd
sdk.

Even though there is no intent to run the non-nnbd sdk with the non-nullable
experiment, we need to add this annotation because of how we
intend to gradually start testing NNBD. The libraries.json under
sdk_nnbd is allowed to point to libraries under the non-nnbd sdk in order to
temporarily build without errors until all patch files are migrated and all CFE
issues are addressed.

Change-Id: I53c1123a8d86c10695832a8a0ad35adb7b4d92fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125181
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-11-15 00:22:47 +00:00
Nicholas Shahan e040b6edc1 [dart2js] Cleanup dynamic calls and downcasts in _BigIntImpl
This is some preparation for the NNBD migration where the existing downcasts and
possible nullable accesses will be errors.

- Downcasts have been replaced with covariant parameters.
- Local variables have either been declared with a specific type or given
  initial values so that they can become non-nullable in the future.

Change-Id: Ie871095ee26771833318d1dfce2b5986afaf8c69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125227
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-11-14 21:23:11 +00:00
Zichang Guo 4366afc6f5 [http] noFolding() should follow same check as add()
Walk through http headers class. Since http header uses case-insensitive headers, noFolding() implicitly assumes field name is lower-cases. It is used to compare to lower-cases field name. Validate the field name before it is stored and also add a test case for noFolding().

Change-Id: I58f8a0ed0d366281e1e7a8c60fd46ff81c8ee796
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121773
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-11-11 16:36:23 +00:00
Stephen Adams b334ea8320 [dart2js] new-rti: experiment - fault in '$is' test
Change-Id: Ie6d17e3439fb67fe79e9dec4dc7cb5437d1f6915
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121766
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-11-08 06:00:06 +00:00
Liam Appelbe 2ae9b6f653 [vm] Handle late fields with no initializer.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I23526e7e8cc5928c22c53414dd201c07199b9610
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124210
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-11-06 23:39:22 +00:00
Nicholas Shahan f6efefc09c [dartdevc] Move the custom type test logic to patch files
This unblocks changing this logic for NNBD since they are now forked.

The custom logic for FutureOr has been problematic to represent in the patch
files. They need to be callable from the class but they can't be static methods
in Dart because they reference the generic type argument. It is a design quirk
of the runtime representation that the type argument is captured in the wrapping
closure and in scope that allows the existing implementation to work.

In a future change I will thread an NNBD flag through the compiler to emit
different logic for the FutureOr type tests when running with NNBD.


Change-Id: I9463e3cd375f8098592ea84e956e833952f41bb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123921
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-06 22:09:31 +00:00
Ari Aye bdd9e74afc Only distribute a single libtensorflowlite_c per distribution
Bug: https://github.com/dart-lang/sdk/issues/38366
Change-Id: I856c2050adbd05737c21c78ad6face77dab029b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123552
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
2019-11-06 19:17:15 +00:00
Daco Harkes cfe29c45fd [doc/ffi] Update API docs message to be consistent with website
Change-Id: I3c2f74acffa542f9800cbd8da7159bdc8a298481
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124134
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-11-06 11:46:11 +00:00
Stephen Adams 54b324ca04 [dart2js] new-rti: Cache non-generic types on constructor
- Cache the Rti in a property on the constructor.

- Put the dodgy closure logic behind the cache to move the _isClosure
  test off the fast path.

- Allow different closure.runtimeType.toString() results. The old result is not
  worth preserving because it shows a 'type' that does not otherwise exist. The
  actual closure.toString() is still informative.

Change-Id: I7f30e5975ce289fa6b85a22c65f76e80055ef548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124021
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-11-04 22:58:35 +00:00
Derek Xu 6d28f59c54 Added promiseToFuture function to js_util.dart
Change-Id: I1bfd3fadb0a212ec0ff150cad02bdf285e2e7edb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122240
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2019-11-04 22:56:45 +00:00
Martin Kustermann ab5cf0f854 [vm] Ensure create_sdk GN build has working dart2native iff AOT is supported
This CL

   * adds a GN flag "include_dart2native" off by-default (switched on explicitly for our GN build)
   * ensures every GN build of the "create_sdk" target has a working dart2native (except ia32)
   * removes not-working dart2native script from ia32 dart-sdk (no AOT support in ia32)
   * removes the "dartaotruntime" GN target, since it is the same as "dart_precompiled_runtime"

This should ensure every downstream consumer of the "create_sdk" GN target will
have a working version of dart2native.

For the particular "dart-sdk" we create on dart-sdk-{linux,windows,mac}
we will override the default AOT compiler&runtime with the product mode,
which produces smaller AOT snapshots and has smaller AOT runtime (making
the native executables significantly smaller)

Change-Id: Ib5042589297cdb055c41dc56abdff86a4612ef5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123724
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
2019-11-04 12:01:56 +00:00
Nate Bosch 0f7b67477f Invalidate DDC library cache on trackLibraries
Since we cache everything on the first call to
`_computeLibraryMetadata`, if we haven't called `trackLibraries` for
some module before the first time we fetch libraries then it will never
be available.

Change-Id: If0c8d5835fb95e244797631d6452bd154eec30e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120936
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-10-31 19:46:10 +00:00
Martin Kustermann cdcc5282ea [vm] Add NativePort static extension to dart:ffi
This can be used in combination with `dart:ffi` to allow C code to post
messages asynchronously back to Dart.

Issue https://github.com/dart-lang/sdk/issues/38544

Change-Id: I0293337785a3555b4147e25f1a904f333da62c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118565
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-10-31 15:00:03 +00:00
Mayank Patke e2891ad8e3 [dart2js] New RTI: Support reification of erased types.
Change-Id: I351c8ab96c12f9acffefa26556897d195b3e7c17
Bug: https://github.com/dart-lang/sdk/issues/38949
Fixes: https://github.com/dart-lang/sdk/issues/38949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122026
Reviewed-by: Stephen Adams <sra@google.com>
2019-10-29 22:40:26 +00:00
Stephen Adams ea16e39e2f [dart2js] new-rti: defer selection of is-test specializations
Create Rti objects with an initial 'is' method that replaces the
'is' method with a specialization. This moves the specialization of
the 'is' method until the Rti is used in a test, which should slightly
reduce the Rti creation cost, and permit more ambitions specializations.

Also add specialization of checks for top types.

Change-Id: I4218a73f2916ddba23991d11db350ee4b36be354
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121860
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-10-29 00:01:04 +00:00
Zichang Guo 2e15d0eb8c [dart:io] add IOOverrides.serverSocketBind to enable overriding ServerSocket.bind()
Fix: github.com/dart-lang/sdk/issues/39094
Change-Id: Iaf8b224e89210027a62815596c759034cca1d4f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123220
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-10-28 22:04:39 +00:00
Vijay Menon 1505654f5c [dartdevc] regexp / ff fix
Fixes https://github.com/dart-lang/sdk/issues/37492

The `dotAll` is not supported on all browsers:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll#Browser_compatibility

dart2js has the same original code and (I assume) treats undefined as
false where unsupported.  ddc fails - it explicitly tests for a bool
at runtime.  This change doesn't properly support `dotAll` in ddc,
but it should make it consistent with dart2js.

Note, this is path is used during regexp initialization and impacts general usage.

Change-Id: Icee97a04623075dbaf54fabfc028ad7901270cd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123180
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-10-28 21:27:59 +00:00
Kallen Tu ef742aa6f0 [ddk] Modify _isInterfaceSubtype to consider variance annotations during runtime.
Change-Id: Idc1b553d24d76bfe52d51204aae0e0334f210fd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121910
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-10-23 21:48:17 +00:00
Martin Kustermann e82fedc345 [vm] Remove deprecated (and untested) ARMv5 support from the VM
Since we have no CQ/CI test coverage of ARMv5 and none of our customers
uses it, a breaking change request was made (see issue further down).

The breaking change has been approved and a corresponding email has been
sent out:

https://groups.google.com/a/dartlang.org/forum/?nomobile=true#!topic/announce/vRQja7di3FQ

This CL removes any armv5 related code from our codebase.

Closes https://github.com/dart-lang/sdk/issues/36666

Change-Id: I9abf32f1980ca19a9cf882b43c9966b2127f89e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-23 14:44:33 +00:00
Sam Rawlins 04702d827b Fix Queue.from doc comment
Fixes #37943

Change-Id: I6812ba3c3ccc8e679b9bcbb2d6ad5e4d14035cd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122482
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-10-23 10:03:55 +00:00
Sigmund Cherem cccb9ffb2a Stop timer callbacks after a hot reload
Change-Id: I90f0f2311524670fe52014de917afa3a35e3037d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122522
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-10-23 04:16:06 +00:00
Anna Gringauze 17ed3cb5b3 [dart2js] Fix URI leak when using deferred load
Passed library name instead of URI to "checkDeferredLoad" in the
generated JS. The URI was only used to report errors on library load at
runtime - the user should be able to to find the URI in the dart import
statemement instead.

Closes https://github.com/dart-lang/sdk/issues/37623

Notes:

- The URI is also stored in the deferred library's source map. If finding
this information on load failure is too inconvenient, we might consider
storing the URI in the main source map as well, and making sure that the
URI is loaded from the source map on load failure at runtime, for better
error reporting for users who have access to the source maps.

- Not sure how much work is needed for this to be done, so leaving this
until the need arises.

Change-Id: I90caa560e7c57c61e810b9ca4cfc648cddba5905
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2019-10-22 22:47:37 +00:00
jonahwilliams f11dea963c document readIntoSync return type
readIntoSync does not document what the return type of the function is, though it could be infered from the behavior of the non-sync method.

Change-Id: Ie62b5b4e5ea469a0dc841219f1515ac917325355
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122409
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2019-10-22 22:13:36 +00:00
Tom?s Arias a0291729f5 Fix documentation for InternetAddress.lookup()
Closes #38808
https://github.com/dart-lang/sdk/pull/38808

GitOrigin-RevId: 23b6561016286b1dd22cddf1337fb09f478deaa3
Change-Id: Iad5f38e140b201c4d8ea86d2769ae34e242ffc83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121040
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2019-10-21 23:06:52 +00:00
Nicholas Shahan 2495c5ca9f [html] Avoid dynamic in Rectangle operator ==
* Rely on type promotion instead.
* The is! type promotion isn't working in the CFE yet.

Change-Id: Ia4c8b4bcbac50cd0ab07c60f7440ef3837675b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122179
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-21 19:40:18 +00:00
Kallen Tu 531aaa9ad2 [ddk] Emit variance modifiers for classes, mixins, mixin applications.
Will be used for runtime subtype changes in future CLs.

Change-Id: I53ba10c994f13300541b3ae7a9e14d52c3836771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121821
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-10-19 01:03:41 +00:00
Zichang Guo 57a88fc33c Reland "[io] exclude links from isDirectory()"
This is a reland of 49d743f940

Original change's description:
> [io] exclude links from isDirectory()
> 
> isDirectory() should not return true for links.
> 
> Bug: https://github.com/dart-lang/sdk/issues/35102
> Change-Id: I737345a581d6a50d7bccab0dbc10f1a31a57e219
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121900
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

Bug: https://github.com/dart-lang/sdk/issues/35102
Change-Id: Ifa4317ec77172d3f196f6f75307b940d614e27bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122028
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-10-18 22:17:21 +00:00
Sam Rawlins fd0617bd98 Improve listToString and setToString documentation. Fixes #26529
Bug: https://github.com/dart-lang/sdk/issues/26529
Change-Id: I4e2994dd39c676c2136c82d3e5dd9f45a8b154ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/82784
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-10-18 18:15:52 +00:00
Sam Rawlins 09b08f7b0e Add comment on non-negativity of periodic Timer and Stream.
Fixes #30122

Change-Id: Idde67193fb671aa7fb0d277f8ec81193421d8c21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112276
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-10-18 13:22:48 +00:00
Sam Rawlins 9a829cc0b3 Remove 'strong' comments from Future.
Fixes #36458

Change-Id: I4b4f4c0666b6dee166459875881b798c44e7d65c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122040
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-10-18 08:11:55 +00:00
asiva cd95fcc810 [VM] Start the kernel isolate only when compilations are needed
- Start the kernel isolate only when a compilation is needed
- Remove some dead code and state in the loader path

Change-Id: I39e14cd79cda18b155af6334a11635c44e2fc11f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121923
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-18 00:27:16 +00:00
Zichang Guo 50f9dd8941 Revert "[io] exclude links from isDirectory()"
This reverts commit 49d743f940.

Reason for revert: break vm-kernel-precomp-mac-release-simarm64 bot

Original change's description:
> [io] exclude links from isDirectory()
> 
> isDirectory() should not return true for links.
> 
> Bug: https://github.com/dart-lang/sdk/issues/35102
> Change-Id: I737345a581d6a50d7bccab0dbc10f1a31a57e219
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121900
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=asiva@google.com,zichangguo@google.com

Change-Id: I66ee7d3b3f0ae2bcf80b00e0f3c68bba3e520966
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/35102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122060
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-10-17 22:20:38 +00:00
Zichang Guo 49d743f940 [io] exclude links from isDirectory()
isDirectory() should not return true for links.

Bug: https://github.com/dart-lang/sdk/issues/35102
Change-Id: I737345a581d6a50d7bccab0dbc10f1a31a57e219
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121900
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-17 21:05:56 +00:00
Mayank Patke 03d6e042af [dart2js] Fix printing of minified closures.
https://dart-review.googlesource.com/c/sdk/+/113904 previously "fixed"
printing for the old RTI by only using the new implementation if
USE_NEW_RTI was passed. This change fixes the root cause of the printing
failures, so we can fully switch to the new implementation.

Change-Id: Iaca56566ebebbaaad15d312c3e57204859417a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121903
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-17 20:31:16 +00:00
Ben Konyi 558875d480 [ VM / dart:io ] Added service extension scaffolding for dart:io network profiling
Change-Id: I531f002da65a3ea1439a6ed93d9698323f48bd31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121888
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-10-16 22:48:46 +00:00
Mayank Patke 3964afdbc5 [dart2js] New RTI: Stop recognizing "dynamic" as a recipe.
Change-Id: I9c7482cc91671654e90f936ae1302c623b6cc227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121774
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-10-16 21:13:41 +00:00
Ben Konyi 88e7fbbe68 [ dart:developer ] Update documentation for TimelineTask.withTaskId to warn users against providing a custom task ID in order to avoid task collisions.
Change-Id: I9f620784da5556692a38c52456a182dab33a9d2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121806
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2019-10-16 16:38:34 +00:00
Daco Harkes bdf02028cd [vm/ffi] Remove deprecated methods
Removes deprecated `load`, `store`, `allocate`, `free`, and `asExternalTypedData` methods from Pointer because these have been replace by extension methods and `package:ffi`.

Closes: https://github.com/dart-lang/sdk/issues/38860

Change-Id: I76d21bcfd2fdd6ee504a51db821345125beb92d2
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121708
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-16 01:15:42 +00:00
Nicholas Shahan a73eba9823 [dartdevc] Preliminary additions to support NNBD runtime subtype checks
Uses a temporary representation for nullable and legacy types that is subject to
change.

Updated subtype test to include expectations when running with strict mode
checks.

Does not yet include support for:
* Required named parameters
* Weak checking modes (currently only strict checking)
* Caching the results of a check for a later lookup

Issue: #38128
Change-Id: I60935c071affdb56c368e9555fce8f86931103e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119537
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-15 23:00:58 +00:00
Nate Bosch dd5edfe0c2 Remove mentions of dart2js from isolate docs
Isolates are not supported at all on the web anymore. Remove references
to a legacy limitation on the web.

Change-Id: I661c04068e8c77435de91638017c86452441fa56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121777
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-15 22:10:58 +00:00
Mayank Patke f10d79618a [dart2js] Use generic function type parameters in RTI subtype check.
Change-Id: Idb1409cd5db5e04857355cfc32a6366098aa882e
Bug: https://github.com/dart-lang/sdk/issues/38816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121501
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-10-15 21:53:56 +00:00
Daco Harkes d82ca1a9c7 [vm/ffi] Remove Struct type argument
This has coupled changes in package:ffi and package:tflite_native which are pinned in DEPS.

This CL includes the required analyzer changes from https://dart-review.googlesource.com/c/sdk/+/121647.

Issue: https://github.com/dart-lang/sdk/issues/38611

Change-Id: I712a886fd28ce0a2954fc42c90e1dfa495057732
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121422
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-15 18:35:57 +00:00
Clement Skau 0cada76a06 [SDK] Removes dart2aot.
Bug: https://github.com/dart-lang/sdk/issues/38834
Change-Id: Iff1247186271643ea557a0aaec1e6b8438676c59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121706
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-15 17:53:38 +00:00
Sam Rawlins f9648cb477 Fix doc comment for Element.animate
Change-Id: Iace87105cf2a1fa4aacc579b07c9760329c7d160
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119420
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-10-15 17:36:52 +00:00
Daco Harkes 4131d3d7c4 [vm/ffi] Improve API docs
This changes the API docs to (1) be specialized to the specific types and (2) have more precise wording.

Change-Id: I14fa37bd162f846c19e62443c53dd051eaa62ad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121427
Reviewed-by: Kathy Walrath <kathyw@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-10-15 17:17:57 +00:00
Ben Konyi 8fd83cb222 [ dart:developer ] Remove optional 'parent' parameter from TimelineTask.withTaskId to avoid ID collisions
If parent is a param in the TimelineTask.withTaskId() constructor, we have the possibility of running into this situation:

TimelineTaskA - id 0

TimelineTaskB - id 1
TimelineTaskC - id 2 - parentId 1
TimelineTaskD - id 0 - parentId 2 (this task created with TimelineTask.withTaskId(0, parent: C))
TimelineTaskE - id 3 - parentId 0 (now who is the parent of E? D or A?)

If we do not allow the user to specify parent in the withTaskId() constructor, we remove the possibility of this clash. This clash happens because the user was able to inject an event with id 0 into an async tree defined by the parent parameter.

By removing the parent parameter from the withTaskId() constructor, we can rely on different sources of truth for the different TimelineTask constructors.
  - If taskId is specified via TimelineTask.withTaskId(), then that is the source of truth for inferring the async event tree (events with the same async id are in the same async tree).
  - If parent is specified via TimelineTask(parent: parent), then that is the source of truth for inferring the async event tree.
  - If neither taskId nor parent are specified (e.g. TimelineTask()), we default to timestamp inference.

Change-Id: I491a20cf1d1aaea744ab92e56602269390e73fb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121680
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2019-10-14 23:37:48 +00:00
Janice Collins c891fa858e Update dartdoc to v0.28.8.
Release notes:  https://github.com/dart-lang/dartdoc/releases/tag/v0.28.8

This also reverts the workaround in ff23f546db by dacoharkes@.

Instead of crashing, dartdoc v0.28.8 displays some fairly spammy warnings that the functionality is unimplemented.

  warning: Comment reference resolution inside extension methods is not yet implemented, from dart-ffi.DoublePointer.value: Field value.location
  warning: unresolved doc reference [address], from dart-ffi.DoublePointer.value: Field value.location
  warning: unresolved doc reference [Double], from dart-ffi.DoublePointer.value: Field value.location
  warning: unresolved doc reference [value], from dart-ffi.DoublePointer.value: Field value.location
  warning: unresolved doc reference [Float], from dart-ffi.DoublePointer.value: Field value.location

Issue: https://github.com/dart-lang/sdk/issues/38786
Change-Id: Ie8fef572f5d50bd7f031b498c0cd066a4765c493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121644
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-14 21:42:39 +00:00
Keerti Parthasarathy 6d468d1377 Add a script and target to run dartfix
Change-Id: I68df635359b898ef4b6054292f6523d81f46448a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121149
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-10-14 15:50:21 +00:00
Stephen Adams 892fcf2c45 Avoid constructing RegExp for every BigInt.tryParse
Change-Id: I323089a17b4fa167ac3d660f5313cc1e6873a994
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118681
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-10-14 14:04:11 +00:00
Daco Harkes b4751d5e16 [vm/ffi] Pointer.asExternalTypedData to extension method - Fix Flutter
Fixes imports (the order of patch files is not defined, so the imports need to be equal in all files).

Change-Id: I2dc16f4930253b25c7ae6ab6b0699581f9e2dd46
Cq-Include-Trybots: luci.dart.try:flutter-engine-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121428
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-14 13:04:00 +00:00
Daco Harkes 91c6dc15de [vm/ffi] Pointer.asExternalTypedData to extension method
Issue: https://github.com/dart-lang/sdk/issues/38610

Change-Id: Ib07f50b23e3be2bce2d7b973c0f0196884397952
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121384
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-14 09:52:58 +00:00
Mark Egli 545a06b19e Fix typo in zone documentation.
Closes #38848
https://github.com/dart-lang/sdk/pull/38848

GitOrigin-RevId: 646ee0189aaa25aced290aff2134f70e920b5bb9
Change-Id: I76ca2106011fdc43c7ab0b1da0a2162e68d79243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121413
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2019-10-12 21:28:25 +00:00
Mayank Patke fe0b56fdd1 [dart2js] New RTI: Remove TODO from thrown string.
Change-Id: If3659d50d64a45c832bc2ed56b395f8a603bd351
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121464
Auto-Submit: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-11 23:19:19 +00:00
Devon Carew c54750fd8e [sdk] add a gn file for the JS dart:_interceptors library
Bug: https://github.com/flutter/flutter/issues/41649
Change-Id: I4b482dd6a20114d39aae705c1fc625c365aa0844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121462
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-10-11 19:31:00 +00:00
Daco Harkes 9f33e8da04 [vm/ffi] Pointer optimize indexed load and store
Follow up of https://dart-review.googlesource.com/c/sdk/+/117547

This gets rid of unnecessary allocations in hot loops with indexed loads and stores.

Issue: https://github.com/dart-lang/sdk/issues/38172

Change-Id: I37a4b1aba00084e465d47cce79bb9963e1afc104
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119645
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-11 15:54:01 +00:00
Samir Jindel 4ee5ef9f10 [vm/ffi] Use Pointer<Null> as the type of nullptr.
Also clean up test/benchmark/sample code using nullptr and fix pubspec.yaml in the SQLite sample.

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

Change-Id: I6fa0522374af28020ef8f096ac22b23712aedb5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121122
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-11 14:39:47 +00:00
Nate Bosch 17702e4af0 Export promiseToFuture function from dart:html
Fixes #38805

Change-Id: I1ff58eacdc4bb2fbb610335ae1eaaa7bd911a1ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120935
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2019-10-11 09:23:56 +00:00
Samir Jindel 8859206dba [vm/ffi] Remove Pointer.offsetBy.
Fixes https://github.com/dart-lang/sdk/issues/35883

Change-Id: Idf4b113d655a6cf7063f1ee7732ddd2001247dee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121124
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-10-10 15:44:27 +00:00
Samir Jindel 63d3012e68 [vm/ffi] Deprecate Pointer.allocate/free.
Fixes https://dart-review.googlesource.com/c/sdk/+/118442.

Also updates untested sample code in samples/ffi.

Change-Id: Id40a7b8fbb35c5d989269646ebb22864cebcfcac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118441
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-10 13:17:43 +00:00
Zichang Guo 8866cdb8be [vm] throw exception if directory buffer overflows on Windows
According to https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readdirectorychangesw,
When using ReadDirectoryChangesW, buffer overflows will still return true. It ends up closing the stream without any notification.
Throw an exception to notify users.

Bug: https://github.com/dart-lang/sdk/issues/37233
Change-Id: I9aebed8b1f30b5e843ad37a51b87d234aa1d8ce6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119524
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-10-09 19:59:52 +00:00
Devon Carew 50d6a3d022 [analyzer] move the ml model from sdk/model to sdk/bin/model
Change-Id: I64aad93770c5c0870c1a5052bb5a1192738f1cf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120901
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Ari Aye <ariaye@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-10-09 19:26:34 +00:00
Daco Harkes ff23f546db [vm/ffi] Work around dartdoc crash to fix API doc generation
Issue: https://github.com/dart-lang/sdk/issues/38786

Change-Id: Ida4bb78da1aabdf6da259e0d66840d9db4b1428d
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120788
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-09 12:37:52 +00:00
asiva b12bed36a8 [VM] Implement isExtensionMember in MethodMirror and VariableMirror
Added ability to recognize a MethodMirror to be a mirror of an extension member
Added ability to recognize a VariableMirror to be a mirror of a static
extension field.

Change-Id: I56715a491bba0d8cafb2796ebb755bd339e147c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120760
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-09 00:27:30 +00:00
Nate Bosch 0f1d5fa7e6 Centralize functions to convert Promise
Merge the two copies of a function that convert a JS promise to a Dart
Future. Reuse this function for the specialized case of converting to a
`Future<Map>`.

- Rename `convertNativePromiseToDartFuture` to the shorter and more
  widely used `promiseToFuture`. Update one existing use of the old
  name.
- Make the method generic to match the previous implementation of
  `promiseToFuture`.
- Update the code generator template to not emit the second copy of the
  method.
- Use the existing `promiseToFuture` with a `.then` call to implement
  `promiseToFutureAsMap`. Update the doc comment to follow best
  practices.
- Duplicate all above changes to nnbd SDK copy.

Change-Id: Ib3bbf17477efec3666b24fd4019ca8ce68f0b5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119174
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-08 21:33:42 +00:00
Daco Harkes 597cd06aec [vm/ffi] Pointer load and store as extension methods
Issue: https://github.com/dart-lang/sdk/issues/37773
Change-Id: I836d6305b613cf05590d872874f4517831be3e08
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118992
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-08 16:49:41 +00:00
Daco Harkes d23c824435 Reland "[vm/ffi] Optimize Pointer operations for statically known types"
Original CL in patchset 1.
Fix for simdbc in patchset 4.
Fix for arm32 precompiled in: https://dart-review.googlesource.com/c/sdk/+/120660/

This CL optimizes Pointer operations in hot loops for Pointer<NativeInteger/NativeDouble/Pointer> (not for structs).

Design: go/dart-ffi-pointers-il

It provides roughly a 100x speedup for the FfiMemory benchmark. The next 5x speedup is to get rid of allocations due to `load` and `store` not being inlined.

FFI API is changed to enable optimizations:

* Disable dynamic invocations of Pointer.load / Pointer.store.
* Disallow implicit downcast of argument passed to Pointer.store.
* Stop zeroing out Pointer.address on Pointer.free().

Issue: https://github.com/dart-lang/sdk/issues/38172

Related issues:

Closes: https://github.com/dart-lang/sdk/issues/35902 (Disallowing dynamic invocations of Pointer ops.)
Closes: https://github.com/dart-lang/sdk/issues/37385 (Function variance checking)
Change-Id: I3921a595fd05026d6ca565ace496771d7c1d877b
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120661
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-10-08 13:04:39 +00:00
Mayank Patke a0e8c7712d [dart2js] New RTI: Prevent elision of precomputed1 and remove unneeded read.
Change-Id: I01efc3183d4b9bfb25065a4b54d75c6c7a97d19c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120460
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-10-07 19:34:10 +00:00
Daco Harkes 0eff6b38a9 Revert "[vm/ffi] Optimize Pointer operations for statically known types"
This reverts commit 3712ed27ef.

Reason for revert: Breaks Arm32 precompiled.
Issue: https://github.com/dart-lang/sdk/issues/38737

Original change's description:
> [vm/ffi] Optimize Pointer operations for statically known types
> 
> This CL optimizes Pointer operations in hot loops for Pointer<NativeInteger/NativeDouble/Pointer> (not for structs).
> 
> Design: go/dart-ffi-pointers-il
> 
> It provides roughly a 100x speedup for the FfiMemory benchmark. The next 5x speedup is to get rid of allocations due to `load` and `store` not being inlined.
> 
> FFI API is changed to enable optimizations:
> 
> * Disable dynamic invocations of Pointer.load / Pointer.store.
> * Disallow implicit downcast of argument passed to Pointer.store.
> * Stop zeroing out Pointer.address on Pointer.free().
> 
> Issue: https://github.com/dart-lang/sdk/issues/38172
> 
> Related issues:
> Closes: https://github.com/dart-lang/sdk/issues/35902 (Disallowing dynamic invocations of Pointer ops.)
> Closes: https://github.com/dart-lang/sdk/issues/37385 (Function variance checking.)
> 
> Change-Id: I96058d8b5b49052eb6999f084372e6f08b4f6f17
> Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117547
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,sjindel@google.com,dacoharkes@google.com

Change-Id: I3b7923ace45beaa9f99119e9ea20c1e52b429ad8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/38172
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, vm-ffi-android-debug-arm64-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-x64-try, vm-kernel-win-debug-ia32-try, vm-dartkb-linux-debug-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-dartkb-linux-release-x64-abi-try, vm-kernel-precomp-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120582
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-10-07 11:50:43 +00:00
Daco Harkes 3712ed27ef [vm/ffi] Optimize Pointer operations for statically known types
This CL optimizes Pointer operations in hot loops for Pointer<NativeInteger/NativeDouble/Pointer> (not for structs).

Design: go/dart-ffi-pointers-il

It provides roughly a 100x speedup for the FfiMemory benchmark. The next 5x speedup is to get rid of allocations due to `load` and `store` not being inlined.

FFI API is changed to enable optimizations:

* Disable dynamic invocations of Pointer.load / Pointer.store.
* Disallow implicit downcast of argument passed to Pointer.store.
* Stop zeroing out Pointer.address on Pointer.free().

Issue: https://github.com/dart-lang/sdk/issues/38172

Related issues:
Closes: https://github.com/dart-lang/sdk/issues/35902 (Disallowing dynamic invocations of Pointer ops.)
Closes: https://github.com/dart-lang/sdk/issues/37385 (Function variance checking.)

Change-Id: I96058d8b5b49052eb6999f084372e6f08b4f6f17
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117547
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-07 09:23:54 +00:00
Devon Carew 3e3406d20e [sdk] remove the dart:_chrome package
Change-Id: I5b62984fb7d4cd5dd9ed6f4a02ed91e08ed71e8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120005
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-10-06 23:50:09 +00:00
Mayank Patke b1db66306b [dart2js] New RTI: Use precomputed1 to access first type argument of
interface types.

Change-Id: I167bb9be3f07dd3734993a46283a9d6eea56ac92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119960
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-10-05 01:51:02 +00:00
Mark Zhou 36e4d5e3c2 Reland "[dartdevc] cleaning up unused web files"
This is a reland of e866f043cf

Original change's description:
> [dartdevc] cleaning up unused web files
>
> Dependent on these google3 changes: https://critique.corp.google.com/#review/272749649
>
> Change-Id: I9e89142cd5b2a619acfc35badb9cf3c549b3be9c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119587
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>

Change-Id: I7e01fb4ad60e47808721fa49b3ca3498e7aeaf46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120200
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-10-05 00:27:22 +00:00
Ben Konyi 38f78c01f3 [ dart:developer ] Updated parentId argument for timeline events to use base64 to be consistent with async ID formatting
Change-Id: I96314f5712b722da5188c0a447a12c9c5fe6064b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120322
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-10-04 23:27:22 +00:00
Devon Carew f2d1e145dc [sdk] remove some metadata references to dart:profiler
Change-Id: I4ef14aad2817ee2d4e51dc5bce8d6006634a3e9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120007
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-10-04 19:12:36 +00:00
David Morgan d6c6d12ebf Revert "[dartdevc] cleaning up unused web files"
This reverts commit e866f043cf.

Reason for revert: Breaks google3.

Original change's description:
> [dartdevc] cleaning up unused web files
> 
> Dependent on these google3 changes: https://critique.corp.google.com/#review/272749649
> 
> Change-Id: I9e89142cd5b2a619acfc35badb9cf3c549b3be9c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119587
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>

TBR=scheglov@google.com,vsm@google.com,markzipan@google.com

Change-Id: I1db094d94d699d4d18c4091f57c7cb775eb95dd5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120040
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2019-10-04 10:11:30 +00:00
Mark Zhou e866f043cf [dartdevc] cleaning up unused web files
Dependent on these google3 changes: https://critique.corp.google.com/#review/272749649

Change-Id: I9e89142cd5b2a619acfc35badb9cf3c549b3be9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119587
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-10-04 02:40:43 +00:00
Ben Konyi e87f3407c8 [ dart:developer ] Added optional parent parameter to TimelineTask constructors.
Specifying a parent will result in an argument being added to 'start'
events for that TimelineTask named 'parentId', which contains the task
ID of the parent. This is to be used by DevTools to show relationships
between asynchronous tasks that are not currently supported in the trace
event format used by Catapult.

Change-Id: Id0a030f018f5a6ac1e3b0ef2e89c1cd732790f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-03 16:33:38 +00:00
Nate Bosch cbf6a233fc Call out tests as a valid use case for Exception
Based on a discussion where the current wording made it seem necessary
to create a `TestException` class for the sole reason of avoiding
direct usage of `Exception`.

Also remove usage of unnecessary `new` in doc.

Change-Id: I7abe84e8719af056b3f82e1d7e08faa9a641591d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118369
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-10-01 19:22:00 +00:00
Liam Appelbe 26c49d5578 [vm] Wasm memory exports, and emscripten hello world
I got the hello world wasm file from the emscripten team and got it
running using a fake implementation of WASI's fd_write function. This
necessitated adding support for memory exports.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I139a4e868d437e2232bf4260e5cc26d8c598ac2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119061
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-01 18:19:56 +00:00
Liam Appelbe 6da8c39c5a [vm] Small WasmImports API change, and more WASM error tests
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I3044d588398ccb19e3ebcebe6cd506b047a37857
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118601
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-27 23:36:11 +00:00
Mayank Patke fca257f8ba [dart2js] New RTI: Don't assert that RTI objects have old structure.
Change-Id: I580242dcc6d05e5e202b32c01350e605461c5568
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119177
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-27 23:15:21 +00:00
Liam Appelbe d2a0900a50 Reland "[vm] Wasm function imports"
This reverts commit a7cb8ee88b.

Reason for revert: Fixed the crash

Original change's description:
> Revert "[vm] Wasm function imports"
> 
> This reverts commit 7a24aec8f4.
> 
> Reason for revert: debug-mode gen_snapshot crashes on all programs
> 
> Original change's description:
> > [vm] Wasm function imports
> > 
> > Bug: https://github.com/dart-lang/sdk/issues/37882
> > Change-Id: Ia8aa9a87803d5e8b899ddab5479b8cd93e03fd71
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118204
> > Commit-Queue: Liam Appelbe <liama@google.com>
> > Reviewed-by: Ryan Macnak <rmacnak@google.com>
> > Reviewed-by: Alexander Markov <alexmarkov@google.com>
> 
> TBR=rmacnak@google.com,alexmarkov@google.com,liama@google.com
> 
> Change-Id: Ib5d348e25854af010b1d8a64a87406da443981df
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119143
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Commit-Queue: Samir Jindel <sjindel@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,sjindel@google.com,liama@google.com

Change-Id: I4fd073a087eae7bb95c75079446d9111e7bc8c40
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119168
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-09-27 21:29:12 +00:00
Samir Jindel a7cb8ee88b Revert "[vm] Wasm function imports"
This reverts commit 7a24aec8f4.

Reason for revert: debug-mode gen_snapshot crashes on all programs

Original change's description:
> [vm] Wasm function imports
> 
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Change-Id: Ia8aa9a87803d5e8b899ddab5479b8cd93e03fd71
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118204
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,liama@google.com

Change-Id: Ib5d348e25854af010b1d8a64a87406da443981df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119143
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-09-27 12:22:58 +00:00
Mayank Patke 75eb947bc8 [dart2js] New RTI: Support redirection in ruleset.
Change-Id: I6b11dbd826f9b47febcb0cd2716d93ff5cd8b74c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118887
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-09-26 22:24:52 +00:00
Liam Appelbe 7a24aec8f4 [vm] Wasm function imports
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: Ia8aa9a87803d5e8b899ddab5479b8cd93e03fd71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118204
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-26 22:08:12 +00:00
Zichang Guo 2741022aa0 [vm/http] replace hard coded string in http headers
Working on a fix to not force http headers to be lowercases.
Most of headers are listed in http.dart like HttpHeaders.acceptHeader. But there are some places which use hard code string("Accept") to refer to certain header.
Replace raw strings for consistency.

Change-Id: Ieba77428173123b7b144885ab5c92642d63de580
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118649
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-09-26 15:01:52 +00:00
Nate Bosch 7472da8e25 Make allowInterop idempotent in DDC
Fixes #38311

Add a new utility method `isDartFunction` to check whether an object is
a Dart function as opposed to a native JS function by checking if it has
a `_runtimeType` attached.

When wrapping with `allowInterop` skip wrapping objects that are not
Dart functions.

Change-Id: I4e199f255db46d3825cccc3af9a72b7711e27626
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118476
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-09-25 23:46:22 +00:00
Jonas Termansen 8cbc4f3982 [benchmark] Add support for benchmarking DDC.
This change adds the required support to benchmark DDC just like dart2js.

The ddb tool gains the following options:

  --compile-vm-options=VM-OPTIONS
      The value of the DART_VM_OPTIONS environment variable set when running
      dartdevc. This option is required to measure the memory use of
      dartdevc while compiling.

  --packages=PACKAGES-FILE
      The .packages file to use when compiling. This option is required for
      special benchmarks with a .packages in a subdirectory and is generally
      useful.

  --out=OUTPUT-FILE
      Write the compiled javascript to this path and the other generated
      files along it. This option makes the benchmark configuration easier
      and is generally useful.

The dartdevc and dartdevc.bat scripts in the released Dart SDK now gains
support for the DART_VM_OPTIONS environment variable, just like the dart2js
scripts. This feature is needed to measure the memory usage of the Dart VM
executing dartdevc.

tools/bots/try_benchmarks.sh now tests that ddb can compile and run
benchmarks using the needed features.

Change-Id: Ib1ef07b0888a8c0cf900fe2fbb5697aab733db08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118440
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2019-09-25 09:48:00 +00:00
Liam Appelbe fd0a89971c [vm] More wasm cleanup
Fix some VM/native transition issues, and add a describe() function that
prints all the imports and exports of a module.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I68a8860857c3fcb37c49a9e92731629a13fd9449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118363
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-09-24 21:24:57 +00:00
Devon Carew de2e16d39d Add gni files to the html, js, and js_util packages in support of adding them to the flutter sdk.
Bug: https://github.com/flutter/flutter/issues/35588
Change-Id: I1f6c0c5edee99114ed72893a83a1954ff61c2c57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118472
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-09-24 15:28:29 +00:00
Mark Zhou d012dfc7a6 Removing 'webkit' prefix, as most modern web browsers will accept 'RTCPeerConnection'
Fixes #38325

Change-Id: I08589781c8e8647c1e6d403baf4d6106d5308181
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116941
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Auto-Submit: Mark Zhou <markzipan@google.com>
2019-09-24 00:04:00 +00:00
Parker Lougheed bb879969dd Fix some dart sdk documentation issues
Mostly fixes unresolved references but fixes some other small issues as well

Bug: https://github.com/dart-lang/sdk/issues/37880
Change-Id: I5747c3c90d66d23859e021fc6bd07cc7cd9700d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103741
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-09-23 21:52:07 +00:00
Mayank Patke ad52d12953 [dart2js] New RTI: Don't try to instantiate a null function.
Change-Id: I6532fb138343e8fe01b3773b3ef6693e52b1b312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118364
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-09-20 22:35:57 +00:00
Mark Zhou 56913c2555 Changing val to accommodate double values
Change-Id: If19b6aece45b46a0ceb85d98b0ac73eb3735e0dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118240
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-09-20 16:23:35 +00:00
Mayank Patke 34253ce388 [dart2js] New RTI: Treat JavaScriptFunction as subtype of all function
types.

Change-Id: Ibf97fe3d42e78f7f533c6057f03d31db0dba1ad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117661
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-19 19:42:38 +00:00
asiva 7c1821c4aa [NNBD/VM] Restructure VM patch files for the NNBD dart sdk split
- Move all VM patch files from the lib directory to
sdk/lib/_internal/vm/lib
- Move all VM patch files from the bin directory to
sdk/lib/_internal/vm/bin
- Fixed paths for above patch files in libraries.yaml file.
- Created copies of these patch files in sdk_nnbd directory
- Cleaned up *.gni files by removing the unused dart patch files lists.

Change-Id: I3109d22f3b729a073a6b40175a0d29162a455830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117685
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-09-19 03:57:30 +00:00
Mayank Patke f057e2506e [dart2js] Extended structured clone algorithm to JSObject.
Change-Id: I0d8b20184f1b88e4bb24f67c2237b2095370118d
Bug: https://github.com/dart-lang/sdk/issues/37438
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114043
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-09-18 18:44:29 +00:00
Samir Jindel 205b90f0de Take 3 for '[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).'
Fixes the changes to assembly snapshot writer in SIMARM_X64 mode. This unfortunately can't be tested until the ELF loader is available.

Take 2 is in patchset 1.

Change-Id: Ib8b067dd4f09dcba3b142705e9cb4dfbf4e3eb53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117726
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-18 14:56:27 +00:00
asiva 4b6ab33cfa [SDK] Reland: Remove dart:profiler library which has been deprecated since Dart 1.2
and remove all references to it in tests and the SDK build scripts.

Change-Id: I728770c460042596ddd14efecdc52bcf0580f592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117584
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-09-17 23:19:20 +00:00
Liam Appelbe f234830998 Cut dart:ffi dependency to fix simarm build
Change-Id: I4124163000e2990a6037d36a4f87ccfcddf5a933
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117210
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-09-13 23:23:34 +00:00
Liam Appelbe ed9e89ea38 Implement a basic WASM API using wasmer.
Currently this only supports functions that take and return numeric
types. Byte arrays, and callbacks will come later, in a separate
wrapper package.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I7bb82be83cbbb6062736b3e958f89d021f1af4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114586
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-13 18:25:16 +00:00
Alexander Markov d0052c1b31 [dart:_http] Fix potentially large List<int> allocation in _WebSocketPerMessageDeflate.processIncomingMessage
processIncomingMessage() was creating List<int> to hold uncompressed bytes,
which is very wastefull if size of the message is large (spending a word
for each byte).

Changed processIncomingMessage() to use BytesBuilder for uncompressed bytes.

This fixes flaky out of memory failure on service/get_vm_timeline_rpc_test with
bytecode in dartk-optcounter-linux-release-ia32 configuration. In that test size of
uncompressed message exceeded 130MB, causing 1GB memory allocation (512MB List
was expanded).

Change-Id: Ic5a78a13bd431f5ad97496907a84a3f7ba01c1fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117121
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-13 17:07:16 +00:00
Mayank Patke 892187eff7 [dart2js] Ensure JSInvocationMirror.typeArguments is unmodifiable.
Change-Id: Ia676a7c02b0751c0e395df34e097f063d5146796
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116892
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-12 18:17:46 +00:00
Alexander Aprelev 0c481a196c Revert Reland '[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).' as it breaks flutter profile execution on ios 32-bit platform.
Fixes https://github.com/flutter/flutter/issues/40114

Change-Id: If8d71e9c19c2e794d29f7ecbacb87457890a2fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116883
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-12 00:10:09 +00:00
Nate Bosch c464a12eb0 Minimize diffs between copies of js_dart2js.dart
- Drop optional `new`.
- Rename `constr` to `ctor` for consistent variable names.
- Use spaces around `=` in a JS expression where the DDC copy was
  already doing so.
- Add explicit return type of `void` on `operator []=`.
- Fix typos that were already fixed in DDC copy.
- Remove unnecessary organizational comment.

Change-Id: I85aff3429b7b9358dd4866a570dddbe9b26a5d48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116826
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2019-09-11 22:15:10 +00:00
Nate Bosch 2cc0c4fcc0 Update doc comments for dart:js
Fixes #38280, Fixes #24576

- Add "Low level" to the library doc comment and add a sentence about
  preferring to use `package:js`.
- Add doc comments on `allowInterop` and `allowInteropCaptureThis`.
- Remove the docs that discuss what dart2js "may" do in the future.
- Tweak some comments on classes to use a noun over a verb - "A proxy
  on" over "Proxies".

Cleanup:

- Use `///` consistently.
- Ensure the docs are identical between the two copies of the file, this
  minimizes the diff.

Change-Id: I7f904d77b2d9dd537201dd53a29d7ef74289aa86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116555
Reviewed-by: Kathy Walrath <kathyw@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-09-11 17:50:16 +00:00
Ryan Macnak 2e8d912848 [developer] Allow async end events to have independent arguments.
This matches the behavior in the Chrome and Fuchsia tracing macros.

Change-Id: I7e5759409af5262e6e2596384c67a2eb70d48cd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114545
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-09 17:00:47 +00:00
Nate Bosch cff9c587f4 Tighten call conventions in allowInterop
Towards #33134

Functions called through allowInterop or allowInteropCaptureThis wrappers will
use the `dart.dcall` code path which checks argument counts and types. This will
make these calls stricter to match dart2js semantics.

In the long term we want to make dart2js accept _extra_ arguments, at which
point we'll also want to make DDK loose in the same way. For now we want DDC
to be strict.

Change-Id: Ibf1dabf141273229770f8328f9ca7bfb9f4fb5db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113754
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-09-07 01:30:05 +00:00
Sam Rawlins d964c50cff clear contents on TemplateElement#setInnerHtml before appending
Fixes #18249

Change-Id: I29b12163ad5809010c4ee4ff4ce892399d26e3ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112485
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-09-06 18:31:59 +00:00
Michael Thomsen f989605cc9 Fix dartdoc typo in ffi
Closes #38233
https://github.com/dart-lang/sdk/pull/38233

GitOrigin-RevId: c3e017d8c340976aeabfded522886cd9cda0638a
Change-Id: Ife1adb72db8887a91b2049316e8444a4d5f121ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115905
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-06 07:47:49 +00:00
Samir Jindel c219a76652 Reland "[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs)."
The original change is in Patchset 1.
The dependency contains the fix for the non-bare-instructions bot.

Change-Id: Iab02ab0736a2ee9144b667d2777ca526341b2a36
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-bare-linux-release-x64-try,vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115241
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-05 20:19:22 +00:00
Sarah Zakarias 6512f5563d Revert "Revert "Add dart2native tool for building either an aot file or a stand-alone executable.""
This reverts commit 54fdd559d8.

Trying to reland this after https://dart-review.googlesource.com/c/sdk/+/115364 hopefully fixes the issue leading to the revert.

Change-Id: If3c49bea9d791aa3d569003490c1cbe8b325f2e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115705
Commit-Queue: Sarah Zakarias <zarah@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2019-09-05 14:46:43 +00:00
Michael Thomsen d6af8654e5 Update ffi.dart to add preview disclaimer
Closes #38209
https://github.com/dart-lang/sdk/pull/38209

GitOrigin-RevId: 77d6a29f012b7a6a4866e4c9b1bd69757b5e6661
Change-Id: I6197c99b1b4d74f538948da3ab17c4923627635f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115661
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-09-05 08:46:19 +00:00
Samir Jindel 08132661a6 [vm/ffi] Unhide FFI docs.
Change-Id: I3bcf99d49950a2f7f69621455617f324b8258882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115401
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-09-04 18:07:01 +00:00
Clement Skau a1949cd835 [sdk] Removes gen_snapshot.lib from copy_dartaotruntime.
To address: https://dart-review.googlesource.com/c/sdk/+/115340

Change-Id: I6524eddfff9aece7b5670f33ded04abc3112ca18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115364
Reviewed-by: Sarah Zakarias <zarah@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-09-04 11:21:53 +00:00