This mimics the behaviour of the source-based pipeline,
i.e. instead of "manually" calling _AssertionError._create and giving
the correct parameters (wrong parameters, actually), use the helper
method _AssertionError.ThrowNew.
BUG=
R=ahe@google.com, vegorov@google.com
Review-Url: https://codereview.chromium.org/2940283002 .
To facilitate experimentation, I've left the old code in place, but
disabled it using a const bool `fullTopLevelInference`. The old code
can be re-enabled by setting this bool to `false`. Once we are sure
that we want to proceed with this approach, we can remove the old
code.
I believe that with this change, all expressions that can be type
inferred inside a method body can now be type inferred at top level,
provided that there are no circular dependencies.
R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2942153002 .
This CL combines the two parts of top level type inference
(determining dependencies and inferring a type) into a single
operation.
The technique is: instead of evaluating top level types in
topologically sorted order (which requires that we figure out the
dependencies first, so that we can do topological sorting), we simply
iterate over the fields requiring inference and begin inferring them
in whatever order they are encountered. If, while trying to infer the
type of one field, we discover a reference to field that hasn't been
type inferred yet, we make a recursive call to infer the second field.
If this recursion leads to a loop, then we mark all of the fields in
the loop as participating in a circularity (and set their types to
`dynamic` for error recovery purposes).
To facilitate experimentation, I've left the old code in place, but
disabled it using a const bool `fusedTopLevelInference`. The old code
can be re-enabled by setting this bool to `false`. Once we are sure
that we want to proceed with this approach, we can remove the old
code.
Note that there are some minor user-visible behavioral changes:
- When there is a circularity, we no longer consider the entire
strongly connected component to be part of the circularity; we only
consider the loop formed by following the first unresolved
dependency of each field. (I did this because of ease of
implementation, and because it made it easier to reassure myself
that the outcome of the algorithm is independent of the order in
which fields are visited). See
pkg/front_end/testcases/inference_new/strongly_connected_component.dart
for the user-visible consequence of this change.
- We no longer need to speculatively assume that method invocations
depend on the types of their parameters when not supplying generic
types; now they only depend on the types of their parameters when
the method being invoked is known to be generic. See
pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.
- We no longer need to speculatively assume that invocations of `+`,
`-`, `*`, and `%` depend on the types of their RHS; now they only
depend on the types of their RHS when the type of the LHS is
`int`. See
pkg/front_end/testcases/inference_new/dependency_only_if_overloaded.dart.
R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2942623004 .
- Get rid of separate CommandBuilder class and singleton pattern. It
was being passed around explicitly even though half of the places
that received a CommandBuilder as a parameter still directly called
CommandBuilder.instance instead of using it.
- Get rid of Command caching. As far as I can tell, it makes no
measurable difference in runtime performance or memory usage. Even
with a large invocation of a lot of configurations and tests, the
Command classes don't seem to be a significant use of memory.
- Shorten the factory names. "get" adds no value, and we know it
returns a "Command" since it's on Command.
R=whesse@google.com
Review-Url: https://codereview.chromium.org/2933973002 .
This directory has a libraries.json file pointing to vmservice_io and
_vmservice in the source tree. The script tools/patch_sdk.dart has been
updated to use this new directory as the sdk directory when compiling
dart:vmservice_io. This way, to build vmservice_io.dill, we
do not need to copy the dart files pertaining to vmservice_io and
_vmservice.
Fixes#29859R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2938903003 .
2. Get rid of _getMainClosure()
3. Adjust the AOT compiler to ensure it retains the function associated with
the main closure without having to include '_getMainClosure()' in the list
of embedder specified entry points
4. Get rid of the hack in kernel reader to do a delayed patch of
'_getMainClosure()' in the builtin library.
BUG=
R=aam@google.com, rmacnak@google.com
Review-Url: https://codereview.chromium.org/2933603002 .
Closure conversion can now be run on a part of a program. It allows
using closure conversion in kernel-isolate. It comes at a cost of
temporarily sacrificing implementation of tear-offs via closures; VM
mechanism for tear-offs is used for now.
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2938773003 .
The absence of symbol sizes broke build comparison that looks for and
ignores snapshots. Add symbol types for good measure to match the compiler
behavior.
Consider unknown operating systems to use as(1)-style assembly, which is
generally true. If an unknown operating system uses another syntax, the
generated files will fail to assemble and the porter should soon find
this script and add support for their operating system.
R=whesse@google.com
Review-Url: https://codereview.chromium.org/2939013002 .
This CL lifts all of the restrictions on top level type inference
except for one: the restriction that expressions used for top level
type inference cannot depend on the types of instance getters,
instance setters, or instance fields. (That restriction will be
lifted in a later CL).
The technique is: to determine the dependencies of an expression,
rather than recurse through the expression applying the rules for what
constitutes an "immediately evident" expression, we simply do a dry
run of the inference algorithm and record what static fields were
accessed. To avoid recording bogus dependencies on fields whose type
doesn't matter, this dry run skips subexpressions whose type isn't
needed.
To facilitate experimentation, I've left the old code in place, but
disabled it using a const bool `extendedTopLevelInference`. The old
code can be re-enabled by setting this bool to `false`. Once we are
sure that we want to proceed with this approach, we can remove the old
code.
Note that this makes the behavior begin to diverge with analyzer
behavior, so I've created a new test directory:
pkg/front_end/testcases/inference_new/, to hold test cases which
aren't expected to match analyzer. Analyzer is only tested against
the test cases in pkg/front_end/testcases/inference/.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2935323002 .