Commit Graph

6018 Commits

Author SHA1 Message Date
Johnni Winther 68b1a2e7bd [cfe] Refactor super index access
Change-Id: Ie431d93b2ecc48fe5c35288f1146934ac278a81c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117322
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-20 18:30:45 +00:00
Johnni Winther 1e24146dab [cfe] Refactor this indexed access
Change-Id: Iaaac1aba9f421ec1d5176350b1d007ce355ca297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117151
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-20 18:30:45 +00:00
Jens Johansen 99713209c4 [CFE] Fix issue with cached calculations and recording dependencies
Before this CL we would miss some dependencies when recording
dependencies because we cache certain calculations that upon calculation
can mark things as needed.

Change-Id: If9ff872021b0fb77cbcc787112bb91f3ade71243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118281
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-20 11:21:14 +00:00
Johnni Winther 70a1e8e090 [cfe] Fix handling of access on type variables with dynamic bound
Change-Id: Ibff097e5f18bee169191b94633455547460debb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118280
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-09-20 10:48:14 +00:00
Jens Johansen 36c3eccc11 [CFE] Fix issue with exports and recording dependencies
Before this CL we would miss some dependencies when recording
dependencies because we don't finalize exports of dill libraries we have
already finalized.
This was a previous speed-optimization that worked fine before recording
dependencies, but - as outlines above - doesn't work together with
recording dependencies.

Change-Id: I3d9abe949e2b614e9bcd03711e7b92f586373ec5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118043
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-20 07:24:34 +00:00
Paul Berry dcd5cd13fb Prepare to publish analyzer version 0.38.3.
Change-Id: I338f5a5ae9f3384ecb1d3e9ae5d3231e0288552d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-19 20:42:17 +00:00
Johnni Winther 9ed45651a9 [cfe] Refactor super expressions
Change-Id: I9bc0c6cd86316248108440bc367239316bdbc5ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117150
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00
Johnni Winther 5081eb15ee [cfe] Refactor handling of static if-null assignment
Change-Id: Id29b92bc3c2463a3c36ed25c13e0de84fa355ab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117149
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00
Johnni Winther f018ce0355 [cfe] Refactor handling of static get/set/compound
Change-Id: I63a4834bb43ab533f3195e745105137534d83bc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117148
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00
Johnni Winther dc211c3f9d [cfe] Refactoring handling of compound index set
Change-Id: If5ba12c571c77643e57669ef85f8235496d4b06b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117141
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00
Johnni Winther 604f443285 [cfe] Refactor handling of if-null index assignment
Change-Id: I0fc9c4564321144ea4215fe21bd11f671f9f9054
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116960
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00
Johnni Winther 54c2dd737f [cfe] Refactor handling of index and index-set
Change-Id: I28336e1e01ba2f2f98d77c941b740242207bbc86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116780
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00
Johnni Winther c7a083ee5a [cfe] Refactor handling of ++/--
Change-Id: Ib63b095ba52b92653c3253286d0ecc1d18a469ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116760
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00
Johnni Winther c2f35df918 [cfe] Refactor handling of compound local/property assignment
Change-Id: I8a42ab364ef263b13b7a2314777d04dbb1de8038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116520
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00
Johnni Winther 40d75d733b [cfe] Refactor if-null and null-aware property access
Change-Id: I19a50b7d56b63c96f24daf8aaf975e0748e29cf8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00
Aske Simon Christensen 3fa2bbf202 [cfe] Fix incorrect const contexts.
Fixes https://github.com/dart-lang/sdk/issues/36533

Change-Id: Id157edb09ee5bf16003b33b16ecf6edc900b38f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117324
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-09-19 12:01:21 +00:00
Dmitry Stefantsov 515a597710 [cfe] Remove Class.rawType
Bug: http://dartbug.com/38224
Change-Id: If0af5487b1d43125738575ee3e0fcd747db54fa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117546
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-19 10:42:10 +00:00
Paul Berry 4d9792668c Flow anaylsis: fix definite assignment tracking for for-each loop vars
Change-Id: Ia0dfd94070e28832c5ffc6fb892626d9036042a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117820
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-18 19:21:39 +00:00
Kallen Tu b699852e6d Add 'out'/'inout' keywords for variance.
Under the `variance` flag, `out` and `inout` will be treated as keywords.

Change-Id: I73ba6871a9f0d410a7b3818833a1f50a5f75fba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117203
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-09-18 18:35:59 +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
Dmitry Stefantsov a56b4ee790 [cfe] Thread nullability from source for function types
Closes #38216.

