Commit graph

28 commits

Author SHA1 Message Date
Lasse R.H. Nielsen 30b2a5dbb3 Update documentation for Function class.
Fixes #36303

Bug: https://github.com/dart-lang/sdk/issues/36303
Change-Id: I1e995ee624660b5cfc40b9395b34beeeb985eeda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118989
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2019-09-27 13:30:33 +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
Robert Nystrom 6d86779288 Make the NNBD fork not stomp on the other build.
Add a new top level target to build the NNBD fork of the SDK. In its
BUILD.gn file, update all of the paths to not step on the main dart-sdk
directory.

This probably isn't perfect, but it's a first step.

Change-Id: I7ac12a2b174faf6b19d88fff54e3438299577a26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117681
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-09-25 00:43:13 +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
Mark Zhou 4c74b486af Re-adding dart sdk version comment
Change-Id: Ifc1ddc6ebc8b14107424e36dc5e8388bcf69d262
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118370
Auto-Submit: Mark Zhou <markzipan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-20 23:26:39 +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
Mayank Patke 7e68a0c95e Copy changes from f057e25 to sdk_nnbd.
Change-Id: Id31fa5d37970b74f38a06e7b2490937de93b1441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118400
Commit-Queue: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Auto-Submit: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-09-20 22:05: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
Lasse R.H. Nielsen e88057fe04 Add non-NNBD language version marker on all sdk_nnbd files.
Change-Id: I2ab3d4b1efe0f3c79f4b770e79476153380220f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118040
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-09-19 19:44:37 +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
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 971b519b07 Apply missed changes to NNBD sdk
Any changes which went in while the forking change was in flight were
missed by the fork. This applies 2cc0c4fcc0

Change-Id: I38a4451a9eeaf5879a6d98127a7b5542bf0d643c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116824
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-09-11 20:27:28 +00:00
Paul Berry 004d49bd6b Make a fork of sdk/lib for use by NNBD.
Change-Id: I7f5892d66f9e7bd08ca064fb2df329794a56faf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116527
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-10 19:20:12 +00:00