Commit Graph

1661 Commits

Author SHA1 Message Date
Vijay Menon 4f9f77aedc Remove dcall in dart:convert
Seeing this in the hot path on an internal app.

Change-Id: I921f12ece706b4ea92d9a97858fde2799972f653
Reviewed-on: https://dart-review.googlesource.com/15940
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-10-25 18:28:06 +00:00
Bob Nystrom 67ca95fc2c Support different module formats in dartdevk.
Change-Id: I0683c1bdaa5e67332d67f9ec84052851b4b0c649
Reviewed-on: https://dart-review.googlesource.com/15760
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-20 23:25:08 +00:00
Bob Nystrom 9c0a6fd27c Add rudimentary support for dartdevk to test.dart.
It's added as a new compiler, so pass "-c dartdevk" to use it.

It doesn't support any test packages yet, so tests that, say, import
package expect won't compile. I'll work on that next, but it will
require adding some stuff to the build scripts to build .dill files for
those packages.

This does get test.dart invoking the compiler, running the resulting
test, and correctly reporting the result:

- A test that doesn't throw an exception and stays within the bounds of
  what is currently implemented in dartdevk passes.

- A test that compiles correctly but fails at runtime fails with a
  RuntimeError.

- A test that contains a compile error fails with a non-zero exit code
  and is reported as a CompileTimeError.

Change-Id: Icacbf1ff54dfe7aa4d245382d3b0aeb375cf105b
Reviewed-on: https://dart-review.googlesource.com/15420
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-20 16:00:28 +00:00
kmillikin 95982b53cd [ddc-kernel] Compile return and arrow functions
Compile return statements.  Kernel function bodies are statements, not
necessarily blocks.  In that case, blockify the JS function body.

Bug:
Change-Id: Ibbed1c2039b103151b7244774f3daf8992264a88
Reviewed-on: https://dart-review.googlesource.com/15280
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2017-10-19 20:58:37 +00:00
Vijay Menon 7b42a5383a Modify ddc/ddw to optionally run in kernel mode
Notes:
- must run tool/kernel_sdk.dart first to create sdk dill file
- seems to require full paths for now: ddc -k /Users/vsm/test/hello.dart

TBR=jmesserly@google.com

Change-Id: I2342a77c2edd3160e00bc4187edcf9defeb1fa27
Reviewed-on: https://dart-review.googlesource.com/14860
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-10-19 20:18:57 +00:00
Leaf Petersen dd17a4c7f7 Alpha-vary generic function types before performing inference.
Generic function types were not previously renamed before using them
for inference, which resulted in capture problems when doing inference
on recursive generic method invocations.

Fixes #30980

Bug:
Change-Id: I1c610606dd65d86735cb615e077d720066a85e1a
Reviewed-on: https://dart-review.googlesource.com/15040
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2017-10-19 19:26:07 +00:00
Bob Nystrom ba2e4aff24 Some minor clean-up in test.dart.
- Fix fuzzy arrow errors.
- Default the Dart repo URI so it doesn't always need to be explicitly
  set.
- Run dartfmt on everything.
- Move some members out of the garbage bin "TestUtils" class:
  - Move the stuff around the Dart repo directory to a new Repository
    class.
  - Move absolute() into Path where it belongs.
  - Move workingDirectory in Path since it is a Path.
  - Delete the random number stuff since it was apparently unused.

Change-Id: I3dab3a4f1713b7a749e64b6776149d05a0ce1b69
Reviewed-on: https://dart-review.googlesource.com/14502
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2017-10-19 19:05:58 +00:00
Vijay Menon 4ba98e617b Source map support for ddc node runner
This doesn't use our own source map mapper (which is harder to
integrate here).  This appear to use V8 specific hooks, but seems to
work more seamlessly.

Change-Id: I622314f9190ca161e37d77a8ba1b659891469834
Reviewed-on: https://dart-review.googlesource.com/14500
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-10-17 23:16:06 +00:00
Jenny Messerly 4234e18593 workaround fasta test incorrectly analyzing DDC code
pkg/front_end/test/fasta/analyze_test is incorrectly failing because of DDC changes.
This must be fixed, but in the meantime this works around it.

Change-Id: I72fd56f9b306dce9b1f34e810c6ece3f6d8f49fb
Reviewed-on: https://dart-review.googlesource.com/14342
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2017-10-17 00:26:22 +00:00
Jenny Messerly ef3ac59dd6 add a dartdevk command that compiles with the new front end
This ports a fairly large part of DDC's Analyzer-based code generator,
however most nodes are not supported yet.

The goal is to preserve all functionality of code that was ported,
except for deprecated features (e.g. mirrors, fuzzy arrows, libraryRoot).

