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 .
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 .
Add function_type_arguments field in closure instances.
Lots of other smaller changes, also related to generic function semantics.
This is still work in progress, with a change of direction in the design:
The type argument vector of a generic function will be prepended with the type
arguments of enclosing generic functions. The re-allocation and concatenation
will be done in nested generic function's prolog. This will greatly simplify
instantiation of types at run time without having to search the context for
parent function's type arguments. However, a closure instance now requires an
additional field. On the other hand, type parameters do not require a
parent_level field anymore.
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2818273002 .
Having an issue forwarding Symbol::InTypeCheck into dart and back;
without it, the exceptions that are thrown are `TypeError`s and not
`CastError`s.
Certainly a bit longform to read, as well.
Committing for feedback/suggestions/help
BUG=
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2805903004 .
- [x] Produce an awaiter stack trace even when there is no awaiter.
- [x] Fix fetching the saved context from Closure.call (fixes --trace_debugger_stacktrace)
Fixes#29200
Example code:
```
main(List<String> args) async {
var f = new Foo();
print(f.a.length);
print('Should not get here');
}
class Foo {
String a;
}
```
BUG=
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2815863002 .
With generic methods, uninstantiated types will require 2 instantiators, one
reflecting the class type arguments (as of today) and one reflecting the
function type arguments (new).
This is work in progress and the second instantiator is always null for now.
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2799373002 .
libdart_jit is always the JIT, unlike libdart which is either the JIT or AOT runtime depending on dart_runtime_mode. Clients of libdart will be updated to explicitly choose libdart_jit or libdart_precompiled_runtime.
dart_api allows libraries such as tonic or intermediate components of the Flutter engine to be agnostic as to whether they're in a JIT or AOT runtime, allowing the final executable making the choice without having to deal with a conflicting dependency brought in by a library.
Remove dead libdart_embedder_noio.
Replace all used of dart_nosnapshot* with dart_nosnapshot_with_precompiler*. We don't care about binary size of their clients, so it's better to have fewer targets.
R=zra@google.com
Review-Url: https://codereview.chromium.org/2814513003 .
This has the effect of making every program generate the same VM isolate, allowing an embedder to load different programs into different isolates.
Verify the number of base objects in clustered snapshots.
Remove dead code leftover from core snapshots switching from saving scripts to saving token streams in the VM isolate.
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2790243003 .
type itself gets instantiated.
Until now, the signature was kept unchanged and the instantiation was reflected
by the type arguments of the function type only. This delayed instantiation
would complicate the implementation of generic functions.
This cl actually removes type arguments for (non-typedef) function types. The
function type is now fully represented by the signature. When the function type
is instantiated, a new signature is allocated (instead of a new type argument
vector) to hold instantiated result type and formal parameter types.
The same applies in the case of typedef function types, however, the type
arguments of the typedef are kept as before. This allows for better printing
of typedef function types and for finalization of recursive type involving
typedefs as type arguments.
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2793033005 .
One slot in each Dart frame contains a "pc marker". Prior to the calling convention change, the pc marker was a fixed offset from the code's entry point, from which the code object could be derived. After the change, the pc marker is a pointer to the code object itself.
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2804793003 .
This was the only Kernel specific backend change - to simplify the graph builder
we allowed it to capture exception and stack trace variables. This in turn
requires CatchBlockEntryInstr to respect that this variables can be captured
and correctly update them when exception is caught.
This was implemented on X64 and ARM before. This CL expands implementation to
all other implementations including DBC.
R=zra@google.com
Review-Url: https://codereview.chromium.org/2796283003 .
Instead of a list of strings given by their length and UTF-8 encoding,
restructure the string table to consist of a list of string ending
offsets followed by a blob of UTF-8 encoded strings without lengths.
This is a step toward copying the string blob into the VM's heap and
building a heap-allocated structure to give random access to them.
BUG=
R=asgerf@google.com, jensj@google.com
Review-Url: https://codereview.chromium.org/2790073004 .