Bug: http://dartbug.com/38216
Change-Id: I33def8e24555099a74fae04d658cbde7af08d7c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117727
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-18 13:58:43 +00:00
Dmitry Stefantsov 0281f9c425 [cfe] Add members to construct nullability in Library and LibraryBuilder
Change-Id: Iaaa9cf0c5a5789e6b303d646c5ed7fb6eed15b9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117155
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-18 09:52:00 +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
Aske Simon Christensen 7799f424f4 [CFE] Encapsulate int operations in separate classes for VM and JS
This refactoring achieves the following:

- Collect the integer operation semantics into one place instead of
having it sprinkled all over the constant evaluator with many
"if (targetingJavaScript)" tests.

- Avoid emitting the internal JavaScriptIntConstant node, which is
serialized as normal DoubleConstant nodes, thus achieving parity
between direct consumers and consumers seeing output that has been
serialized.

- Implement the JavaScript semantics for unsigned right shift.

- Fix truncating divide with a result outside int64 range incorrectly
clamping the result for JS targets.

- Fix positive hex constants >= 2^63 through int.fromEnvironment
producing negative values in dart2js.

- Clarify in Kernel documentation how numeric constants are represented
on VM vs JS targets.

Change-Id: If30bb2c2c77c54eff120b611b059c2ec726c99a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116525
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-16 13:10:59 +00:00
Aske Simon Christensen eb1a375749 [CFE] Consolidate double special cases for == and identical.
Change-Id: I2d8da0bbb443bdf3ee5c3a6f53786a80509d2d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116321
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-16 13:10:59 +00:00
Johnni Winther 7b60ae1a0d [cfe] Fix infer expression
Fixes bug introduced https://dart-review.googlesource.com/c/sdk/+/116203
Calls to inferExpression that pass an expression directly needs to handle
the returned replacement expression directly.

Change-Id: I74f7707921d6f08df3d4bee48085a8d72731acee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117154
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-09-16 12:29:49 +00:00
Jens Johansen a8f433820b [fasta] Add test for split dill
We've long had the ability to load a combined dill file both in the dart
code and in the VM.
Largely this has been untested though - this CL adds a test.

Change-Id: I7cf03911d716999c2bdb407b256a064d84a385ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117152
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-16 09:06:04 +00:00
Kallen Tu f20f619050 Add 'variance' experimental flag.
Generated flag code

Change-Id: I61e6b8fd0a21c511c93afb9b334dc8c17eb69272
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117041
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-09-13 16:11:16 +00:00
Johnni Winther 2a12c63631 [cfe] Use SuperPropertySet for super assignment
Change-Id: I82afdb7558186aa744a09c4ee68ac6335a7c55f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116280
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 4b72fffaaf [cfe] Use VariableSet for variable assignment
Change-Id: Ia94f9e1a3548e615fef111256aa2419cc1fd8c75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116209
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 2153a06b82 [cfe] Use PropertySet for property assignment
Change-Id: If16d2b9ca8bb1134d181c27ea524b8008e2f52ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116207
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 4fd7bf7356 [cfe] Split inference of super property get from instance property get
Change-Id: I457d6a4326c879ee68113760cd86dc0250e4cfde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116205
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther f8f37c131b [cfe] Split inference of super method invocation from instance method invocation
Change-Id: I6d8344da4bb49de0712b2c9f410c3f691ade7150
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116204
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 7d2ebd3ce9 [cfe] Introduce InternalExpression
Create Cascade, DeferredCheck, LoadLibraryTearOff,
NullAwareMethodInvocation and NullAwareMethodPropertyGet as internal
only expressions.

Change-Id: Ie9e12a2fd87ae47f632076429eebd5a21717a062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116203
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 2c6f779a76 [cfe] Remove legacyMode
Change-Id: I9384631af94feaf1a345958ff23e6d35c2ba4049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116202
Reviewed-by: Jens Johansen <jensj@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 392cd3b26f [cfe] Delete InferredTypeVisitor
and TypeInferrer.readInferredType/storeInferredType

Change-Id: Iea2a97649adc3097df8abb1cf0aeb6e89b7d7f62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116063
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 71534fe18c [cfe] Make *Impl classes
Change Judgment classes that are 1-to-1 extensions of kernel nodes into
*Impl classes that do not implement *Judgment.

Change-Id: Ia49b131cfb30e7e5c0d5f26a8a43e6dd6d05d2ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116062
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 15ccf4c703 [cfe] Remove unneeded Judgments
Removes StatementJudgment, ExpressionJudgment, and InitializerJudgment
classes that are identical to existing nodes.

