Commit Graph

1025 Commits

Author SHA1 Message Date
Vijay Menon 8a64625d81 Regenerate DDC artifacts
TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2830983002 .
2017-04-19 16:26:22 -07:00
Jacob Richman 0dbb32f406 Run formatter on dev_compiler.
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2830503002 .
2017-04-18 16:16:14 -07:00
Jacob Richman b280a7803d Dev compiler debugger related tweaks.
Optimize dynamic call tracking using random sampling.
Apply source maps to improve dynamic call tracking accuracy.
Dynamic calls within the sdk are now attributed correctly.

Fix bug formatting modules where we were incorrectly flagging them as JS.

BUG=
R=jmesserly@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2811343002 .
2017-04-17 14:57:31 -07:00
Vijay Menon a3d2e49198 Revert "Revert "Report error if the same uri appears in multiple summaries.""
Relanding after fixing package_bundle_reader_test.dart.

Note, original CL (already reviewed here: https://codereview.chromium.org/2781483007/) is patch set 1.

Test fix is patch set #2.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2825503002 .
2017-04-17 10:11:21 -07:00
Vijay Menon dcdccf4750 Revert "Report error if the same uri appears in multiple summaries."
This reverts commit 2afa21bb2c.

Breaking the bots.

TBR=jmesserly@google.com
BUG=

Review-Url: https://codereview.chromium.org/2821933002 .
2017-04-17 08:07:36 -07:00
Vijay Menon 2afa21bb2c Report error if the same uri appears in multiple summaries.
Fixes #27025

R=brianwilkerson@google.com, jmesserly@google.com

Review-Url: https://codereview.chromium.org/2781483007 .
2017-04-17 07:32:59 -07:00
Jennifer Messerly b76e2d67cf fix #29346, ensure all nodes are implemented by DDC's code generator
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2822633003 .
2017-04-14 10:10:50 -07:00
Alan Knight 04bb68bb09 Better DDC sourcemap generation for lambdas
This doesn't fix the entire problem, there's still a Chrome issue that it's not clear we can work around, but it helps some. https://bugs.chromium.org/p/chromium/issues/detail?id=676388

There are three distinct issues here affecting Chrome sourcemap usage for DDC programs with single-line lambdas.

1 - We may introduce a synthetic "as SomeType" in a parameter. The synthetic token ends up with a large negative length, from its offset to the beginning of the file, which can confuse sourcemaps.

2 - We have no entry for the blank line following the lambda. The devtools asks for the mapping from (selectedLine, 0) to (selectedLine +1, 0) and if there's no mapping for either it refuses to set the breakpoint. So this artificially forces the mapping from the last character on the line to be to the beginning of the next line instead.

3 - With a lambda we introduce a constructed Return JS node and make a block. Those nodes weren't getting annotated, so they had no source information.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2815443003 .
2017-04-12 11:31:16 -07:00
Vijay Menon bc3089838c Reify implicit casts for FutureOr
Before landing, two issues to resolve:
(1) We appear to allow sideways casts now without static error - e.g.,

List<Object> -> FutureOr<List<String>>

Is that intended?  If so, it breaks an assumption that implicit casts
are from supertype to subtype.

(2) LUB and FutureOr

It appears that the LUB of, e.g., String and Future<String> is Object.
See fixes in tests to record casts back to FutureOr.

Fixes #29251

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2801683004 .
2017-04-07 17:33:34 -07:00
Vijay Menon 10c5de82c8 Invoke debugger on nsm
Missed this one when I added debugger statements earlier

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2565183004 .
2017-04-07 14:45:09 -07:00
Jennifer Messerly 8ada796a86 fix #29233, final fields can be settable in a mock
also fix #29273, user mixins can override native methods

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2803673007 .
2017-04-07 14:12:49 -07:00
Vijay Menon 5c3bcff375 DDC fix for foreign futures
Fixes #29287

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2804113002 .
2017-04-06 14:52:59 -07:00
Jennifer Messerly 247fc68d21 fix #29228, let* precedence should match generated expression
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2804833002 .
2017-04-05 12:40:42 -07:00
Vijay Menon aa3fba7d8d Preserve async markers when parsing js_ast
Fixes #29252

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2797873002 .
2017-04-05 12:13:22 -07:00
Jennifer Messerly e4e7dffadb fix #29182, generate top level const fields lazily
This fixes an ordering issue, but also may help load time.

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2797443007 .
2017-04-04 16:18:46 -07:00
Jacob Richman 509bcd58e1 Fix type checks and display for JS interop types.
Re-enable formatter test that had been disabled when someone changed type
name display for Foo<dynamic> types.
Fix bug in how type names were displayed for JS interop types.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2789663005 .
2017-04-03 08:34:20 -07:00
Vijay Menon 08f085727e Fix ignore on FutureOr
I'll look into adding tests - these eventually supposed to *not* get ignored (see #27223)

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2788933002 .
2017-03-31 09:30:16 -07:00
Jacob Richman a7465d942f Update test expectations to reflect errors that are now warning.
BUG=

Review-Url: https://codereview.chromium.org/2785183003 .
2017-03-30 14:54:35 -07:00
Vijay Menon 84864e3415 DDC fix for Edge
Patch from zjd.

R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2780903004 .
2017-03-29 12:22:45 -07:00
Jennifer Messerly 1c504f8945 Fix #28120, strong mode allows field overrides
Fix #28119, DDC supports field overrides without @virtual
Fix #28801, devirtualize private fields in DDC where possible
Fix #28589, stop supporting @virtual in strong mode

R=leafp@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2781443003 .
2017-03-28 10:26:36 -07:00
Vijay Menon 50ceaa4c04 Fix for #29003
This is an alternative to the other CL.  It just uses the result of
dart.mixin instead of declaring a new class.  That preserves the assumption (at least at runtime) that the mixin class directly inherits from Object.

We were also not declaring interfaces for ClassTypeAliases.

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2783443002 .
2017-03-27 16:06:13 -07:00
Vijay Menon ac68d598cf Add patch code for List.filled growable param
Looks like a missing param doesn't break patch_sdk.  I think this was a recent add.

Fixes #28508

R=jakemac@google.com, jmesserly@google.com

Review-Url: https://codereview.chromium.org/2771953004 .
2017-03-24 14:27:47 -07:00
Leaf Petersen dba842bcc8 Handle casts from Number to FutureOr<double>.
Fixes https://github.com/dart-lang/sdk/issues/29128 .

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2772573003 .
2017-03-23 13:33:33 -07:00
Vijay Menon 053d2ce14f Fix for dcall on callable class
(Note, regenerated files aren't being uploaded)

Fixes #29148

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2774623004 .
2017-03-23 13:14:58 -07:00
Vijay Menon c3505f7d72 Fix async iterator runtime type errors
Seeing errors on the bots triggered by a recent SDK change (FutureOrT typing?).  See travis for current breakage.

TBR=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2769883002 .
2017-03-22 20:15:00 -07:00
Kevin Moore 2340c8f6df Clarify in dev_compiler docs the reason for the angular whitelist hack
Related to https://github.com/dart-lang/sdk/issues/27255

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2772433002 .
2017-03-22 11:36:11 -07:00
Jennifer Messerly 132ddcaacf fix errors and warnings in DDC
TBR=vsm@google.com,jacobr@google.com

Review-Url: https://codereview.chromium.org/2768693003 .
2017-03-21 20:12:05 -07:00
Jennifer Messerly 4f9fff9ebd fix #29108, improve inference error messages
R=leafp@google.com

Review-Url: https://codereview.chromium.org/2757233004 .
2017-03-20 18:12:46 -07:00
Jennifer Messerly f021a7019b fixes #27586, prefer downwards context type in generic inference
fixes #27625, Object constraints were not tracked in inference
fixes #27933, pin return type from downwards inference

We now prefer to pick the bound (lower or upper) that had some information on, and it also improves inference error messages somewhat (still a ways to go).

The way this works is we now have a type representing an unknown type: ?. We use ? when performing downward inference steps, instead of `dynamic`. This allows more accurate tracking of type constraints.

For example: given:

    var x = await Future.wait([a, b]);

Future.wait<T>'s argument type is Iterable<Future<T>>. Since we didn't know T, we previously pushed down Iterable<Future<dynamic>>. The dynamic caused loss of information. Now we push down Iterable<Future<?>>, allowing us to infer the right type there.

R=leafp@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2456803004 .
2017-03-17 16:59:56 -07:00
Jennifer Messerly 13d6c5cd98 fix ddc build, adds some unsupported methods to dart:io
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2756463006 .
2017-03-17 16:23:52 -07:00
Jacob Richman 00dd9f26a6 use js_ast to more efficiently turn the JSON into a string.
js_ast will notice the string only contains double quotes so will enclose
it with single quotes.
Parsing a string appears to be a bit more efficient than parsing JSON.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2757603005 .
2017-03-17 08:17:47 -07:00
Vijay Menon 24fd5ced4f Expand ignore whitelist to include FutureOr
See internal bug 36371258.

We're hitting type errors of the form:

CastError: Casting value of type '_Future' to incompatible type 'FutureOr<int>'

I suspect these type errors were there but just ignored before - does this seem a reasonable extension to the whitelist?

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2752203003 .
2017-03-16 20:05:09 -07:00
Vijay Menon 2fd1f5ebf1 Fix FutureOr runtime check
Fixes #29062

This is taken straight from Jen's CL here:

https://codereview.chromium.org/2456803004/

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2750393003 .
2017-03-16 12:54:22 -07:00
Jacob Richman 9484ac8bdf Format all dart dev compiler files
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2752163002 .
2017-03-15 21:34:25 -07:00
Jacob Richman b4828c39cf Fix for bug when binding non-symbolized members on native classes
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2757503002 .
2017-03-15 18:56:04 -07:00
Vijay Menon 338304a6c7 Fix DDC patch
TBR'ing to get build green.

TBR=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2749703006 .
2017-03-15 09:23:49 -07:00
Vijay Menon ee6f460847 Fix equality invocation on native objects
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2754583002 .
2017-03-14 15:27:27 -07:00
Vijay Menon 6fb0258bf4 Support iife heuristic in DDC
This gives a noticeable 5-10% boost to startup on large internal apps
in Chrome.  We may want to consider for AMD at some point.  It doesn't
apply to es6 or common as those are top-level (and either the browser
or linker would hopefully parse accordingly).

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2753623002 .
2017-03-14 14:16:28 -07:00
Devon Carew b80390d0f5 Have dartdevc support --version.
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2747743003 .
2017-03-13 16:10:21 -07:00
Jacob Richman c9675aeefb Do not return the JSON as an escaped String to work around a strange v8 bug.
This makes the source files a little easier to read anyway and the JSON
is not typically that nested so there should be a minimal statup performance hit.

Do not return the JSON as an escaped String to work around a strange v8 bug.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2747733003 .
2017-03-13 15:49:09 -07:00
Vijay Menon f331ecea20 Invoke native methods directly
In DDC, if the receiver is typed and the target method simply forwards to a JS call, invoke that call directly instead of via a symbol.

This is a step toward #28307.

Paul: can you look the the analyzer / summary code change?

dart:html uses "native".  other libraries (e.g., typed_data) use "external" for more or less the same thing.  The analyzer element model doesn't provide a way to test for "native" methods, but it does for "external".  I map native to external here.  Not sure if it's better to treat them as separate (I believe native predated external).  Longer term, it may make sense to try to remove "native" in favor of "external".

R=brianwilkerson@google.com, jacobr@google.com, jmesserly@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2748713002 .
2017-03-13 15:11:37 -07:00
Jacob Richman 1f38879094 Inline source maps as part of each script.
Unfortunately this is required as even with ideal caching, performing
XHRs to load all source maps increased load times by ~5 seconds for large
applications. Performance hit is now minimal.

BUG=

Review-Url: https://codereview.chromium.org/2747513003 .
Review-Url: https://codereview.chromium.org/2746033003 .
2017-03-13 10:46:02 -07:00
Jacob Richman 7ba7e0cee6 Make all DDC internal stack traces apply source maps.
Make DDC a better platform for debugging by ensuring that stack traces
generated by DDC even when using the raw dart:core StackTrace class
apply JS source maps and benefit from the polish provided by the
stack_trace package.

stack_trace_mapper.dart needs to be compiled to js and included on your
page to benefit from this functionality. Otherwise you will still see
regular JS stack traces as usual.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2735303002 .
2017-03-08 19:13:00 -08:00
Vijay Menon 0c23c9229e Fix custom formatter setup, take 2
R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2738103003 .
2017-03-08 19:08:11 -08:00
Vijay Menon 089d9c4afa Fix custom formatter setup
R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2742653002 .
2017-03-08 18:58:07 -08:00
Vijay Menon 402e025c63 Add option to suppress type-check whitelisting
Run most tests without the whitelisting.

See #27223

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2739863003 .
2017-03-08 17:51:32 -08:00
Vijay Menon 01508dd2e2 Fix mocking on native classes
Fixes #28658

R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2732413002 .
2017-03-07 15:32:54 -08:00
Vijay Menon f6e964fca9 Fix dangling ddc references in libraries.dart
Our internal tooling is complaining about this when building / checking the ddc sdk.  It appears to use the analyzer's summary builder tool which seems less forgiving about dangling references / missing files.

R=srawlins@google.com

Review-Url: https://codereview.chromium.org/2740573003 .
2017-03-07 15:27:46 -08:00
Vijay Menon 2acb2eb669 Update for latest tests and sdk
TBR=leafp@google.com

Review-Url: https://codereview.chromium.org/2731333002 .
2017-03-06 09:36:14 -08:00
Jacob Richman a6a206062d Custom formatter cleanup Fix case where displaying a class constructor generated unreadable huge output. Fix case where exceptions were throw. Correct display of statics, fix indentation bugs. Add improved custom formatter test to main repro. As a drive by fix, switch hashCode to use a symbol instead of the name $identityHash as $identityHash was making custom formatter test output unstable.
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2703263002 .
2017-02-28 17:47:53 -08:00