Change-Id: I3b10d5773c7c10a740fa336720243b03c6b82529
Reviewed-on: https://dart-review.googlesource.com/10705
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-16 21:13:52 +00:00
Jennifer Messerly 697e531c17 fix IdentityMap setter concurrent modification detection
Change-Id: Ib999210cf5709a4cef6a14a8d7fafe7b516f09c9
Reviewed-on: https://dart-review.googlesource.com/13641
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-13 20:57:24 +00:00
Konstantin Shcheglov 49503ac2cc Start using Kernel metadata support in KernelDriver and Analyzer.
Use it to implement documentation comments for typedef(s).

R=ahe@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: I6f67f1c0e6b6f383a96e6bf6eee17f4786bc5f99
Reviewed-on: https://dart-review.googlesource.com/12700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-10-13 17:47:53 +00:00
Vijay Menon 0553e2ba15 Regen DDC SDK
TBR=rnystrom@google.com

Change-Id: I4406552de08e379cac8a75f9c8e0e353dd927a21
Reviewed-on: https://dart-review.googlesource.com/13440
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-10-12 04:07:05 +00:00
Jennifer Messerly 8c36b4685f fix #31049, fix #31050, avoid name collision for static members
Change-Id: I5a14315b99ace15aa6ac0c67f753bc3e1f39b3a9
Reviewed-on: https://dart-review.googlesource.com/12481
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-11 21:00:02 +00:00
Vijay Menon 4917131ff4 Regen DDC sdk
TBR=rnystrom@google.com

Change-Id: I58e832edd16bd6b864eadb27b91dc3645be13e90
Reviewed-on: https://dart-review.googlesource.com/13001
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-10-11 15:19:10 +00:00
Zachary Anderson dcd275fa74 [dart:io] Begins work on mocking support
Change-Id: I770ed9485a934af07e570fbad3f3fb84ebef973d
Reviewed-on: https://dart-review.googlesource.com/3302
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-10-10 17:39:12 +00:00
Vijay Menon c1d45769c3 Inline constant values
Change-Id: Iee929bc64c152be989e6e7ba38132f806c33c7e0
Reviewed-on: https://dart-review.googlesource.com/11960
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-10-10 13:21:41 +00:00
Jennifer Messerly 32eb7e3612 fix #30944, mark specific nodes with source information
This change fixes bugs that users see when we mark declaration code,
while also reducing the source map size (improving startup & reducing
the load on devtools). The SDK source map is reduced by 41%.

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

Change-Id: Ie50c6aca873be7b7c0f7c238a9db2001acbceb5c
Reviewed-on: https://dart-review.googlesource.com/10210
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2017-10-10 03:40:40 +00:00
Jennifer Messerly c05a4439bc fix DDC handling of @notNull annotation for ?. method calls
Change-Id: I9be22e126ff32c16a90fc85e3d754258e9fc98c3
Reviewed-on: https://dart-review.googlesource.com/12344
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-10 00:35:31 +00:00
Vijay Menon 05619da8ea Optimize String.length
Change-Id: I7e8481c8822d170492112704e04b92b19d5e5f2e
Reviewed-on: https://dart-review.googlesource.com/12340
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-10-10 00:22:36 +00:00
Bob Nystrom f68169796b Don't need to unsafe-force-compile unittest anymore. :)
Change-Id: Ie393a91bbef5427ff6951f33c110813bfbde6719
Reviewed-on: https://dart-review.googlesource.com/12081
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-06 21:10:18 +00:00
Vijay Menon a7e5d104bf Fill array on allocation
Fixes #31002

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

Change-Id: Id44acf3d9bf8cb153a4755aa28df08fe91bfc633
Reviewed-on: https://dart-review.googlesource.com/8167
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-04 19:04:27 +00:00
Vijay Menon d6582a9d1b Use unique proto object for each library object
This appears to	 improve Gabriel's is-check benchmark by 2x and
DeltaBlue by about 30% (DDC on d8-tip).

I suspect this is improving inlining of top-level accesses on library
objects (including helpers like dart.is).

Change-Id: I1629d821b481194075a80dd6858334c1f678dd12
Reviewed-on: https://dart-review.googlesource.com/7446
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-10-04 18:06:59 +00:00
Vijay Menon d22557b560 Regen DDC SDK
TBR=rnystrom@google.com

Change-Id: I50cb06235bb5f9a0bd8cae8e7cc6500c33c812c2
Reviewed-on: https://dart-review.googlesource.com/10703
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-10-03 21:49:21 +00:00
Jennifer Messerly 3a907e5cab add a script to build DDC's SDK to a dill file
Change-Id: I93f9d55bd99a3b98ee823c38255e9a8081954a4b
Reviewed-on: https://dart-review.googlesource.com/10213
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-03 20:27:12 +00:00
Jennifer Messerly e5de4e2aaa fix #30966, generate signature info for native setters
Change-Id: I512a3c74ceffcab3013791b82c92cee16d804af8
Reviewed-on: https://dart-review.googlesource.com/10207
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
2017-10-03 02:55:27 +00:00
Jennifer Messerly 05ba807d43 fix #30925, optimize x is T when x is null
Change-Id: Id99a2ce821c49c4dcce098fe119aab63e916b3ab
Reviewed-on: https://dart-review.googlesource.com/9792
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-02 20:45:29 +00:00
Vijay Menon 8a81bdf64a Regen DDC sdk
TBR=jmesserly@google.com