Change-Id: If67c1972387bb158bfe775cdf091cae4eadd47c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116061
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 7985b187ab [cfe] Remove ExpressionJudgment.inferredType
Change-Id: I16df27c4dc9616370c946ddb7d4027110df38c7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116060
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-13 07:38:25 +00:00
danrubel 3b1d3de988 update parser to report out of order "?.." operator
Change-Id: I2d90e458d5721d16142752e8ac6a522cc41c2051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-09-12 14:38:31 +00:00
Dmitry Stefantsov bdf237fa77 [cfe] Add a bit to Library to inticate if it's opted in for NNBD
Closes #37682.

Bug: http://dartbug.com/37682.
Change-Id: Ibe21cd0a1eac25a2883d2e2241d7476ca627edba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114857
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-09-12 12:15:56 +00:00
Dmitry Stefantsov 94b3a3f2ac [cfe] Don't reuse type parameters of FunctionNode in its functionType
Closes #37536.

Bug: http://dartbug.com/37536.
Change-Id: I7e5d2fc59a0cf53e67c43989cf806ca7dbcc307e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115368
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-12 11:12:52 +00:00
Jens Johansen ce5556ab36 [kernel] Load classes lazily
This CL gives the option to load classes lazily (on by default),
meaning that fields, procedures, constructors and redirecting
factory constructors of classes are not initially read,
but instead read when (or if) needed.

The idea being that many classes aren’t needed, and that
spending time on reading them is thus just a waste of time.

This is especially true in modular compilation where a lot
of modules needs to be given as input as the compilation at
hand might technically rely on it, but in practice only very
few of the classes are actually needed (or very few classes
actually need their members).

The below numbers are comparing a VM without this change and without
the lazy class hierarchy member lists change with
b31566b297 (the base change for those
two changes).

For running a simple hello-world script, on my machine 500 times
and doing statistics on it I can measure the following differences:

With verbose, from kernel_service startup to compile complete:
Difference at 95.0% confidence
        -17.8 +/- 0.555817
        -24.3455% +/- 0.760206%
        (Student's t, pooled s = 4.48379)

With verbose, total runtime measure by `time`
Difference at 95.0% confidence
        -19.346 +/- 0.905217
        -12.0333% +/- 0.563051%
        (Student's t, pooled s = 7.30242)

Without verbose, total runtime measure by `time`
Difference at 95.0% confidence
        -17.862 +/- 0.842905
        -12.0635% +/- 0.569276%
        (Student's t, pooled s = 6.79974)

For running a number of modular compilations I’ve recorded an
improvement in actual runtime in the order of 20-37% depending
on the circumstance. In a real build system, though, the
difference seems to be more in the order of around 5%.

Change-Id: Id329bcf2b01d12c12d7a49f2b8abacd9c2447f05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115703
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-12 08:08:33 +00:00
Dmitry Stefantsov a62289451d Update changelog to include the recent breaking change
Link to the breaking change request:
https://github.com/dart-lang/sdk/issues/37985

Change-Id: I0fcb058e953a43a20e7b663f63bb88100f376a6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116762
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-09-12 07:37:17 +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
danrubel 16c7ac92bf move const method error reporting into parser
Change-Id: Ibae4aeb0362138e742f80186ed98a20eb3469ba1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-09-11 14:48:47 +00:00
danrubel 30ea777c65 fix parsing of "?.." cascade operator
Fix https://github.com/dart-lang/sdk/issues/37859

Change-Id: Ie29f4fd000199f0099137308603335e36af6ae26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116089
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-09-10 20:36:04 +00:00
Dmitry Stefantsov ccb6ba948b [cfe] Gather constraints from both possibilities for FutureOr
Closes #37778.

Bug: http://dartbug.com/37778.
Change-Id: Ia8828c27ccc912831a0fea8a473c547184c99229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115243
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-09-10 09:50:30 +00:00
danrubel 879cdeffb3 update scanner test
Fix https://github.com/dart-lang/sdk/issues/38112

Change-Id: I81912b40972b1753af9bd994c9b5798fd2a248c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116247
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-09-09 19:46:36 +00:00
Aske Simon Christensen 41c5b81818 [cfe] Special error message for illegal override of a setter by a field
This situation would produce an error referring to the erroneous type
as a return type instead of a paremeter/field type.

Change-Id: Ida72b0b85b448e3a05cadf38511e7e32d19986f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115702
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-09-09 09:57:26 +00:00