Commit Graph

4835 Commits

Author SHA1 Message Date
Johnni Winther 263931bd33 Small cleanups to avoid warnings in IntelliJ
Change-Id: I02214d21a910def67184e49765af3020848389d9
Reviewed-on: https://dart-review.googlesource.com/71941
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-08-30 06:47:38 +00:00
Johnni Winther 185eec12a6 Avoid crash on falsely enqueued .call methods.
Change-Id: Ib58b02eecfc697f70e74cbb9f5e5816fb936a31b
Reviewed-on: https://dart-review.googlesource.com/71400
Reviewed-by: Stephen Adams <sra@google.com>
2018-08-29 07:29:38 +00:00
Stephen Adams ecfc03c3d1 dart2js: fix crash on setter with FutureOr type.
TBR=johnniwinther@google.com

Change-Id: Idc82430ccbee697201401ed7ebcb11c34cb3d8ce
Reviewed-on: https://dart-review.googlesource.com/71429
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-08-24 22:42:21 +00:00
Stephen Adams e1df47b15e Add closure signature to dependencies
Adds these missing dependencies to the deferred loading partition:

1. Signature of a local function / closure.
2. Bounds of type variables.

TBR=johnniwinther@google.com

Change-Id: I201d08cf874381e58e161d2f910b60d83932968c
Reviewed-on: https://dart-review.googlesource.com/71120
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-08-22 22:04:54 +00:00
Johnni Winther 75943282e5 Delete Flags.strongMode and references to it
Change-Id: Ia1af10f04224f172afb7dac1e88338d20467364b
Reviewed-on: https://dart-review.googlesource.com/70646
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-08-22 07:03:24 +00:00
Johnni Winther d456532124 Disallow non-js interop external members
Change-Id: Ic73a3e2b16bdf77a2cd94fdcfaffe7989a798909
Reviewed-on: https://dart-review.googlesource.com/70513
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-08-22 06:59:46 +00:00
Stephen Adams ceace12724 dart2js: Work-around for imprecise calledOnce info
Change-Id: Id1118a394a2be5c8a1844ce40ce33512239bf650
Reviewed-on: https://dart-review.googlesource.com/70843
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-08-21 17:02:13 +00:00
Johnni Winther 244c9bebec Remove STRONG_MODE flag
Change-Id: I260be375925dde43703f64e83e09ed924e44e669
Reviewed-on: https://dart-review.googlesource.com/70641
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-08-21 08:21:02 +00:00
Johnni Winther 814738b273 Remove CompilerOptions.strongMode/enableTypeAssertions/trustTypeAnnotations
Change-Id: I4a51b081f42d76f12c70c140286c28375fcbd5ce
Reviewed-on: https://dart-review.googlesource.com/70515
Reviewed-by: Stephen Adams <sra@google.com>
2018-08-21 08:21:02 +00:00
Johnni Winther d7c71862da Check setters in Dart 2
Change-Id: I3a0bb90f34072cb4ef47f2712c43e4779b92fbdd
Reviewed-on: https://dart-review.googlesource.com/70514
Reviewed-by: Stephen Adams <sra@google.com>
2018-08-21 08:21:02 +00:00
Johnni Winther 3af2f793ac Remove --no-preview-dart-2 from dart2js
Change-Id: I17a18ebe905fa60ba2a1b41af2f444cfe58a38a2
Reviewed-on: https://dart-review.googlesource.com/70512
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-08-20 09:18:02 +00:00
Stephen Adams e02ec040cb @dart2js.tryInline should not inline methods that can't be inlined
Change-Id: I1efc13b64d7740dbe904364e44fa6e6b9be0fd81
Reviewed-on: https://dart-review.googlesource.com/70440
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-08-17 22:14:03 +00:00
Johnni Winther 2c3e093208 Register implicit .call invocations.
Change-Id: I3dbfbe8d974474aaf8488a4432eeb988bc380be6
Reviewed-on: https://dart-review.googlesource.com/69966
Reviewed-by: Stephen Adams <sra@google.com>
2018-08-17 12:05:48 +00:00
Johnni Winther 1285506aec Register need for constructors used in instanceof checks
Change-Id: Ibc84f859a10517e4b34317a1feea0563633ee2fa
Reviewed-on: https://dart-review.googlesource.com/70262
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-08-16 20:50:36 +00:00
Vyacheslav Egorov aa8145a03d [vm/kernel] Add a transformation that annotates invocations with receiver type.
Currently we only annotate those call-sites that would result
in generic covariant checks performed on the callee side.

