Commit Graph

1995 Commits

Author SHA1 Message Date
Johnni Winther 0a79576ed0 Move towards using WorldImpact for codegen
CustomElementsAnalysis, TypeVariableHandler, LookupAnalysis and metadata
constants no longer require a [Registry] but instead collect their impact.

R=het@google.com

Review URL: https://codereview.chromium.org/2349163003 .
2016-09-21 12:31:38 +02:00
Johnni Winther ca3c2882ae Introduce OpenWorld.
R=het@google.com

Review URL: https://codereview.chromium.org/2320583002 .
2016-09-21 11:48:10 +02:00
Johnni Winther 012229ec83 Split Universe into ResolutionUniverse and CodegenUniverse
Main changes in universe.dart

R=het@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/2318593003 .
2016-09-21 11:24:26 +02:00
Johnni Winther b7d424f6fd Handle local functions in kernel_impact.
R=het@google.com

Review URL: https://codereview.chromium.org/2359453002 .
2016-09-21 11:18:03 +02:00
Johnni Winther 614cde5b1c Split World usage into open, inference, and closed world.
This is a step towards separating the backend element model from the frontend model.

Main changes in world.dart.

R=het@google.com

Review URL: https://codereview.chromium.org/2314703002 .
2016-09-21 10:54:34 +02:00
Johnni Winther 7ea9f8b8bc Handle string interpolation/juxtaposition in kernel_impact.
R=het@google.com

Review URL: https://codereview.chromium.org/2357433003 .
2016-09-21 10:44:57 +02:00
Stephen Adams 3d9bbdaa9a dart2js load elimination: Look through refinements for locations
We have to look through the refinements (via .nonCheck()) for locations in order to avoid mistaking two different refinements for two separate locations.

R=het@google.com

Review URL: https://codereview.chromium.org/1459273002 .
2016-09-20 16:12:55 -07:00
Harry Terkelsen 636084afa2 kernel->ssa: implement top-level getters and setters
See https://github.com/dart-lang/sdk/issues/27394

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2353793002 .
2016-09-20 10:18:08 -07:00
Johnni Winther e24939f8d6 Handle generic factory constructors in kernel_impact
R=het@google.com

Review URL: https://codereview.chromium.org/2341263002 .
2016-09-19 11:35:56 +02:00
Stephen Adams a51d185ff5 Do not add type information to constants with constructor taking type information
R=sigmund@google.com
BUG=

Review URL: https://codereview.chromium.org/2343193002 .
2016-09-16 15:09:28 -07:00
Johnni Winther 4eca725670 More features handled in kernel impact.
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2329403003 .
2016-09-16 12:52:47 +02:00
Johnni Winther 6e62b8af9a Handle signature types and fields in kernel_impact
R=het@google.com

Review URL: https://codereview.chromium.org/2331923002 .
2016-09-16 12:43:41 +02:00
Stephen Adams 591f8ea79e Avoid merging conditions across lopp boundary
Fixes https://github.com/dart-lang/sdk/issues/27354

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2339853004 .
2016-09-14 17:08:39 -07:00
Harry Terkelsen 076f4c30c9 kernel -> ssa: implement literal maps
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2335203005 .
2016-09-14 16:59:30 -07:00
Harry Terkelsen 866e4ea550 kernel -> ssa: implement literal lists
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2346543002 .
2016-09-14 11:26:26 -07:00
Harry Terkelsen 8be34ddd39 Build entire program with kernel for conversion to ssa.
This CL has the kernel task of the backend building the entire program.
This causes the compiler to resolve a lot more than usual, and so we need
to support many language features in the kernel -> ssa builder to compile
all of the helper functions that are included in the output.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2338093002 .
2016-09-14 09:42:23 -07:00
Lasse R.H. Nielsen bcdf0a1f12 Make dart2js not consider dart:io there if the library is unsupported.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2321973002 .
2016-09-13 09:21:54 +02:00
Florian Loitsch 0683f81979 Async-helper only takes 3 arguments.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2322323002 .
2016-09-10 13:10:36 +02:00
Harry Terkelsen 62ec3cf5aa fix other files in kernel after roll
Review URL: https://codereview.chromium.org/2323373003 .
2016-09-09 16:58:56 -07:00
Harry Terkelsen e4f1526449 roll kernel to latest
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2329123002 .
2016-09-09 16:35:31 -07:00
Harry Terkelsen 53870d1914 build kernel for the entire program after resolution
Rasta needs to have access to elements that aren't resolved by normal
dart2js. We need to let it add elements to the resolution queue so
it can get all the information it needs.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2324213003 .
2016-09-09 16:06:22 -07:00
Johnni Winther 8bdf7ab425 Compute ResolutionImpact directly from kernel, part 1 of ?
R=het@google.com

