This is necessary because some of the TypeInferrer's roles (e.g. type
promotion and determination of the types of constants) are still
needed in non-strong mode.
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2829683008 .
This CL introduces Fasta's first type inference rule, and hooks it up
to all the necessary testing infrastructure. The rule is that a local
variable whose initializer is an integer literal should have an
inferred type of int.
Only variables occurring at top level within a method are inferred (we
don't yet recurse inside sub-blocks).
Additional type inference rules will be added in follow-up CLs.
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2828693003 .
In a future CL I need to add an import to this file, and for reasons I
haven't been able to track down, doing so causes type inference
failures. This CL works around the problem by making the affected
types explicit.
Once the bug is fixed, I hope to be able to revert this.
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2833563004 .
If we don't, and we transplant any of them into a new detached instance
of synthetic FunctionElementImpl, they are not able to access later
enclosingUnit in order to resynthesize their type.
R=brianwilkerson@google.com
BUG=
Review-Url: https://codereview.chromium.org/2829843002 .
This allows us to report the "native heap memory" value in
the Observatory for VMs running on Fuchsia.
This change also renames the flag --enable-malloc-hooks to
--profiler-native-memory to better reflect what the flag
does. (In the future we may also want to rename
--profiler to --profiler-cpu.)
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2829833003 .
Types generated via instantiation during run time type tests are allocated in
new space and it makes sense (in the case of function types) to also allocate
instantiated signatures in new space.
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2821233005 .
- Don't remove entries from a library's dictionary while iterating over it.
- Remove library prefixes from library dictionaries.
- Compact library dictionaries after removing entries.
- Track snapshot references in debug mode and give a backtrace when unencountering an unexpected object.
- Verify removed libraries are not included in the snapshot by marking their top-level classes.
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2823873003 .
The framework will allow test source files to be annotated with
comments indicating where types are expected to be inferred, for
example:
var /*@type=dart.core::int*/ x = 1;
Other features of the testing framework:
- Normally only those expectations explicitly listed will be checked.
The special comment "/*@testedFeatures=inference*/" at the top of
the file turns on extra checking which will cause the test to fail
if any unexpected type inference occurs.
- Should be easy to extend to support other features, such as checking
that the proper errors and warnings are generated at the proper
locations.
- If the test is run with "-DupdateExpectations=true", the
expectations will be updated in place.
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2824393002 .
Previously we were converting very polymorphic calls that always end up
in the same implementation into a check-class instruction and a (usually
inlined) direct call. This works well in artificial benchmarks like
the Megamorphic suite, but tends to cause repeated deopts on large real
programs like dart2js, where new classes arrive after a while, triggering
the check-class instruction to deopt. After a few deopts, the function
is no longer eligible for optimization, resulting in huge slowdowns.
Instead with this change we can switch to the normal machinery for polymorphic
calls with more than one target. This has the advantage that we use a
megamorphic stub call to catch rare classes, rather than deopting.
Dart2js is speeded up by a few percent on average and avoids the big
performance potholes described in https://github.com/dart-lang/sdk/issues/29302
Also reverts a less effective workaround for 29302.
R=vegorov@google.com
BUG=29302
Review-Url: https://codereview.chromium.org/2829603002 .
Also extract more extract more methods from ClosedWorldImpl into
ClosedWorldBase.
This is a step towards creating a closed world object from kernel based
elements. This CL adds the first mock of that object.
R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2826673002 .
This is a step towards passing data object directly instead of accessing
data on JavaScriptBackend. This is needed to support an element switch
between resolution and codegen.
R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2824823004 .