Bug: https://github.com/dart-lang/sdk/issues/31798
Change-Id: Ifcf60032036575f615015d716276484a7c1236b3
Reviewed-on: https://dart-review.googlesource.com/69580
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-08-16 12:30:56 +00:00
Keerti Parthasarathy b99e41ac6f Revert "fix #28233, add hint for missing returns to function expressions"
This reverts commit 058510eeab.

This causes a lot of missing_return failures internally and requires time to fix.

Change-Id: I2c7a79c6e838bbd9f101f53919b1db2c0d4a2594
Reviewed-on: https://dart-review.googlesource.com/70024
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2018-08-14 21:10:27 +00:00
Sigmund Cherem 8a05c944cd Remove JsInvocationMirror._invokeOn
I believe this was code only used via dart:mirrors

Soon we might want to rename JSInvocationMirror to just JsInvocation (so it's
clear that it is only used for nsm)

Change-Id: I0e0f836b18e6f290311c7173cfafedfcccab5c6f
Reviewed-on: https://dart-review.googlesource.com/69246
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-08-13 18:09:14 +00:00
Harry Terkelsen 5d4e85ba3d Allow x == null to be a constant value whenever x is const.
This is the fix for #33408 for dart2js

Change-Id: Ifddeacb68884da308d279ce6d5cbbb6adc5385ca
Reviewed-on: https://dart-review.googlesource.com/69020
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-08-09 23:48:21 +00:00
Stephen Adams 4d156f9fb0 [dart2js] Fix function_type GVN bug
Fixes #30476

Change-Id: Ie1e536c197b137ccddeeaa45d337f1bd16a2ff78
Reviewed-on: https://dart-review.googlesource.com/68848
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-08-08 00:05:14 +00:00
Stephen Adams 7cf2607344 Make minified names explicit in printed representation of types.
Supports mixed minified and unminified names (like `List` and `num` below).

Example:
TypeError: Closure 'minified:b3': type '() => minified:o<minified:k<num>>' is not a subtype of type 'List<minified:o<minified:k<num>>>'


Change-Id: I1fc67f189170eb9b9c8614b1e3d33128adc49787
Reviewed-on: https://dart-review.googlesource.com/67303
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-08-06 22:28:11 +00:00
Stephen Adams 315216e2e2 [dart2js] Avoid collision with getInterceptor.
getInterceptor now always goes via HInterceptor, ensuring the back end
knows to generate the unspecialized interceptor. We no longer generate
the unspecialized interceptor as *shadowing* the js_runtime
definition. In small programs where interceptors are not used except
via js_runtime.getInterceptor, the program would fail on the value
returned by the dummy body, since it was not shadowed.

This gets rid of the two definitions of getInterceptor (issue 9180).

Change-Id: Ibfa73f26d7d432273d5e755e2165ab6c2d48ad4f
Reviewed-on: https://dart-review.googlesource.com/68002
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-08-04 00:15:53 +00:00
Sigmund Cherem 09a8660c14 fix typo
TBR=johnniwinther@google.com

Change-Id: I0cda68e63595bb30374bb705341206bc3fffcd2b
Reviewed-on: https://dart-review.googlesource.com/68429
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-08-03 21:48:36 +00:00
Stephen Adams 91caf82497 Do self-interceptor optimization on a per-use basis
The new code guards against updates when the interceptor is data and
not used as an interceptor.

Change-Id: Ibf6c0ca5f7efe859e82646aee6e571de82417bfe
Reviewed-on: https://dart-review.googlesource.com/68424
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-08-03 21:35:27 +00:00
Sigmund Cherem e402732eff Improve documentation of the -O flag
TBR=sra@google.com,vsm@google.com