Review URL: https://codereview.chromium.org/2323733002 .
2016-09-09 09:24:47 +02:00
Harry Terkelsen 689aa18799 When registering deferred constant, use canonical output unit.
Before, we were just creating a new output unit, which would cause
constants to map to unnamed output units.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2315973002 .
2016-09-07 17:01:39 -07:00
Stephen Adams c70952c7bc dart2js: Pass type information to constructor rather than add later.
This is a redo of https://codereview.chromium.org/1913033002 that fixes some bug with the interactions with type optimizations.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2310573002 .

Committed: https://github.com/dart-lang/sdk/commit/9217be050d7bd45eb399ea0b457f8b44eea3892f
Reverted:  https://github.com/dart-lang/sdk/commit/cdd6eeb57dbb2d0715c6b93451ce5861c03afa49
2016-09-07 15:07:54 -07:00
Stephen Adams cdd6eeb57d Revert "dart2js: Pass type information to constructor rather than add later."
lib/mirrors/fields_type_test fails due to the extra fieldspec.
We will have to filter or use some other technique to make constructor generation
add the extra parameter and assignment.

TBR=sigmund@google.com

BUG=

Review URL: https://codereview.chromium.org/2319863002 .
2016-09-07 13:46:42 -07:00
Stephen Adams 9217be050d dart2js: Pass type information to constructor rather than add later.
This is a redo of https://codereview.chromium.org/1913033002 that fixes some bug with the interactions with type optimizations.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2310573002 .
2016-09-07 12:29:01 -07:00
Stephen Adams 65efe1dc08 Another round of GVN is sometimes worthwhile after code motion
Code motion really should be integrated with of GVN, since GVN and
code motion generate opportunities for each other.  Looking at a
sample of functions it is rare that the extra phases execute solely
due to code motion, so I don't think this much of a compile-time risk
and benchmarks back that up.

This fixes some sad looking code from a pending CL.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2315143002 .
2016-09-07 11:18:06 -07:00
Stephen Adams ecb0938f11 Don't undo an interceptor optimization
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2316893002 .
2016-09-07 09:15:31 -07:00
Stephen Adams 74fee40234 dart2js: Inhibit code motion of indexing
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2318673004 .
2016-09-07 09:13:03 -07:00
Johnni Winther f3520a2d35 Further separate CodegenEnqueuer from ResolutionEnqueuer
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2306423002 .
2016-09-07 11:00:21 +02:00
Johnni Winther b358d062c2 Fix type masks for js-interop types.
Type-masks for js-interop types are replaced by `subtype/subclass of JavaScriptObject`.

Closes #24822

R=jacobr@google.com

Review URL: https://codereview.chromium.org/2307883002 .
2016-09-07 10:42:45 +02:00
Sigmund Cherem 2503bab254 Refactor how we read global-type-inference data from ssa
R=het@google.com

Review URL: https://codereview.chromium.org/2305623004 .

Committed: https://github.com/dart-lang/sdk/commit/a319239145fc65ba237489061f1a173fc42914f9
2016-09-06 09:07:25 -07:00
Florian Loitsch e8a46acb2c Fix typo in headers comment.
Fixes #27240
BUG= http://dartbug.com/27240

Review URL: https://codereview.chromium.org/2313503003 .
2016-09-05 16:44:05 +02:00
Johnni Winther a47c6a240c Fix more-specific for interface types with call functions.
R=ahe@google.com

Review URL: https://codereview.chromium.org/2307873002 .
2016-09-05 10:00:26 +02:00
Sigmund Cherem 38482e555f Revert "Refactor how we read global-type-inference data from ssa"
This reverts commit a319239145. There were some
tests that failed, I'll retry this again once I investigate the underlying
issue.

BUG=

Review URL: https://codereview.chromium.org/2308983002 .
2016-09-02 21:06:26 -07:00
Sigmund Cherem fc74f854e2 Fix static warning - I forgot to remove a field after all the refactorings.
TBR=sra@google.com

Review URL: https://codereview.chromium.org/2302733004 .
2016-09-02 16:55:06 -07:00
Sigmund Cherem e0c9d843b9 No longer store the compilation-context in WorkItem.
This context is pretty local to SSA and just needs to be plumbed from the
builder through the optimizers. This way we don't have reference to this context
anywhere else in the compiler.

