Commit Graph

2229 Commits

Author SHA1 Message Date
Florian Loitsch 9007ee6a2a Fix missing parenthesis.
Review-Url: https://codereview.chromium.org/2623283003 .
2017-01-11 22:27:51 +01:00
Florian Loitsch 71ec2f0297 Implement 'covariant' modifier for dart2js.
Also adds some tests.

Fixes #28165

BUG= http://dartbug.com/28165
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2626843003 .
2017-01-11 19:12:48 +01:00
Stephen Adams 499248e4e4 Fix for 27467 - dart2js error with re-entrant static initializer
BUG=
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2620123002 .
2017-01-10 14:57:26 -08:00
Florian Loitsch 2547caab25 Reapply "reflectType() dynamic type arguments support (#26012)"
This was a pull request: 8a8033a417

MirrorsUsed doesn't transitively include reflective information. However, it must still be able to create TypeMirrors for types that are used as return- or parameter types.

Initially, the patch checked that TypeMirrors had the correct number of arguments for generic types. This is now disabled.

A better approach would be to know if a class has full reflective information, or not. But this would require much bigger changes to the system.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2615943004 .
2017-01-10 15:53:21 +01:00
Stephen Adams b7dc78a844 dart2js-kernel: handle 'dynamic' as an expression
BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2620593002 .
2017-01-09 15:20:57 -08:00
Stephen Adams e9ea8e4d87 dart2js-kernel: handle top-level / static unresolved methods / getters / setters
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2621433002 .
2017-01-09 14:23:44 -08:00
Stephen Adams 0b00989fc4 dart2js-kernel: implement rethrow
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2616263002 .
2017-01-09 13:13:33 -08:00
Johnni Winther 90dfdf7cf3 Use MemberElement instead of Element in function sets and selectors.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2615223003 .
2017-01-09 10:55:06 +01:00
Johnni Winther d1ef805c38 Use entities in the TypeMask interface.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2613833005 .
2017-01-09 10:46:51 +01:00
Johnni Winther 9580ca5ffb Use entities in ClosedWorld interface
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2613213003 .
2017-01-09 10:29:22 +01:00
Johnni Winther 321dad5711 Use elements/types.dart in codegen.dart
+ use raw type in HTypeInfoExpression/INSTANCE to simplify invariants

R=sra@google.com

Review-Url: https://codereview.chromium.org/2616653003 .
2017-01-09 10:20:54 +01:00
Johnni Winther eec5f4fd5e Flatten inferrer implementation
- collapse MinimalInferrerEngine, InferrerEngine and TypeGraphEngine into InferrerEngine
- collapse TypeSystem and TypeInformationSystem into TypeSystem
- deparameterize classes

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2616103002 .
2017-01-09 10:06:07 +01:00
Stephen Adams 05db16f2c8 dart2js-kernel: do not initialize static fields in constructor
TBR=efortuna@google.com

Review-Url: https://codereview.chromium.org/2619683002 .
2017-01-06 16:48:09 -08:00
Emily Fortuna 745c2989f4 Reapply 0c78abd090
"Ensure we're looking at the correct resolved AST when initializing fields in constructors."

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2614983004 .
2017-01-06 11:01:39 -08:00
Stephen Adams 5305e8685c dart2js-kernel: do not crash on missing const initializers
Compilation will fail, but only after compiling functions that might use the constants.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2612273003 .
2017-01-06 10:34:08 -08:00
Stephen Adams d9b8a3018c dart2js-kernel: Associate irregular calls
BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2616843006 .
2017-01-06 09:33:21 -08:00
Emily Fortuna 5f60d0c3c4 Revert "Ensure we're looking at the correct resolved AST when initializing fields in constructors."
This reverts commit 0c78abd090.

The change to in-memory tests requires a little more finesse than what is written. Backing out to redo.

BUG=

Review-Url: https://codereview.chromium.org/2615173002 .
2017-01-05 17:53:04 -08:00
Emily Fortuna 0c78abd090 Ensure we're looking at the correct resolved AST when initializing fields in constructors.
Step 30 of bagilliondy.