Change-Id: Ib42647ab59313bdfa49df73c25282d0d734d6462
Reviewed-on: https://dart-review.googlesource.com/68140
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-08-02 18:48:21 +00:00
Sigmund Cherem d3df394870 Add -O flag and documentation.
The idea is to provide a flag that can be stable through time, even as we add
and remove certain optimizations.

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

Change-Id: Ic07bf2148308b7530f2a69d7ebecb8fd7bf2d4cc
Reviewed-on: https://dart-review.googlesource.com/67921
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-08-02 00:36:53 +00:00
Sigmund Cherem 918cda18c5 Add docs about sourcemap extensions
Change-Id: Ic785e6e73a04be8d026e04766c8c505abde6a84a
Reviewed-on: https://dart-review.googlesource.com/67687
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-07-31 23:40:39 +00:00
Sigmund Cherem cb7341fceb Initial support for inlining-data in source-maps.
This starts tracking inlining data and records it as an extension
to source-map files so we are able to expand inlined calls when
deobfuscating production stack traces.


Change-Id: I46daf21c2f42305b2bd6ca17fbafb65226355096
Reviewed-on: https://dart-review.googlesource.com/67083
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-07-31 21:41:50 +00:00
Sigmund Cherem 4206131030 Fix tracking of onStep position of arguments to new expression
Change-Id: I359577055555b9372b60fc2485ac1a9354e98427
Reviewed-on: https://dart-review.googlesource.com/67481
Reviewed-by: Stephen Adams <sra@google.com>
2018-07-31 21:41:50 +00:00
Jenny Messerly 058510eeab fix #28233, add hint for missing returns to function expressions
If a function expression is used in a context that expects a return type
other than dynamic/void/Null, issue a hint if that function has a block
body and is missing a `return` statement.

Change-Id: Ia55212abd84f5718343cf7401b87aba2891d6446
Reviewed-on: https://dart-review.googlesource.com/66340
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-28 01:50:31 +00:00
Stephen Adams 29b893b124 [dart2js] Evaluate map literal key before value
Change-Id: I41c0c004ddd3f04c0eb48520df7f92ed86d7c8b7
Reviewed-on: https://dart-review.googlesource.com/67206
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-07-27 21:55:40 +00:00
Stephen Adams 881894e13d Document describing interceptor optimizations
Change-Id: I02a0413989b5950e21cc6df401ad0f6295614c8d
Reviewed-on: https://dart-review.googlesource.com/62962
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-27 03:29:36 +00:00
Sigmund Cherem 55726c8b3e Do not emit minified names in the deferred source-map files
Change-Id: Ie3ed131248cc5677c3f493fbe7dc2bba0bb5cec3
Reviewed-on: https://dart-review.googlesource.com/67082
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-07-27 02:23:38 +00:00
Sigmund Cherem e3b5bfd854 Store original names in the minified name map
Change-Id: I411125aebe08fee10f1eeee4e6f30623cb0d7854
Reviewed-on: https://dart-review.googlesource.com/65795
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-07-20 23:50:45 +00:00
Sigmund Cherem ca0123ac70 Call KernelImpactBuilder._visitArguments once in visitStaticInvocation
Change-Id: I2602545f116c1de26932c22460a644fe348e20a1
Reviewed-on: https://dart-review.googlesource.com/65789
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-07-20 15:48:09 +00:00
Johnni Winther 555cca2b1a More cleanup in inferrer engine
Change-Id: Ia7f52b46b327c4cef21c775a5f25afc9f4dde452
Reviewed-on: https://dart-review.googlesource.com/65681
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-20 12:28:28 +00:00
Johnni Winther 4273bb2e2a Remove TypeUse.mirrorInstantiation
Change-Id: I7a85970a2559489cb8fda5612a300c53562856ed
Reviewed-on: https://dart-review.googlesource.com/65544
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-20 12:28:28 +00:00
Sigmund Cherem 35b08dec12 Add minified names to sourcemaps
This change:

* introduces a sourcemap extension to store minified names from the global and
instance namespaces.

* adds a test suite to test that this information is accurate

