Jens Johansen
76336b225f
[kernel] Streaming ScopeBuilder
...
The old ScopeBuilder is replaced with StreamingScopeBuilder
that does not use the Ast.
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2886873008 .
2017-06-13 11:39:31 +02:00
Peter von der Ahé
5095646191
Apply transformations after comparing to golden files.
...
R=paulberry@google.com
Review-Url: https://codereview.chromium.org/2939533002 .
2017-06-13 09:40:35 +02:00
Konstantin Shcheglov
cf59b1a0f9
Remove ClassHierarchy factory constructor.
...
KernelTarget already uses IncrementalClassHierarchy, and other clients
either need ClosedWorldClassHierarchy, so should explicitly create it,
or don't care, and can be switched to IncrementalClassHierarchy.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2930973002 .
2017-06-08 18:42:22 -07:00
Konstantin Shcheglov
5fe793ec4e
Use ClassHierarchy.applyChanges() in MixinFullResolution.
...
So, we let the hierarchy to decide how to react to the changes, and
instance of which class hierarchy to create.
This makes initial compilation with Kernel Driver about 5% faster.
R=ahe@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2924333002 .
2017-06-08 14:00:51 -07:00
Paul Berry
5c3dd4b11b
Change MethodInvocation.interfaceTarget from a Procedure to a Member.
...
It's possible for the interface target to be a field, e.g.:
typedef void F();
class C {
F f;
}
void g(C c) {
c.f(); // Interface target is C::f
}
Also, this CL fixes MethodInvocation.getStaticType() in the case where
the interface target is a getter.
R=dmitryas@google.com , kmillikin@google.com , scheglov@google.com
Review-Url: https://codereview.chromium.org/2923653003 .
2017-06-07 09:20:53 -07:00
Konstantin Shcheglov
c569a4a8b8
Compute all canonical names only for libraries being serialized.
...
This makes compilation with Kernel Driver about 20% faster than Fasta,
about 5.8 seconds using Kernel Driver vs. 7.2 seconds using Fasta. Note
that this is initial compilation, i.e. nothing read from the cache yet.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2927463003 .
2017-06-07 08:50:04 -07:00
Peter von der Ahé
d6a766bb14
Improve NSM handling.
...
R=paulberry@google.com
Review-Url: https://codereview.chromium.org/2927613002 .
2017-06-07 09:28:13 +02:00
Konstantin Shcheglov
8ec1f95af6
Replace ClassHierarchy.classes with getOrderedClasses().
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2924713002 .
2017-06-05 20:23:13 -07:00
Konstantin Shcheglov
64ce51ce4b
Fix the test and implement forEachOverridePair() for IncrementalClassHierarchy.
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2920323002 .
2017-06-05 13:11:29 -07:00
Paul Berry
d0f954f492
Fix an analysis warning in pkg/kernel/lib/transformations/erasure.dart.
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2924543002 .
2017-06-05 08:39:19 -07:00
Konstantin Shcheglov
5cf61cb0dc
Implement getInterfaceMember() for IncrementalClassHierarchy.
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2916383003 .
2017-06-03 18:52:00 -07:00
Konstantin Shcheglov
952687a64f
Implement getDispatchTarget() in IncrementalClassHierarchy.
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2916403002 .
2017-06-02 13:58:26 -07:00
Konstantin Shcheglov
99363d42d0
Implement getClassicLeastUpperBound() in IncrementalClassHierarchy.
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2921083002 .
2017-06-02 13:46:58 -07:00
Konstantin Shcheglov
c2b5ae00ce
Implement getClassAsInstanceOf() and getTypeAsInstanceOf() for IncrementalClassHierarchy.
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2915263003 .
2017-06-02 11:54:47 -07:00
Konstantin Shcheglov
4301ce842a
Implement IncrementalClassHierarchy.getRankedSuperclasses().
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2916323002 .
2017-06-02 09:15:44 -07:00
Dmitry Stefantsov
1e2f06f8da
Reapply "Use backend targets to run Kernel transformations in Fasta"
...
This reverts commit 0b424ca5d2
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2919003003 .
2017-06-02 16:10:28 +02:00
Dmitry Stefantsov
0b424ca5d2
Revert "Use backend targets to run Kernel transformations in Fasta"
...
This reverts commit 8ff762067a .
TBR=ahe@google.com
Review-Url: https://codereview.chromium.org/2918923003 .
2017-06-02 12:45:34 +02:00
Dmitry Stefantsov
8ff762067a
Use backend targets to run Kernel transformations in Fasta
...
R=ahe@google.com , scheglov@google.com
Review-Url: https://codereview.chromium.org/2918623004 .
2017-06-02 10:40:13 +02:00
Konstantin Shcheglov
65c1f5f8ab
Start implementing IncrementalClassHierarchy.
...
Only getClassDepth() for now.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2922533002 .
2017-06-01 15:01:51 -07:00
Konstantin Shcheglov
00f97489cf
Remove the ClassHierarchy.rootClass getter.
...
According to the language specification the root class is always
equivalent to the Object class.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2919833002 .
2017-06-01 11:56:46 -07:00
Konstantin Shcheglov
5bdfd1e69b
Pass ClassHierarchy instead of creating it.
...
MixinFullResolution is also updated to create new ClassHierarchy
instance only if there are transformed classes. This improves
incremental kernel generator initial time from 22 to 16 seconds.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2918593003 .
2017-06-01 07:20:13 -07:00
Konstantin Shcheglov
3803374d32
Don't recreate CoreTypes in transformers. Pass it in.
...
The same will be done later for ClassHierarchy. So, it would be up to
the client to decide which flavour to create, and whether the same
instance can be reused.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2904203003 .
2017-05-31 09:54:27 -07:00
Konstantin Shcheglov
8460f770b1
Serialize also canonical names of 'interfaceTargetReference'.
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2906693002 .
2017-05-30 10:54:14 -07:00
Konstantin Shcheglov
f9af7bf5bc
Extract ClassHierarchyImpl implementation from ClassHierarchy.
...
As a preparation step for using different implementation during
incremental kernel generation.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2904203002 .
2017-05-30 09:45:06 -07:00
Konstantin Shcheglov
0dd81884bf
Perform MixinFullResolution only for source libraries.
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2912503003 .
2017-05-30 09:33:26 -07:00
Konstantin Shcheglov
97d587520c
Add LimitedBinaryPrinter, tests and switch incremental generator to it.
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2896493002 .
2017-05-24 16:17:28 -07:00
Konstantin Shcheglov
2b8fd9dee8
Transform async code only for source libraries.
...
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2905463002 .
2017-05-24 15:51:18 -07:00
Paul Berry
e642722f42
Implement subtyping rules for FutureOr in kernel.
...
These rules are only enabled when in strong mode, so existing Dart 1.0
functionality should be unaffected.
R=kmillikin@google.com , scheglov@google.com
Review-Url: https://codereview.chromium.org/2900113002 .
2017-05-24 06:14:22 -07:00
Konstantin Shcheglov
625129ac01
Make LibraryIndex lazy.
...
With this change it takes about 0.03% to create CoreTypes.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2896423002 .
2017-05-23 14:28:19 -07:00
Konstantin Shcheglov
77d4eb609b
Use LibraryIndex in CoreTypes instead of extending it.
...
A smaller step this time - change only clients, but keep implementation
the same for now.
Not all patched SDKs have all classes and procedures, so I have to make
some them lazy. All of them could be done for consistency, but this
might slightly affect performance for often used dart:core classes.
Also it's a bit of mess now.
Maybe group these classes into logical structures, coreTypes.core.list,
coreTypes.async.future, coreTypes.async.futureMicrotask, etc. Something
like it was before this change, but fixed types and names instead of
more flexible (but in general slower) strings.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2890933002 .
2017-05-23 09:30:37 -07:00
Peter von der Ahé
4fddc2e4d5
Move code for instantiating Invocation to Target.
...
R=johnniwinther@google.com
Review-Url: https://codereview.chromium.org/2897683002 .
2017-05-22 15:59:06 +02:00
Paul Berry
bf15116d0f
Handle FutureOr type when inferring async closures.
...
R=asgerf@google.com , scheglov@google.com
Review-Url: https://codereview.chromium.org/2892593005 .
2017-05-20 20:16:59 -07:00
Asger Feldthaus
1ea216e6de
Add metadata annotations to library definitions.
...
BUG=
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2893803003 .
2017-05-19 11:35:26 +02:00
Régis Crelier
9aafded095
Pass type argument vector to generic functions (if --reify-generic-functions is
...
true, still false per default).
Work in progress, not functional yet (passed vector is still ignored in callee).
R=vegorov@google.com , zra@google.com
Review-Url: https://codereview.chromium.org/2859673002 .
2017-05-18 14:03:47 -07:00
Zhivka Gucevska
e68b664383
Add support for execution of constructor body
...
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2880343002 .
2017-05-18 15:30:22 +02:00
Asger Feldthaus
876db33bf4
Add import/export declaration AST node boilerplate to kernel.
...
Previously only deferred imports were represented. They have been
merged with the general form.
BUG=
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2852373002 .
2017-05-18 14:38:08 +02:00
Zhivka Gucevska
4030e2de6c
Modify new instance allocation
...
A fresh new instance should be allocated after the evaluation of the
argument list for the constructor.
This change modifies the ConstructorInvocation application continuation
to allocate a new object and introduces :
* continuation applications for Redirecting and Super constructor
invocations, applied on evaluated arguments for Redirecting and Super
constructors respectively
* expression continuation for instance initialization, applied to the
new instance
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2888913002 .
2017-05-18 12:31:20 +02:00
Dmitry Stefantsov
60be18b4a9
Add tool to extract LaTeX-formatted text from comments in Dart programs
...
R=zhivkag@google.com
Review-Url: https://codereview.chromium.org/2889953002 .
2017-05-18 10:48:29 +02:00
Zhivka Gucevska
d4b73fd9ee
Refactor string concatenation evaluation
...
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2883813004 .
2017-05-16 12:53:44 +02:00
Zhivka Gucevska
614f9207b6
Add support for super constructor invocation
...
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2881053002 .
2017-05-15 13:58:42 +02:00
Zhivka Gucevska
c545954a2a
Add tests for initializer list execution in object initialization
...
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2883823003 .
2017-05-15 12:14:18 +02:00
Zhivka Gucevska
1dc564bc13
Fix local initializer execution
...
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2874253002 .
2017-05-15 09:54:09 +02:00
Jens Johansen
d26558b7be
[kernel] [partial] Streaming of kernel binary without AST nodes
...
This CL allows for streaming big parts of the binary,
i.e. without using the AST nodes.
It is thus a stepping-stone in getting rid of the AST nodes in the VM.
Generally, all Expressions except "FunctionExpression",
and all Statements except "FunctionDeclaration" can be streamed.
There are currently not streamed because they create new functions,
which has a pointer to an AstNode (which we don't have when streaming).
Once we no longer need AstNodes at all these can be streamed as well.
This is, I think, mostly a matter of streaming the ScopeBuilder as well,
something that is not currently done.
The way the streaming is build, one has to stream an entire subtree.
That means, that if an expression (or statement), A, that is generally
streamable contains an expression or a statement, B, that is not streamable,
A cannot be streamed.
The way this is build is by marking AstNodes as streamable or not
("cannot_stream_" field). That way we know up front whether we can stream
a subtree or not.
The streaming is done via "kernel_binary_flowgraph".
In this file there are many obvious comments, e.g.
```
TokenPosition position = ReadPosition(); // read position.
```
This has been done in an attempt to add a comment to everything that
reads from the binary to make it stand out more.
All changes from kernel_to_il up to and including May 2nd 2017
should be included.
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2854393002 .
2017-05-15 09:01:22 +02:00
Konstantin Shcheglov
bdedd6768b
Add a way to use shared CanonicalName root to deserialize Program.
...
This allows for example to add SDK into a Program, then load the
"incomplete" Program A that has only the library A, and name sequences
that references SDK classes. Because we look into the nameRoot which
aleady has SDK CanonicalName(s), we can find these names while filling
the link table and use references which point to the existing SDK
AST nodes. Then we can load another set of library cycles, etc.
At the end we have a set of self-consistent libraries that we can
feed into DillTarget/DillLoader and resolve anothersource target
against it.
This CL is based on https://codereview.chromium.org/2872903005/
which has not been reviewed yet.
R=kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2874723002 .
2017-05-12 10:42:08 -07:00
Konstantin Shcheglov
8751b91062
Rework DillLoader to allow adding multiple dills.
...
This allows us to compose a consistent bundle with SDK and the transitive
closure of required libraries for a libarary, and then compile it
separately (or as a part of its own library cycle).
There is still more data public than I'd like, but I will leave this
clean up fo later.
R=ahe@google.com , kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2872903005 .
2017-05-11 08:56:36 -07:00
Paul Berry
06bba1e551
Add FunctionType.getNamedParameter.
...
This functionality was duplicated both in
TypeCheckingVisitor.handleFunctionCall and in the front end's
TypeInferrerImpl._getCalleeFunctionType. I kept the implementation
from TypeInferrerImpl._getCalleeFunctionType since it does a binary
search, so it should theoretically be faster.
R=kmillikin@google.com , scheglov@google.com
Review-Url: https://codereview.chromium.org/2876533004 .
2017-05-11 06:03:37 -07:00
Zhivka Gucevska
eae9c60eb7
Add suport for initializer list execution in constructor invocation
...
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2877733002 .
2017-05-11 12:39:24 +02:00
Zhivka Gucevska
62c0be200e
Add support for redirecting constructors and instance field initialization
...
Instance fields only in immediately enclosing class are initialized.
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2870263003 .
2017-05-11 11:45:31 +02:00
Jens Johansen
b095347421
[kernel] Add support for cloning Vector nodes and ClosureCreation
...
This adds support for cloning the following kernel AST nodes.
* ClosureCreation
* VectorCreation
* VectorSet
* VectorGet
* VectorCopy
This will be needed for kernel closure conversion.
BUG=
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2874973004 .
2017-05-11 11:33:00 +02:00
Zhivka Gucevska
8ea3c3b3e6
Refactor argument evaluation for static invocation
...
BUG=
R=dmitryas@google.com , kmillikin@google.com
Review-Url: https://codereview.chromium.org/2871953002 .
2017-05-10 11:11:32 +02:00