Commit Graph

4698 Commits

Author SHA1 Message Date
Johnni Winther 8f4db274f1 Compute which selectors that need type arguments
Change-Id: I0e48ff67353d676ea77d13008ae46f79bb69336e
Reviewed-on: https://dart-review.googlesource.com/45321
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-07 13:46:49 +00:00
Johnni Winther 8831dd1308 Remove failing assertion
Change-Id: Idfc2656460e2e6e63948172d63f90585be65d19d
Reviewed-on: https://dart-review.googlesource.com/45320
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-03-07 12:22:33 +00:00
Johnni Winther 6b91b4f2d2 Remove RuntimeTypesNeed.classUsesTypeVariableLiteral
Change-Id: Ibd9ccb5308b9170296f81ed18a35f212283b9afa
Reviewed-on: https://dart-review.googlesource.com/44783
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-07 12:02:31 +00:00
Peter von der Ahé 18fe31ab11 Remove useOptimizedMixins from dart2js
Change-Id: I677e96cf0d27c6c9e1f1eede57e9c248d6514769
Reviewed-on: https://dart-review.googlesource.com/45280
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-06 15:15:57 +00:00
Johnni Winther d3c3ac48a3 Remove implicit 'implements Function' for strong mode
Change-Id: Ie3e3e11a727f7fbe3c8d7af17c84dedfbdfcdf3a
Reviewed-on: https://dart-review.googlesource.com/44422
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-06 09:18:48 +00:00
Johnni Winther 6baae53a5b Check functionTypeIndex in rti_emission_test
Change-Id: Icffa0174cc0cfeedca98b11fe9ea95ee9ac24626
Reviewed-on: https://dart-review.googlesource.com/44140
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-06 07:58:46 +00:00
Stephen Adams f5e4f88c71 Skip assertions in InlineWeeder unless enabled
Change-Id: I889a7aee208b68cbadb8bda01d5c1176e7dfe581
Reviewed-on: https://dart-review.googlesource.com/44920
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-03-05 18:15:20 +00:00
Dan Rubel e74e2b3c3e Pass varFinalOrConst in beginVariablesDeclaration event
This CL refactors the fasta parse variable declaration functionality
to pass the modifier with the begin event rather than using the
handleModifer and handleModifiers events.

* Refactor modifier parsing as described above
* Update same modifier parsing to use ModifierRecoveryContext2
* Cleanup functionality of ModifierRecovery2
* Remove 2 unused fasta parser methods

Change-Id: Ib3a6b24428dcf6ad3cb462a979a05600fe7ee673
Reviewed-on: https://dart-review.googlesource.com/44860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-03-03 21:51:31 +00:00
Stephen Adams 8e8287f4e0 Add classes for instantiations
Change-Id: Iee9df3ad673012776cd1867448ff12ba692a863f
Reviewed-on: https://dart-review.googlesource.com/41564
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-03 00:50:59 +00:00
Sigmund Cherem 7fd5294bb3 Add rules to build dart2js platform in strong mode
This must land after we make the libraries strong clean.

Change-Id: I3a49a2be3b2bcb15842434266f55ce49e3800fc6
Reviewed-on: https://dart-review.googlesource.com/42140
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-03-02 22:19:19 +00:00
Emily Fortuna e9b3ce9619 Make the actual signature function use our entity-based signature code.
Change-Id: I99b4dd4a7b9d549fcec60e4cc341512402c19ced
Reviewed-on: https://dart-review.googlesource.com/43264
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-02-27 18:53:58 +00:00
Johnni Winther 6931a7a288 Use [localFunctionNeedsSignature] to determine when to add JSignatureMethod
Closes #32078

Change-Id: Ib1c9c08b1fdf33e3d94c02595135cf430357fed6
Reviewed-on: https://dart-review.googlesource.com/43742
Reviewed-by: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-27 12:33:53 +00:00
Johnni Winther 85cf0961ee Include type arguments passed through generic calls in rti emission
Change-Id: Id757caaebb0bd802e8afa978c9a4bc5b4d6273fe
Reviewed-on: https://dart-review.googlesource.com/43670
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-27 10:01:14 +00:00
Johnni Winther 9a0307043d Test internal data in rti_emission_test.
Change-Id: I09e43bbe0470d0928478d15a629232d5ffef902f
Reviewed-on: https://dart-review.googlesource.com/43667
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-02-27 09:51:24 +00:00
Sigmund Cherem e33f4f7c2e Fail if mirrors are really used.
Some legacy libraries may import dart:mirrors, but not use it. This CL turns them
into a runtime error temporarily to give some time for the library
maintainers to remove the import to dart:mirrors in the future.