BUG=https://github.com/dart-lang/sdk/issues/27394
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2616933003 .
2017-01-05 16:19:57 -08:00
Stephen Adams 1fc6d58699 dart2js-kernel: map rasta 'read' node in 'field ??= e'
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2610413002 .
2017-01-05 15:58:36 -08:00
Sigmund Cherem 313190029a Fix perf.dart test.
These tests didn't cover much, but I still managed to break them...
TBR=paulberry@google.com

Review-Url: https://codereview.chromium.org/2613113002 .
2017-01-05 12:17:06 -08:00
Sigmund Cherem cc3682f134 fe: minor change to benchmarks to match what the runners expect and some minor refactoring.
I'm happy to split the style/refactorings as separate CLs if you prefer. Here is a summary of the changes:
  - update the reported strings to match the names expected by our benchmark runners ("unlinked summaize + parse" => "unlinked_summarize")
  - invert the benchmark results (like Paul did in 2551533003)
  - stop counting input-size while scanning, count that separately once
  - combine the multiple summarization steps into a single function
  - clean up the logic that dispatches into each benchmark

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2602003002 .
2017-01-05 11:31:35 -08:00
Stephen Adams fd44f86cfb dart2js: Constant folding and specialization for remainder. modulo
"a.remainder(b)" can be compiled to "a % b"

"a % b" can be compiled to "a % b" in some limited circumstances.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2561533002 .
2017-01-05 09:58:53 -08:00
Johnni Winther 12491d4ab8 Fix needsNoSuchMethod computation for abstractly instantiated classes
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2612253002 .
2017-01-05 16:42:38 +01:00
Johnni Winther 51e3c01e3e Prefix resolution_types with Resolution.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2603263002 .
2017-01-05 13:10:20 +01:00
Johnni Winther c899f20de3 Reduce use of Element in optimize.dart
R=sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/52158e2ad61d614dc1356a38924af541ddaf4d89

Reverted: https://github.com/dart-lang/sdk/commit/a7bd904ecc1bf109d79b1a0f7deb731bf38c91c3
Review-Url: https://codereview.chromium.org/2608273002 .
2017-01-05 10:20:52 +01:00
Johnni Winther a7bd904ecc Revert "Reduce use of Element in optimize.dart"
This reverts commit 52158e2ad6.

Review-Url: https://codereview.chromium.org/2615623002 .
2017-01-04 14:28:23 +01:00
Johnni Winther 52158e2ad6 Reduce use of Element in optimize.dart
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2608273002 .
2017-01-04 11:44:47 +01:00
Johnni Winther fad0fe5d86 Further reduce use of Element in codegen.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2609063002 .
2017-01-04 11:39:06 +01:00
Johnni Winther 1758a9c118 Refactor BackendHelpers to make 'find' methods private.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2608143002 .
2017-01-04 11:25:49 +01:00
Johnni Winther d6897b0372 Introduce DartType super hierarchy based on Entity
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2598983002 .
2017-01-04 10:59:27 +01:00
Johnni Winther a510d4fd3e Use Entity instead of Element in ConstantValue
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2610513005 .
2017-01-04 10:23:07 +01:00
Johnni Winther a8b95d2b6f Make closedWorld a property of ClosedWorldRefiner.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2611633002 .
2017-01-04 10:16:22 +01:00
Johnni Winther 56cdde298d Move dart_types to elements/resolution_types
- to prepare for a new dart_types super-hierarchy based on entities.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2606253002 .
2017-01-04 10:07:15 +01:00
Emily Fortuna 9b7247e071 Some constructor quick fixes: implement redirecting constructors, work with finding default constructors (!).
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2607013003 .
2016-12-29 15:43:21 -08:00
Florian Loitsch 968fcc5c62 Speed up _wouldBeTooManyUsers.
On my current dart-program, this reduced compilation time by a third.

$ # before applying the patch:
$ time sdk/bin/dart2js --packages=sdk/.packages --out=/tmp/foo.js /tmp/bug2.dart
Dart file (/tmp/bug2.dart) compiled to JavaScript: /tmp/foo.js

