- Instead of a pointer to new'd memory, Kernel strings now have an
offset from the start of the string data.
- When the streaming reader encounters the string data it records the
offset from the start of the binary. This offset is stored in the
Kernel Program and is used to compute the offset for strings.
- When a KernelReader is constructed, the string data is copied into a
Uint8 array in the VM's heap.
- A pointer to the string data is put into every Kernel script so it
can be used for constructing VM strings at compile time.
The source table does not use Kernel strings any more because those
strings are not found in the raw string data. Instead, the source
table uses new'd buffers for strings (but this will be cleaned up
separately).
R=jensj@google.com
Review-Url: https://codereview.chromium.org/2820363002 .
function cloning for mixins, signature building, etc...).
Rename --generic-method-semantics flag to --reify-generic-functions (still not
working and disabled by default).
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2835513002 .
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 .