This is just an initial step: at this time names come from proposed names, which
include extra stuff we don't want. On a later CL I plan to change this to be
able to get the original name instead.

For example, I want to add a test for translating an instance method, right now
we would get "@method@0@" or "method$0" instead of "method".

Change-Id: I411c3bea96446e29e80581750250349799332b9a
Reviewed-on: https://dart-review.googlesource.com/65660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-07-19 18:50:27 +00:00
Johnni Winther 335f0ab333 Remove EnqueuerStrategy
Change-Id: Id36d4a77d40ca9a70130a4c3ee6e84f68435153d
Reviewed-on: https://dart-review.googlesource.com/65543
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-07-19 08:10:15 +00:00
Johnni Winther 406b6e8866 Flatten inferrer implementation
Change-Id: I0dc59ccc3f02c95c545033ed124f3d475792d72f
Reviewed-on: https://dart-review.googlesource.com/65542
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-19 08:10:15 +00:00
Johnni Winther ec733c3b3c Support more type arguments in generic instantiation
The real solution requires more work, so this is to buy us some time.

Change-Id: I033a77d05c0ca7658475d1fe59760ce4e5919f7e
Reviewed-on: https://dart-review.googlesource.com/65541
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-19 08:10:15 +00:00
Johnni Winther 70747047b0 Add hint for .runtimeType.toString()
Change-Id: I0a20f1fc42bc475c9acdf40b3d8aae16edbc8ea9
Reviewed-on: https://dart-review.googlesource.com/64845
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-19 08:09:15 +00:00
Jenny Messerly 3320d8f677 fix #31237, missing return hint was missing for inferred returns
Change-Id: I3c8c59f31196b220aaa0421f8357a950ff16ba20
Reviewed-on: https://dart-review.googlesource.com/62727
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-07-19 00:19:24 +00:00
Sigmund Cherem 11f3c57e9c Fix deferred type literals and typedefs
Closes https://github.com/dart-lang/sdk/issues/33890

Change-Id: I3a154d4de46747f3ad905de889f14188fdfff50a
Reviewed-on: https://dart-review.googlesource.com/65442
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-07-18 18:28:21 +00:00
Johnni Winther 7c27ebe8e3 Remove unused messages
Change-Id: I3b81dd5dfecf2dee881ec1901d68df71aa703260
Reviewed-on: https://dart-review.googlesource.com/64844
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-07-18 10:28:59 +00:00
Johnni Winther 4a01dc66bc Fix crash in inferrer_engine
Closes #33810

Change-Id: I25ec7ab62dbd6a54331ee0f777644da3ddad1135
Reviewed-on: https://dart-review.googlesource.com/65300
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-07-18 09:46:28 +00:00
Sigmund Cherem a7e511f4dc Fix order of named arguments in nsm-forwarders
Change-Id: I4fa9c3165c61e675be87978441093b9ee664a29d
Reviewed-on: https://dart-review.googlesource.com/65204
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-07-17 16:05:50 +00:00
Johnni Winther 6acee7cdb7 Fix tracking of native classes needed for rti.
Closes #32286
Closes #33690

Change-Id: Ic62c145ca7bb5257d71c0d062b111b183258b7d0
Reviewed-on: https://dart-review.googlesource.com/64343
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-16 10:09:06 +00:00
Johnni Winther 117f651f7b Emit classes used in type variable replacements
Change-Id: Iad3bf28790172e364d83a96003fb7ef96f25747e
Reviewed-on: https://dart-review.googlesource.com/64322
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-16 10:09:06 +00:00
Johnni Winther 97319b838a Decouple library loader from the K-world
Change-Id: I74cb28960b29a63c225bb259c19b9023424ea74a
Reviewed-on: https://dart-review.googlesource.com/64340
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-12 08:07:05 +00:00
Leaf Petersen b5fe750007 Strong mode fixes to kernel and dart2js
Change-Id: Ic51e0bbc31cf993ffb7d2ec6909b96c7ace964ed
Reviewed-on: https://dart-review.googlesource.com/63342
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2018-07-10 19:19:24 +00:00