real    0m29.859s
user    0m33.931s
sys     0m1.530s

$ time sdk/bin/dart2js --packages=sdk/.packages --out=/tmp/foo.js /tmp/bug2.dart
Dart file (/tmp/bug2.dart) compiled to JavaScript: /tmp/foo.js

real    0m30.062s
user    0m34.012s
sys     0m1.558s

$ # ----------------- apply the patch.
$ git stash pop

$ time sdk/bin/dart2js --packages=sdk/.packages --out=/tmp/foo.js /tmp/bug2.dart
Dart file (/tmp/bug2.dart) compiled to JavaScript: /tmp/foo.js

real    0m20.782s
user    0m24.540s
sys     0m1.750s

$ time sdk/bin/dart2js --packages=sdk/.packages --out=/tmp/foo.js /tmp/bug2.dart
Dart file (/tmp/bug2.dart) compiled to JavaScript: /tmp/foo.js

real    0m21.042s
user    0m24.495s
sys     0m2.173s

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2602863002 .
2016-12-29 14:40:44 +01:00
Sigmund Cherem f06473e47f support constant juxtaposition.
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2604053002 .
2016-12-28 14:43:38 -08:00
Emily Fortuna c8866ea65d Implement do-while in Kernel SSA.
BUG=https://github.com/dart-lang/sdk/issues/27394
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2607783002 .
2016-12-28 12:23:58 -08:00
Sigmund Cherem 9c10363bd7 dart2js kernel: do less enqueuing.
Convert to kernel only classes and elements that have been resolved. For
anything else, pretend the member doesn't exist.

One exception: fields are added because an unused field might still be stored in
an initializer. This appears to only occur with constants in metadata. Creating the constant in code will not hit this issue.

This makes the compiler do work for the same set of elements that were included during resolution. Running all language tests with --dart2js-batch is now 2.5 min (down from 8 min)

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2604463002 .
2016-12-28 07:36:22 -08:00
Florian Loitsch 76e600aea6 Fix type warning.
Review-Url: https://codereview.chromium.org/2597303003 .
2016-12-23 12:39:51 +01:00
Emily Fortuna bf52b33b14 More kernel-ification of type variables passed around constructors.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2599213002 .
2016-12-22 16:34:42 -08:00
Emily Fortuna 04d67056f7 Kernel-ify buildIsNode logic and add generics type variable checking in buildIsNode.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2588263004 .
2016-12-22 11:53:30 -08:00
Johnni Winther 6f4c3c569f Refactor *WorldBuilder.registerDynamicUse
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2597663002 .
2016-12-22 11:50:07 +01:00
Johnni Winther ca020eb0e0 Fix defaultValue in analyzeInPromotedContext
Review-Url: https://codereview.chromium.org/2596483003 .
2016-12-21 12:06:57 +01:00
Johnni Winther 2b3c0f18fe Add WorkItemBuilder to abstract WorkItem creation from the enqueuers.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2590913002 .
2016-12-21 11:37:36 +01:00
Johnni Winther f68ba35fe5 Move CodegenEnqueuer.generatedCode to JavaScriptBackend.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2589183002 .
2016-12-21 10:49:21 +01:00
Johnni Winther 4522e3a806 Move class/member computation from CodegenEnqueuer to CodegenWorldBuilder.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2587913004 .
2016-12-21 10:42:34 +01:00
Johnni Winther 1e31cd9e5a Remove StatementType
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2595583002 .
2016-12-21 10:22:06 +01:00
Johnni Winther 6281614c45 Merge CoreTypes and CoreClasses into CommonElements.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2595493002 .
2016-12-21 10:10:23 +01:00
Johnni Winther d0279d7c3e Merge WorldImpl with ResolutionWorldBuilderImpl
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2582393002 .
2016-12-21 09:56:36 +01:00
Johnni Winther 3f977cb5d1 Extract ClosedWorldImpl from WorldImpl.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2580403002 .
2016-12-21 09:45:57 +01:00