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 .
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 .
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 .
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 .
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 .
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 .
This transformation replaces the body of _getMainClosure in
dart:_builtin with `return main` for the script's main if there is one
and removes the body if there is no main.
Without this transformation fasta will compile `return null` and dartk
will compile `return throw new NoSuchMethodError...`. Both of these
patterns will be patched in the VM when dart:_builtin is compiled from
Kernel.
BUG=
R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2861023002 .
1. A --platform flag is added to dart to give a path to a Kernel
binary for the platform libraries (as produced by building the
runtime_kernel target).
2. This binary is used for bootstrapping. Since it contains libraries
other then the VM's bootstrap libraries, they are also loaded.
3. The frontend does not send any library with a dart: import URI
scheme. Note that it does not (yet) prune the canonical name
table, which will contain a lot of unnecessary names used for
internal linkages in the platform libraries.
4. There is a single dependency in the platform libraries on the
script: _getMainClosure in dart:_builtin. This is patched after
the script is loaded.
BUG=
R=ahe@google.com, kustermann@google.com, vegorov@google.com
Review-Url: https://codereview.chromium.org/2786083002 .