Commit Graph

11734 Commits

Author SHA1 Message Date
Zachary Anderson 135b1907ee [Fuchsia] Grab the number of malloc'd bytes from jemalloc
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 .
2017-04-19 15:51:02 -07:00
Ryan Macnak 8b96a31c7f Move runtime functions to the more logical runtime_entry.cc.
Make --trace-runtime-calls respect the isolate filter.

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2827873002 .
2017-04-19 10:22:04 -07:00
Régis Crelier f0622c0567 Allow signature functions to be allocated in new space.
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 .
2017-04-19 10:10:44 -07:00
Ryan Macnak 17e43f284b Tree shaker:
- 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 .
2017-04-19 10:03:43 -07:00
Erik Corry 0856863355 Fall back to megamorphic stub when dispatching calls to rare classes.
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 .
2017-04-19 15:25:24 +02:00
Régis Crelier 4dd686e9df More work on finalization of recursive types (fixes #29357).
Add regression test.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2822323002 .
2017-04-18 17:18:39 -07:00
Jacob Richman b7995140f8 Revert "Fix #28740 demangle constructors in stack traces (A.A becomes new A)."
This reverts commit a84b6b7f7b.

BUG=

Review-Url: https://codereview.chromium.org/2824323002 .
2017-04-18 16:48:33 -07:00
Jacob Richman b67e83eea3 Format all remaining unformatted runtime files other than multitests.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2829463003 .
2017-04-18 15:34:03 -07:00
Mike Fairhurst a84b6b7f7b Fix #28740 demangle constructors in stack traces (A.A becomes new A).
Regular constructors and unnamed factory constructors:
- Were A.A, now are new A
Named constructors (including factory constructors):
- Were A.A.name, now are new A.name

BUG=
R=asiva@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/2818933003 .
2017-04-18 15:18:29 -07:00
Ryan Macnak b15cf1c490 Fix VM crash when encountering an assignment expression in a case expression.
Fixes #29370
Issue #29379

R=regis@google.com

Review-Url: https://codereview.chromium.org/2825843003 .
2017-04-18 13:48:06 -07:00
Siva Annamalai 96bbe512eb Fix for issue 29350 - VM Crashes when covariant is used incorrectly.
BUG=#29350
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2827453003 .
2017-04-18 11:10:28 -07:00
Vyacheslav Egorov 8f563f2c32 VM: Prohibit reload when throwing or processing language errors.
This fixes flaky crashes on negative tests in stress reload mode: when
we attempt to reload an isolate while throwing/formatting compile time error.

Fixes https://github.com/dart-lang/sdk/issues/27835

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2825043002 .
2017-04-18 18:51:49 +02:00
Erik Corry 2a2de1aa23 Temporary fix to ameliorate severe dart2js regression on some workloads
R=vegorov@google.com
BUG=https://github.com/dart-lang/sdk/issues/29302

Review-Url: https://codereview.chromium.org/2798333004 .
2017-04-18 09:42:23 +02:00
Zachary Anderson 9ce608e89d [dart:io] Adds ProcessInfo.{max,current}Rss. Adds OS::MaxRSS on Fuchsia.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2822943002 .
2017-04-17 14:41:40 -07:00
Zach Anderson d42f61155f [fuchsia] Use new mx_deadline_after interface
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2822833002 .
2017-04-17 13:49:49 -07:00
John McDole d22325025d Fix include paths in runtime/include (#29362)
* Fix include path 

"dart_api.h" is in the same directory as "dart_tools_api.h"

* Update dart_mirrors_api.h

* Update dart_native_api.h
2017-04-17 11:04:47 -07:00
Ryan Macnak 1c62b6b772 Make --trace-natives respect the isolate filter.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2818253002 .
2017-04-17 10:22:50 -07:00
Ryan Macnak 29de769d98 Allow the resolved names cache to be lazily created like the exported names cache.
R=regis@google.com

Review-Url: https://codereview.chromium.org/2823633003 .
2017-04-17 10:07:27 -07:00
Ryan Macnak 0733810528 Use to_snapshot when cluster serializing LibraryPrefixes.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2822843002 .
2017-04-17 09:04:13 -07:00
Régis Crelier fd5089c9e8 Remove parent_level field of function type parameters.
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 .
2017-04-17 08:58:24 -07:00
Ryan Macnak b810cb2fe5 Ensure resolved packages before _Dart_kResolveAsFilePath.
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2820853002 .
2017-04-14 15:55:03 -07:00
Mike Fairhurst bffe47e678 First stab at #29153 range check in as-casts. Mostly working.
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 .
2017-04-13 10:44:57 -07:00
John McCutchan 6f039b508b Kill dead code
BUG=

Review-Url: https://codereview.chromium.org/2819573002 .
2017-04-13 09:55:13 -07:00
John McCutchan 7399d4bdec DBC follow up CL
- [x] Hoist handle out of loop.
- [x] Avoid allocating a handle.

BUG=

Review-Url: https://codereview.chromium.org/2819523003 .
2017-04-13 07:38:15 -07:00
Ryan Macnak 00c2af904f GN: Remove dead target 'libdart' and dead flag 'dart_experimental_interpreter'.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2819453002 .
2017-04-12 16:05:37 -07:00
Ryan Macnak 39040a8a15 Never erase parameter types in the JIT.
Even in unchecked mode with mirrors disabled, we need to be able to forward parameter types to lazily generated implicit closure functions.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2808763008 .
2017-04-12 15:40:42 -07:00
Ben Konyi 9745386d63 Added sync_socket_unsupported.cc to sources file
BUG=

Review-Url: https://codereview.chromium.org/2814293002 .
2017-04-12 15:22:41 -07:00
Ben Konyi 7549bc6b48 Added missing sync_socket_unsupported.cc and fixed issues in test which were causing analysis errors
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2814283002 .
2017-04-12 15:13:10 -07:00
John McCutchan 9af072399e Fix reload bots
BUG=

Review-Url: https://codereview.chromium.org/2812373003 .
2017-04-12 14:36:38 -07:00
Ryan Macnak 5cffc591aa Refactor AOT deduplication steps so they can run before an app-jit snapshot as well.
Additionally dedup PcDescriptors, deopt entries, deopt lists, and await token position lists.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2815533003 .
2017-04-12 14:23:49 -07:00
Ben Konyi 6fbdd19ddb Various fixes for sync socket implementation.
Revert "Revert "Added sync_socket.h include in sync_socket_win.cc""

This reverts commit 2bd6168e1ebf35f6dbd9b2724339362c493377fc.

Revert "Revert "Added synchronous socket implementation to dart:io.""

This reverts commit a47bce03f5502dac7fb12e777e87b5aa1cfc830b.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2814773004 .
2017-04-12 14:20:48 -07:00
Ryan Macnak 91da7428f3 Add --print_stacktrace_at_api_error.
Should be helpful in tracking down flutter/flutter#8612.

Prefer stack bounds from pthreads when available to be able to see frames below the Dart entry frame.

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2813283002 .
2017-04-12 14:09:19 -07:00
John McCutchan 99c6a18a1b Attempt 2 -- Fix updating packages map on reload and add a regression test
- [x] Update the isolate's .packages path when requested.
- [x] Always refresh package map when loader is initialized.
- [x] Add regression test.

Review-Url: https://codereview.chromium.org/2810223003 .
2017-04-12 14:02:19 -07:00
John McCutchan f0734f99b3 Detect unhandled exceptions in async functions without an awaiter
- [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 .
2017-04-12 13:15:41 -07:00
Regis Crelier 25dbc9b28a Fix look-ahead parsing code in the VM (fixes #29243).
Add regression test.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2812323002 .
2017-04-12 11:04:21 -07:00
Ben Konyi b439bd9a54 Revert "Added synchronous socket implementation to dart:io."
This reverts commit a1f87ebdb8.

Revert "Added sync_socket.h include in sync_socket_win.cc"

This reverts commit bdec13e865.

BUG=

Review-Url: https://codereview.chromium.org/2812153002 .
2017-04-11 15:18:46 -07:00
Ben Konyi bdec13e865 Added sync_socket.h include in sync_socket_win.cc
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2809153003 .
2017-04-11 15:14:35 -07:00
Ben Konyi a1f87ebdb8 Added synchronous socket implementation to dart:io.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2803543006 .
2017-04-11 14:41:09 -07:00
Regis Crelier 659511d518 Fix type parameter invocation in the VM (fixes #19725).
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2814833003 .
2017-04-11 13:31:30 -07:00
Zachary Anderson d52a6a39d5 [dart:io] Fix crash in fetching the error message from BoringSSL
fixes #29307

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2812623005 .
2017-04-11 11:04:44 -07:00
Regis Crelier d8c17c90f2 Process a pair of registers in one instruction where possible on arm in the VM.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2813903003 .
2017-04-11 10:48:45 -07:00
Ryan Macnak 9ce48e63b2 Remove background finalization.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2809863002 .
2017-04-11 09:54:25 -07:00
Regis Crelier d0a7bad121 Pass a second type argument vector to all type instantiation calls in the VM.
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 .
2017-04-10 21:25:33 -07:00
Zachary Anderson 6756e4d3ce [fuchsia] Fix shutdown crash
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2812753002 .
2017-04-10 15:46:08 -07:00
Regis Crelier 820f8d74e6 Added missing canonicalization of typedef signature instantiated during
finalization (fixes #29300).

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2811643004 .
2017-04-10 15:15:31 -07:00
Ryan Macnak 42ec925a9e GN: Add libdart_jit and dart_api.
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 .
2017-04-10 13:44:25 -07:00
John McCutchan 94df115e4b Revert "Fix updating packages map on reload and add a regression test"
This reverts commit 7a2d67f3ba.

BUG=

Review-Url: https://codereview.chromium.org/2808953003 .
2017-04-10 12:30:38 -07:00
John McCutchan bf3d374541 Dump some state when complex_reload_test fails
BUG=

Review-Url: https://codereview.chromium.org/2814573002 .
2017-04-10 12:13:16 -07:00
John McCutchan 80c27841a3 Fix logic bug in loader code
BUG=

Review-Url: https://codereview.chromium.org/2815433002 .
2017-04-10 11:13:46 -07:00
Regis Crelier 8ca244ba27 Make finalization of recursive function types more robust, especially since
the Kernel frontend may omit the information that a function type is a typedef.
Re-enable several previously failing tests for dartk.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2806893002 .
2017-04-10 11:06:14 -07:00