Change-Id: I9a02f4e06d84df2f2794180755d6cb2dea2f767e
Reviewed-on: https://dart-review.googlesource.com/10160
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-10-02 19:45:37 +00:00
Vijay Menon 3e8f4dce13 Regen DDC SDK
TBR=jmesserly@google.com

Change-Id: I875cacca1a71cfb499f707e088195bad13ba3502
Reviewed-on: https://dart-review.googlesource.com/9740
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-09-29 16:56:32 +00:00
Jennifer Messerly 9978b808b4 implement NoSuchMethodError.withInvocation in DDC
Change-Id: If51546abb290d2956bacce9b5ae5adf6f2ca2d11
Reviewed-on: https://dart-review.googlesource.com/9429
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-28 23:39:43 +00:00
Jennifer Messerly 749d298b6c fix extension member discovery in DDC
In particular, some types like the base/mixin classes for Map in dart:collection did not work correctly.
This also has cleanups/optimizations to how DDC registers signatures, partially addressing #30499
Also fixes #29897, const maps are now immutable in DDC.

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

Change-Id: I7352d0caefe12f3d8a10d1383cfb2ec983b1051b
Reviewed-on: https://dart-review.googlesource.com/9368
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-28 22:27:22 +00:00
Jennifer Messerly 13b57ceafe fix #30912, record scope dependencies on unused typedef type arguments
Change-Id: Ic859620fb4ff7f9965b46849aa96eb74dfe59ccb
Reviewed-on: https://dart-review.googlesource.com/9125
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-28 21:25:31 +00:00
Jennifer Messerly a784320a99 fix #30852 - if static field init throws, it should return null after
Change-Id: Ibf273deee51be4b187dbb6d4d7f66dc35dd16fed
Reviewed-on: https://dart-review.googlesource.com/8240
Reviewed-by: Vijay Menon <vsm@google.com>
2017-09-28 18:07:58 +00:00
Vijay Menon 9ab7137ede Regen ddc sdk
TBR=leafp@google.com

Change-Id: Ia5721ff75771f3eec20eaf664d3977cbbc126b70
Reviewed-on: https://dart-review.googlesource.com/8741
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-09-27 03:03:25 +00:00
Vijay Menon 0a9253ef30 Regen SDK
Looks like merge conflicts on crossing CLs.

TBR=leafp@google.com

Change-Id: Iee2c42e53d03c57fc07f18b46635f423927a1b17
Reviewed-on: https://dart-review.googlesource.com/8700
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-09-26 17:00:11 +00:00
Vijay Menon 2ba49b4ac0 Utility for building / running on d8
Change-Id: I8ba4c7ce37d9a5fcf7742ecfdac4c0df48dc9497
Reviewed-on: https://dart-review.googlesource.com/7845
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-26 16:09:51 +00:00
Leaf Petersen 8c924f2923 Tighten the is check in handleError.
Bug:
Change-Id: I23f49f65a395579293f0567e8069ccd931e00c4a
Reviewed-on: https://dart-review.googlesource.com/7842
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-09-26 13:38:05 +00:00
Leaf Petersen e350bb4565 Eliminate fuzzy arrow uses in SDK libraries.
Bug:
Change-Id: Ia1a00966b8d77c5aa812ed19eca136c47132ae58
Reviewed-on: https://dart-review.googlesource.com/8540
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-09-26 12:56:05 +00:00
Leaf Petersen e0c2e8191f Eliminate fuzzy arrow from conversions_dart2js.dart
Bug:
Change-Id: Ide970d2a5353e53af9f0a73748b12b2fb770ebcb
Reviewed-on: https://dart-review.googlesource.com/7941
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-26 10:37:48 +00:00
Vijay Menon ed8d1d32e6 Regen DDC SDK
TBR=leafp@google.com

Change-Id: I830fb4b0f293a5b9805907f461e57ccf48214363
Reviewed-on: https://dart-review.googlesource.com/7740
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2017-09-22 15:29:37 +00:00
Gary Roumanis c69a9274d3 Don't annotate FunctionDeclarations
Bug:38419508
Change-Id: I5298fcd31e058bb4958136775e67d955a3feb010
Reviewed-on: https://dart-review.googlesource.com/7630
Commit-Queue: Gary Roumanis <grouma@google.com>
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-21 23:05:39 +00:00
Zachary Anderson 2948f8c1b7 Reland: [dart:io] Moves Http code into a separate library.
This moves Http code into dart:_http. dart:io then imports and
re-exports dart:_http. This is the first stage of moving
dart:_http into its own pub package.

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

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

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

This reverts commit ac9ff3f3af.

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

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

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

Change-Id: I0bd6dc1438eb1e6762e7760a08b5a760b07d4b10
Reviewed-on: https://dart-review.googlesource.com/4942
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-09-20 15:46:06 +00:00