R=sra@google.com

Review URL: https://codereview.chromium.org/2302363003 .
2016-09-02 16:36:39 -07:00
Sigmund Cherem a319239145 Refactor how we read global-type-inference data from ssa
R=het@google.com

Review URL: https://codereview.chromium.org/2305623004 .
2016-09-02 16:24:42 -07:00
Stephen Adams 6627720227 Rename HForeignNew -> HCreate
In preparation for adding type information as an argument to the JS constructor.

R=het@google.com

Review URL: https://codereview.chromium.org/2306203002 .
2016-09-02 15:12:33 -07:00
Stephen Adams 9477f7e1e2 Move congruent type variables optimization out of builder into simplifier
BUG=
R=het@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/2305583005 .
2016-09-02 11:50:48 -07:00
Harry Terkelsen 7502743614 kernel -> ssa: implement if-statements
As part of this change I refactored SsaBranchBuilder to accept a
GraphBuilder argument so that it can work with the new kernel builder.

I also had to add a LocalsHandler accessor to the GraphBuilder.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2301293002 .
2016-09-02 11:32:49 -07:00
Stephen Adams 921eac74cf Rename $builtinType to $ti
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2306813003 .
2016-09-02 10:53:26 -07:00
Johnni Winther 380c0bf3cb Make Enqueuer a pure interface.
R=sra@google.com

Review URL: https://codereview.chromium.org/2289353003 .
2016-09-02 09:00:12 +02:00
Stephen Adams 97842f7fc5 Rerun formatter on dartjs except kernel and shared_messages
BUG=

Review URL: https://codereview.chromium.org/2301953003 .
2016-09-01 20:55:52 -07:00
Stephen Adams 0b041d02c6 Fold HTypeInfoReadVariable of instance creation.
This often replaces an expensive substitution read with a re-use of an indexed read, e.g.:

    t1 = H.setRuntimeTypeInfo(
        new H.WhereIterable(
            t1,
            new Q.CompositeView_removeChild_closure(view)),
        [H.getTypeArgumentByIndex(t1, 0)]);
    this.childViews = P.List_List$from(
        t1,
        true,
        H.getRuntimeTypeArgument(t1, "Iterable", 0));

---->

    t2 = H.getTypeArgumentByIndex(t1, 0);
    this.childViews = P.List_List$from(
        H.setRuntimeTypeInfo(
            new H.WhereIterable(
                t1,
                new Q.CompositeView_removeChild_closure(view)),
            [t2]),
        true,
        t2);

R=sigmund@google.com

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

Reverted:  https://github.com/dart-lang/sdk/commit/c3c5ee8c0a99fe55a773ad8abc7c839bd1fb0fa3

Committed: https://github.com/dart-lang/sdk/commit/5b2e0a19fced7b7ccdbf41b88dc2b9e12d6de295

Reverted:  https://github.com/dart-lang/sdk/commit/ba11ae416f37d321a4d23f7856353b30c9eaa77c
These test start passing, but only when optimized:
  language/mixin_regress_13688_test
  language/regress_18713_test

Review URL: https://codereview.chromium.org/2272923002 .
2016-09-01 19:31:09 -07:00
Stephen Adams a7087aa7c4 dart2js: Fix some problems with mixins and generics
Force the generation of substitutions for mixins at mixin applications. This compensates for the partial lack of rules for mixins in the code that anticipates which substitutions are required.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2299783002 .
2016-09-01 11:08:23 -07:00
Sigmund Cherem f3d3342658 fast-startup: do not emit inherit calls for classes from different fragments
R=sra@google.com

Review URL: https://codereview.chromium.org/2301733002 .
2016-09-01 09:40:48 -07:00
Johnni Winther c37828c669 Use backend-specific enqueuer.
R=sra@google.com

Review URL: https://codereview.chromium.org/2296153002 .
2016-09-01 11:01:16 +02:00
Johnni Winther e9cb7dfdd0 Copy enqueuer.dart to preparation splitting CodegenEnqueuer from ResolutionEnqueuer.
R=sra@google.com

Review URL: https://codereview.chromium.org/2290983004 .
2016-09-01 10:15:32 +02:00
Harry Terkelsen 2ee5807184 create selectors directly from method invocations in kernel -> ssa
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2297283002 .
2016-08-31 10:46:30 -07:00