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
Harry Terkelsen
227766e4ac
implement kernel -> ssa for simple binary expression
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2297853003 .
2016-08-31 09:59:33 -07:00
Johnni Winther
64a2a03f0e
Handle parts as input in resolver.
...
R=het@google.com
Review URL: https://codereview.chromium.org/2294753002 .
2016-08-31 11:04:40 +02:00
Johnni Winther
726d8fdb23
Handle html+mirrors
...
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2296723003 .
2016-08-31 10:34:04 +02:00
Stephen Adams
ba11ae416f
Revert "Fold HTypeInfoReadVariable of instance creation."
...
These tests 'fail':
language/mixin_regress_13688_test
language/regress_18713_test
They are marked as failing due to faulty type information ($isX and
$asX) causing the wrong lookup of a type parameter of a mixin class.
The CL causes the lookup to be folded, giving the correct result.
The underlying issue needs to be fixed before we can proceed with this
CL.
TBR=sigmund@google.com
BUG=
Review URL: https://codereview.chromium.org/2294123003 .
2016-08-30 19:10:41 -07:00
Stephen Adams
5b2e0a19fc
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
Review URL: https://codereview.chromium.org/2272923002 .
Reverted: https://github.com/dart-lang/sdk/commit/c3c5ee8c0a99fe55a773ad8abc7c839bd1fb0fa3
2016-08-30 16:10:49 -07:00
Stephen Adams
7b3bc6933a
locateSingleElement improvement for mixins.
...
I see several code improvements:
1. More inlining of small methods in mixin classes like ListMixin.isEmpty
2. Fewer interceptor calls where the target is now known but not inlined.
3. Implied getters and setters on mixin classes are inlined to direct field references.
Addresses https://github.com/dart-lang/sdk/issues/27160
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org/2278143003 .
2016-08-30 14:08:50 -07:00
Stephen Adams
dff5b702d9
Fix for issue 27199
...
Fixes https://github.com/dart-lang/sdk/issues/27199
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2285373003 .
2016-08-30 08:57:58 -07:00
Harry Terkelsen
7b29f2b79c
kernel -> ssa: support static invocations and variable gets
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2290893002 .
2016-08-29 17:24:35 -07:00
Stephen Adams
c3c5ee8c0a
Revert "Fold HTypeInfoReadVariable of instance creation."
...
Investigating failed test
tools/test.py -mrelease --use-sdk -cdart2js --dart2js-batch -rd8 --reset-browser-configuration --write-debug-log --write-test-outcome-log --copy-coredumps --minified --fast-startup --checked -t120 co19/Language/Types/Parameterized_Types/Actual_Type_of_Declaration/actual_type_t05
TBR=sigmund@google.com
Review URL: https://codereview.chromium.org/2289593004 .
2016-08-29 16:36:33 -07:00
Stephen Adams
b43ac92770
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
Review URL: https://codereview.chromium.org/2272923002 .
2016-08-29 14:36:08 -07:00
Stephen Adams
52ecac4ed5
Protect types_propagation receiver type strengthening against many users.
...
receiver.dominatedUsers(instruction) is slow if [instruction] is in a
block with thousands of uses of [receiver]. I this case, it makes
sense to see if the type would be strengthened first.
10x performance increase on compiling MicroClosures benchmark which has 5k lines like the following two:
a.add(this.f1234);
a.add(this.f1235);
R=sigmund@google.com , het@google.com
Committed: https://github.com/dart-lang/sdk/commit/07184079197a999f8e138738fa81f6558f3e34da
Review URL: https://codereview.chromium.org/2275853002 .
Reverted: https://github.com/dart-lang/sdk/commit/d63577da675f00e7a9115c7778557d9b186f809d
2016-08-29 10:58:05 -07:00
Stephen Adams
f404301ec3
Fix bug in locateSingleElement
...
This bug probably did not show up much because the conditions that
cause the bug also cause unimplemented interface method warnings.
There is a degradation in code quality in mixin method bodies which I will address later.
This bug is unrelated to the recent removal of the 'mask' parameter of locateSingleElement.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2284923002 .
2016-08-26 15:52:10 -07:00
Sigmund Cherem
13a090a879
More status fixes
...
TBR=sra@google.com ,het@google.com
Review URL: https://codereview.chromium.org/2280193002 .
2016-08-26 13:46:14 -07:00
Harry Terkelsen
a89daf07c4
implement kernel -> ssa for literals
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2280133002 .
2016-08-26 12:53:29 -07:00
Harry Terkelsen
17f14d839a
implement kernel -> ssa for function that returns a constant
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2280743003 .
2016-08-26 10:29:31 -07:00
Stephen Adams
200c53654a
Remove mask parameter from TypeMask.locateSingleElement
...
BUG=
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org/2273393003 .
2016-08-26 09:33:16 -07:00
Stephen Adams
d63577da67
Revert "Protect types_propagation receiver type strengthening against many users."
...
BUG=
Review URL: https://codereview.chromium.org/2283573002 .
2016-08-25 19:18:20 -07:00
Sigmund Cherem
740c3d466a
Rename the global inference task and reduce it's API surface by introducing the
...
CommonMasks class.
R=het@google.com
Review URL: https://codereview.chromium.org/2278213003 .
2016-08-25 16:20:29 -07:00
Harry Terkelsen
140f5b90db
compile empty function to ssa from kernel
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2264403007 .
2016-08-25 16:07:56 -07:00
Harry Terkelsen
1ce9145374
Make LocalsHandler depend on GraphBuilder instead of SsaBuilder.
...
This allows the KernelSsaBuilder to use LocalsHandler as well. I
noticed that there were some methods and fields in SsaBuilder that
were only used in the LocalsHandler, so I moved them into LocalsHandler
instead. I also moved LocalsHandler to its own file.
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2283443002 .
2016-08-25 13:25:53 -07:00
Stephen Adams
0718407919
Protect types_propagation receiver type strengthening against many users.
...
receiver.dominatedUsers(instruction) is slow if [instruction] is in a
block with thousands of uses of [receiver]. I this case, it makes
sense to see if the type would be strengthened first.
10x performance increase on compiling MicroClosures benchmark which has 5k lines like the following two:
a.add(this.f1234);
a.add(this.f1235);
R=sigmund@google.com , het@google.com
Review URL: https://codereview.chromium.org/2275853002 .
2016-08-25 12:28:30 -07:00
Harry Terkelsen
103707382f
record originating elements for Kernel nodes
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2268893006 .
2016-08-24 15:00:09 -07:00
Harry Terkelsen
6df6a3b0ad
skeleton Kernel -> SSA builder
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2274263002 .
2016-08-24 12:50:45 -07:00
Stephen Adams
4f0e85997e
Dummy receiver optimization for super calls
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2258523002 .
Implements: https://github.com/dart-lang/sdk/issues/22727
2016-08-24 10:48:40 -07:00
Stephen Adams
f4107397ac
Constant-fold HTypeInfoReadVariable of constant value
...
R=sigmund@google.com
Committed: https://github.com/dart-lang/sdk/commit/5dd24a28b9384fa05db7158f5e1560f6b48d6b5d
Review URL: https://codereview.chromium.org/2263853002 .
Reverted: https://github.com/dart-lang/sdk/commit/5dd24a28b9384fa05db7158f5e1560f6b48d6b5d
2016-08-24 10:39:18 -07:00
Stephen Adams
953e7c82bc
Revert "Constant-fold HTypeInfoReadVariable of constant value"
...
TBR=sigmund@google.com
Review URL: https://codereview.chromium.org/2276953002 .
2016-08-24 09:57:03 -07:00
Stephen Adams
5dd24a28b9
Constant-fold HTypeInfoReadVariable of constant value
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2263853002 .
2016-08-24 09:07:00 -07:00
Johnni Winther
f49b7c2720
Support raw types in metadata.
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2254363003 .
2016-08-23 09:49:33 +02:00
Harry Terkelsen
7923d0cba9
try to build Kernel IR for SSA builder
...
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org/2265413002 .
2016-08-22 18:40:44 -07:00
Stephen Adams
3c82f05ca6
Online 'SSA conversion' of mutable parameters.
...
The builder creates mutable parameters in functions containing
try-catch. This change cleans this up in the usual case where the
parameter is not assigned. The effect is improved SSA type
propagation.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1973213002 .
2016-08-22 17:29:12 -07:00