Change-Id: I876133908d2a61300256915aab54730bdff51649
Reviewed-on: https://dart-review.googlesource.com/43640
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-02-27 04:57:27 +00:00
Aske Simon Christensen bb088347f0 Separate severity for context messages
Change-Id: I8c0f9f0eae141e38e1f57afce4a30b6f95e8e412
Reviewed-on: https://dart-review.googlesource.com/43721
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-02-26 16:24:13 +00:00
Johnni Winther 011cd01875 Handle local initializers in constant constructors
Change-Id: Ifcbaf4b19f4411cd499db35242523eea215c77c4
Reviewed-on: https://dart-review.googlesource.com/40820
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-26 10:04:58 +00:00
Johnni Winther 7c2d96490d Support forwarding bounds in function type variables
Change-Id: Ifeab9ad06f512d9b6a5db02fc89d45250c25c054
Reviewed-on: https://dart-review.googlesource.com/40821
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-26 09:45:56 +00:00
Johnni Winther 216c0ae8c2 Don't override .constructor property
- on named mixin applications with --fast-startup.

Change-Id: Ia58e1b8e9a06d2c8d2ce14b3435b3c76aeef6fbc
Reviewed-on: https://dart-review.googlesource.com/40743
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-02-26 09:39:43 +00:00
Sigmund Cherem 5021d24e4b Add an '--use-old-frontend' flag (noop right now)
Change-Id: I4a75f9a6742c87d86206c96cf667e6e81064b926
Reviewed-on: https://dart-review.googlesource.com/43498
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-02-24 01:03:17 +00:00
Emily Fortuna 99d2f1a1ac Fix typecheck error for TypeVariableType contexts.
Change-Id: I53ac4e728ac440a2cea727016b3475a730c5b59d
Reviewed-on: https://dart-review.googlesource.com/43496
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2018-02-24 00:41:37 +00:00
Dan Rubel a8bf40399f Update fasta parser to report error on static constructor
This refactors how modifiers are passed to listener so that the
OutlineBuilder can report a static constructor error.

* Remove handleModifier/s calls from parseMethod
* Pass name and modifiers in beginMethod event
* Update listeners to process method modifiers in beginMethod event
    * AstBuilder
    * NodeListener
    * OutlineBuilder
* Address comment in https://dart-review.googlesource.com/c/sdk/+/42800

Change-Id: Iabd4a18613c1814eb5a157df4acf60dd9060d5eb
Reviewed-on: https://dart-review.googlesource.com/43120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-23 13:18:46 +00:00
Stephen Adams 24b7429b02 Install JS-interop properties on JavaScriptObject
Fixes #26838

Change-Id: Id4a16431e94a50fd0e962301ef23eb4a31a8d5cf
Reviewed-on: https://dart-review.googlesource.com/42585
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-02-23 00:31:52 +00:00
Stephen Adams 9598a1d1fa Add HAbs instruction
This change is to recover 6% lost on Intl.NumberFormat.format.reused
when JSNumber was make Dart2 clean.

Use invoke_dynamic_specializer to replace call with HAbs instruction.

Inject receiver check to condition receiver to a non-null number to
improve. This part makes x.abs() one of the operations 'trusted' by
'--trust-primitives'.

Add one-shot accelerators for abs and get:sign.

Change-Id: Ia423c4b398114abe1d4a784febbe664710f0a242
Reviewed-on: https://dart-review.googlesource.com/42890
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-02-22 22:21:41 +00:00
Sigmund Cherem 593e34c8f3 Extra fix: do not add output units for constants if deferred loading is disabled
R=efortuna@google.com

Change-Id: I76902f4a3672d90db68d81ea8f479fcb44630221
Reviewed-on: https://dart-review.googlesource.com/42887
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-02-22 00:49:57 +00:00
Sigmund Cherem 0866de94f4 Add flag to disable deferred loading
Change-Id: I9f095831f148240ea47d350c3e6d0c247c35a7c1
Reviewed-on: https://dart-review.googlesource.com/42880
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-02-21 22:31:31 +00:00
Dan Rubel f008b41d6b Parse invalid top level blocks during recovery
* New handleInvalidTopLevelBlock event for analyzer recovery
* Extract parseInvalidBlock and override in diet parsers

This addresses comments in https://dart-review.googlesource.com/c/sdk/+/41100

Change-Id: Ia7a7cc490231f5569906e4ad54c451c3b92c1e6b
Reviewed-on: https://dart-review.googlesource.com/42800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-21 19:06:19 +00:00
Sigmund Cherem 04095f7cee Replace PrimitiveValue.primitiveValue by individual fields on the concrete
primitive classes (intValue, doubelValue, etc).

(This is step 1 of ?? to support int64, see https://github.com/dart-lang/sdk/issues/31788)

Change-Id: I3fa3a69761d332640b03416e883d57fef0819e2f
Reviewed-on: https://dart-review.googlesource.com/41923
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-02-21 17:25:27 +00:00
Leaf Petersen 3d6ad7b3a2 Remove fuzzy arrows except on assignability
Change-Id: I00ffa8f6f85cede8badd4d7082da4603f998956c
Reviewed-on: https://dart-review.googlesource.com/40470
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-02-17 00:30:56 +00:00
Sigmund Cherem d0c3e48a5f Add dart2js-with-kernel to the CQ
This is blocked on first landing the change to the dart2js_swarming recipe.

R=whesse@google.com,athom@google.com

Change-Id: Id7c26499cbb3d5337d6c72c10a688dd22d60dd78
Reviewed-on: https://dart-review.googlesource.com/41580
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2018-02-16 23:46:57 +00:00
Stephen Adams df3c210cbb dart2js: Local type information erasure
Change-Id: I28ed9e313159222982a4093cc898339a558c5fd9
Reviewed-on: https://dart-review.googlesource.com/35813
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-02-14 07:58:01 +00:00
Johnni Winther f2b8cafb44 Handle assert in initializers of constant constructors.
Change-Id: Ibb4053af00392b3c43177c60c8551cc6ffe937eb
Reviewed-on: https://dart-review.googlesource.com/38320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-13 14:00:01 +00:00
Johnni Winther d30aaaa4b8 Ensure no type parameters on constructors.
Change-Id: I6a40e2f74b8a89e5873d94d406a56f82db0d0b48
Reviewed-on: https://dart-review.googlesource.com/40526
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-13 11:11:05 +00:00
Johnni Winther 41118c438e Reimplement runtime type checks computation
Change-Id: Ic1baa96e60db30cf9afe3414e605f0200361583b
Reviewed-on: https://dart-review.googlesource.com/37560
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-12 13:29:30 +00:00
Sigmund Cherem 1f70b7ad37 Disable hints in dart2js-with-kernel
Change-Id: Id218b5116c134f7d1646f7d51ccef3faccd072f6
Reviewed-on: https://dart-review.googlesource.com/40469
Reviewed-by: Harry Terkelsen <het@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-02-09 22:53:59 +00:00
Emily Fortuna 06ef399354 Fix up locals map for signature function.
Change-Id: If2a569e0799c1f63f1ee728f183cb4f1e3badb56
Reviewed-on: https://dart-review.googlesource.com/40464
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-09 20:55:19 +00:00
Sigmund Cherem 521188f838 Fix deferred loading in the presence of type parameters too
(and get rid of a TODO(redemption) that I should have fixed eons ago...)

Change-Id: I218a7bddcc8256ff84b4ec03b54a858e8f5d8687
Reviewed-on: https://dart-review.googlesource.com/40180
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-02-09 00:25:26 +00:00
Dan Rubel d4f2f9cef2 Update fasta parser to report constructor initializer errors
This CL updates the fasta parser to report three additional
errors in constructor initializers:

* ExpectedAnInitializer
* MissingAssignmentInInitializer
* RedirectingConstructorWithBody

I also added a comment from a discussion about
https://dart-review.googlesource.com/c/sdk/+/39320

Change-Id: Iecb6fe97e3612a11ccc89864a4fc9f353846504c
Reviewed-on: https://dart-review.googlesource.com/40040
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-08 18:08:40 +00:00
Johnni Winther b7ef215604 Ensure no function type variables on constructors
Closes #32069

Change-Id: I9e8e35aad7844863717d19d6335da87b9c823375
Reviewed-on: https://dart-review.googlesource.com/39700
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-02-08 09:09:09 +00:00
Stephen Adams 92af8a938a Use length argument only for allocating Array
Change-Id: I051ec7bf3e34162e55212c6f734ceb0d531d04bb
Reviewed-on: https://dart-review.googlesource.com/39853
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-02-08 00:41:59 +00:00
Emily Fortuna ef3c271542 Generate signature function in strong mode (previously was behind a flag).
Change-Id: Ia99623beb4f5cbba719833af2d710702d2caaa6d
Reviewed-on: https://dart-review.googlesource.com/38902
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-02-07 23:02:40 +00:00
Johnni Winther a3964bd479 Only add type argument count to generic invocations.
Change-Id: Iee137f74002fea74189d23bff9f27515b4daf224
Reviewed-on: https://dart-review.googlesource.com/35926
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-07 12:18:31 +00:00
Lasse R.H. Nielsen 6f78471687 New methods on Iterable, List, Set, Queue, Map.
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.

Change-Id: I7a12fea533d42b0fc8357086649df38ad01f3cdd
Reviewed-on: https://dart-review.googlesource.com/39140
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-02-07 06:12:53 +00:00
Harry Terkelsen 44bf3ea876 Always generate type substitutions for mixin applications
Change-Id: I2e87ce063b5ce35ae2a411bd21f22d58bd3bc686
Reviewed-on: https://dart-review.googlesource.com/39421
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-07 00:24:53 +00:00
Sigmund Cherem 2847a8b3af Retain type arguments in closures if needed for .runtimeType
Change-Id: I07781ffaf19d1a2099c5a45509ec93545514e61a
Reviewed-on: https://dart-review.googlesource.com/39300
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-02-06 21:54:58 +00:00
Stephen Adams 079a4b08f5 Use a period in disambiguated loadIds
This allows the original loadId to be determined when the original ends in a digit.

Change-Id: I37231229c538c66fd54c79dffbfded3aa9e3973b
Reviewed-on: https://dart-review.googlesource.com/36490
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-06 21:46:53 +00:00
Sigmund Cherem 762b336f2b Minor cleanup and extra debug data
Change-Id: Ifdf502c27ae24e73674e025fd415530516dd0d5f
Reviewed-on: https://dart-review.googlesource.com/39380
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-02-06 21:41:53 +00:00
Dan Rubel b2c5415db9 Rework parseClassMember to remove findMemberName
This CL finishes the process of removing findMemberName from parsing
class members and sets the stage for improved recovery.
In addition, this CL:

* Revises the `endMethod` event to include a beforeParam token
    so that the parser can revise the token stream before the parameters
    during recovery.

* Reworks insertSyntheticIdentifer for use in more places

Change-Id: If5bcd6f554053f72429e938b5cd5e7021e03d5b3
Reviewed-on: https://dart-review.googlesource.com/39320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-06 21:01:53 +00:00
Dan Rubel e1e7ab1c3d Fasta parser cleanup
This separates and cleans up externally called fasta parser methods
such as parseTopLevelMember and parseMember from internal callers.

* Split external and internal calls to parseTopLevelMember
    so that external callers use parseTopLevelMember
    and internal callers use parseTopLevelMemberImpl.

* Rename the externally called parseMember --> parseClassMember
    and the internally called parseClassMember --> parseClassMemberImpl

* Revise the insertSyntheticIdentifier method and cleanup some
    exiting recovery code to use it.

Change-Id: Ic66ddcbbe761937bb917c679590fc7de2fdd0396
Reviewed-on: https://dart-review.googlesource.com/39080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-06 16:34:43 +00:00
William Hesse 9c35cff5cd Revert "New methods on Iterable, List, Set, Queue, Map."
This reverts commit 0b59f24f97.

Reason for revert: Creates crashes in dart2js with kernel, see
https://luci-milo.appspot.com/buildbot/client.dart/dart2js-linux-d8-minified-1-5-be/9751

Original change's description:
> New methods on Iterable, List, Set, Queue, Map.
> Changes signature of Iterable.singleWhere.
> Makes LinkedHashMap no longer be a HashMap.
> 
> Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
> Reviewed-on: https://dart-review.googlesource.com/32541
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=lrn@google.com,leafp@google.com

Change-Id: Iab904f5885a5213ae2e16ef496eed0b6843185f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39060
Reviewed-by: William Hesse <whesse@google.com>
2018-02-06 13:32:19 +00:00