Commit graph

11610 commits

Author SHA1 Message Date
John McCutchan 0e9b4123db Mark awaiter_async_stack_contents_test as failing on kernel bots
BUG=

Review-Url: https://codereview.chromium.org/2787523002 .
2017-03-29 08:47:14 -07:00
John McCutchan 2815f3f775 Implement debugger support for async step-out
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2777093006 .
2017-03-29 07:44:18 -07:00
John McCutchan 8cee5258ee Fix crash when determining whether an async exception is handled
BUG=

Review-Url: https://codereview.chromium.org/2780163002 .
2017-03-29 07:30:29 -07:00
Kevin Millikin ed77783cd3 Remove definitions from Kernel canonical names.
Before: Canonical names contained pointers to the corresponding Kernel
tree which assumed that the whole tree was in memory whenever the
canonical names were.

Now: Canonical names do not contain these pointers.  They were only
really used to perform name-based lookup in the VM's heap so the
canonical name itself is enough.

If we later find that we need to get from a canonical name to its
Kernel tree we can add an offset in the binary (for instance) to the
canonical name or in a separate mapping on the side.

BUG=
R=asgerf@google.com, vegorov@google.com

Review-Url: https://codereview.chromium.org/2781893004 .
2017-03-29 16:03:03 +02:00
John McCutchan d8555fb5a8 Include the awaiter stack trace in the service protocol
- [x] Include the (non-empty) awaiter stack trace in every `getStack` RPC.
- [x] Append the causal stack trace to the final frame of the awaiter stack trace.
- [x] Unit test for awaiter stack trace.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2782703002 .
2017-03-29 06:56:50 -07:00
Vyacheslav Egorov 536c610fd2 Update status files for all test suites for -c dartk / -c dartkp configuration.
We are going to switch to testing all testsuites instead of just limiting ourselves to

co19 language kernel service

BUG=
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2780943004 .
2017-03-29 13:18:57 +02:00
Jens Johansen 00ef784f0c [kernel] Don't use kernel ast nodes as keys
ScopeBuildingResult now uses 'IntMap's instead, i.e. doesn't use kernel objects as key
function_scopes doesn't contain function but dill file offset

BUG=
R=kmillikin@google.com

Committed: bc7200c392
Review-Url: https://codereview.chromium.org/2778693002 .
2017-03-29 09:57:13 +02:00
Jens Johansen 1c47104695 Revert "[kernel] Don't use kernel ast nodes as keys"
Commit made everything go red.

This reverts commit bc7200c392.

BUG=

Review-Url: https://codereview.chromium.org/2778423002 .
2017-03-29 08:44:39 +02:00
Jens Johansen bc7200c392 [kernel] Don't use kernel ast nodes as keys
ScopeBuildingResult now uses 'IntMap's instead, i.e. doesn't use kernel objects as key
function_scopes doesn't contain function but dill file offset

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2778693002 .
2017-03-29 08:39:37 +02:00
Ryan Macnak 8df8025f2a When linking natives lazily (as in AOT compilation), don't resolve them eagerly.
Avoids requiring an embedder to setup native stubs for functions that aren't called just to run Dart_Precompile.

Issue #24686

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2779703003 .
2017-03-28 15:29:26 -07:00
Zachary Anderson 7c8a0a7fe1 Fix Dartium build
Review-Url: https://codereview.chromium.org/2778953005 .
2017-03-28 08:42:30 -07:00
Zachary Anderson 89dba57bcf [dart:io] Adds a finalizer to _NativeSocket to avoid socket leaks
The finalizer sends the "close" message to the EventHandler for the
file descriptor in the _NativeSocket's native field. To avoid races and
spurious messages, this CL stores a pointer to a wrapper object in the
native field instead of the file descriptor. All messsages about the
_NativeSocket sent to the EventHandler use the wrapper object instead of
the file descriptor. When the EventHandler closes the file, the file
descriptor in the wrapper object is set to -1 so that the finalizer will
instead do nothing.

On Windows, there is another level of indirection since the OS HANDLEs
were already wrapped in various kinds of Handle objects. As an additional
complication, ClientSocket close on Windows is asynchronous, so the
EventHandler may shutdown before all of the ClientSocket Handles can be
destroyed.

related #27898, #28081

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2760293002 .
2017-03-28 07:44:05 -07:00
Asger Feldthaus a3402df15c [Kernel] Remove code from the old type propagation.
BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2780513004 .
2017-03-28 12:43:22 +02:00
Jens Johansen b5a7a94305 Revert "VM: [Kernel] Avoid emitting :expr_temp and capturing :iterator"
This commit caused vm-kernel-linux-debug-x64-be to become red because
service/next_through_simple_async_test failed.

This reverts commit 3d78c06412.

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2777413002 .
2017-03-28 09:29:04 +02:00
Jens Johansen 2ad253ed6b Mark pause_on_unhandled_async_exceptions2_test flaky on app_jit
See https://github.com/dart-lang/sdk/issues/29178.

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2774233004 .
2017-03-28 08:59:50 +02:00
Ryan Macnak 857b8cbc36 Teach treeshaker about new cached functions and classes.
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2781553004 .
2017-03-27 18:02:00 -07:00
John McCutchan 11cf515e5e Cleanups needed for async step-out
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2774233003 .
2017-03-27 15:18:41 -07:00
Ben Konyi 7c820f4363 Resubmission of native memory allocation info surfacing in Observatory. Fixed crashing tests and stack trace collection skip counts for different configurations.
Fixed missing method referenced when MallocHooks is unsupported.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2771293003 .
2017-03-27 13:25:26 -07:00
John McCutchan f7d570dab2 Fix an assertion failure in the profiler
- [x] Always reset the inlined functions cache before reusing an entry.

Fixes #29173

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2779613004 .
2017-03-27 12:29:34 -07:00
Dmitry Olshansky a8bc1de524 VM [KERNEL] Fix performance issue in KernelReader
Original code is constructing Class fields
and functions incrementally going through
poorly scalable AddFunction and AddField
reallocating the whole array on each call.

Instead accumulate things in GrowableArrays
and insert in one go.

BUG= https://github.com/dart-lang/sdk/issues/28312
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2777963002 .
2017-03-27 20:24:15 +02:00
John McCutchan 85a154fe84 Dump information when we hit the weird assertion failure in profiler
BUG=

Review-Url: https://codereview.chromium.org/2774403002 .
2017-03-27 10:55:58 -07:00
Ryan Macnak 0867d87767 Resolve initialization order fiasco between code_descriptors.cc and token_position.cc.
BUG=b/36622728
R=asiva@google.com, johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2772193004 .
2017-03-27 10:24:01 -07:00
Dmitry Olshansky 3d78c06412 VM: [Kernel] Avoid emitting :expr_temp and capturing :iterator
This allow us bypass allocation of Context for some sync*
function such as in Iteration.tree.syncstar benchmark.

BUG=
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2772963003 .
2017-03-27 19:22:52 +02:00
P.Y. Laligand 8f03520d2b New dart CLI option to create a snapshot depfile. (#29165) 2017-03-27 06:44:21 -07:00
Kevin Millikin d715611c03 Use canonical names for some name-based lookup.
For compiling the platform libraries separately and for hot reload, we
will not link canonical names of Kernel libraries, classes, and
members to their Kernel definitions.  Those definitions will not be
persistent.

As a first step, change name-based lookup of libraries and classes to
be be based on the canonical name instead of the Kernel definition.

BUG=
R=jensj@google.com, kustermann@google.com

Committed: a15b8c49ea
Review-Url: https://codereview.chromium.org/2762213002 .
2017-03-27 12:14:50 +02:00
John McCutchan ada90ae4f2 Update the correct status file for the kernel bots
BUG=

Review-Url: https://codereview.chromium.org/2773073004 .
2017-03-24 14:54:30 -07:00
Ryan Macnak a42b802bcc Standalone support for AOT as dylibs on Fuchsia.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2774993002 .
2017-03-24 14:52:18 -07:00
John McCutchan bfde95b58f Update status file for kernel bot
BUG=

Review-Url: https://codereview.chromium.org/2775863005 .
2017-03-24 14:49:35 -07:00
Ryan Macnak a52db232d6 When generating CodeSourceMaps, reassign function ids once per function instead of once per inlining site.
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2768153002 .
2017-03-24 14:41:36 -07:00
John McCutchan dacadf89d1 Hacky fix for kernel bots
BUG=

Review-Url: https://codereview.chromium.org/2766353005 .
2017-03-24 12:18:21 -07:00
Ryan Macnak b43827350e Use Linux-style section names for DWARF on Fuchsia.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2768003004 .
2017-03-24 10:01:35 -07:00
Ben Konyi 9ea672efc0 Revert "Added page to Observatory to display native memory allocation information."
This reverts commit f30f312b48.

Revert "Fixed missing method referenced when MallocHooks is unsupported."

This reverts commit a0b9c5a178.

TBR=johnmccutchan@google.com

BUG=

Review-Url: https://codereview.chromium.org/2773073003 .
2017-03-24 09:47:29 -07:00
Vyacheslav Egorov 52e2dadea3 VM: [Kernel] Ensure that result of v.operator[]=(...) invocations is never used.
Currently Fasta translates cascade of indexed assignments into a cascade of
let-statements.

For example code like

```dart
  indices
    ..[0] = 0
    ..[_schemeEndIndex] = start - 1
    ..[_hostStartIndex] = start - 1
    ..[_notSimpleIndex] = start - 1
    ..[_portStartIndex] = start
    ..[_pathStartIndex] = start
    ..[_queryStartIndex] = end
    ..[_fragmentStartIndex] = end;
```

gets translated to

```
  let final dynamic #t826 = indices in
    let final dynamic #t827 = #t826.[]=(0, 0) in
      let final dynamic #t828 = #t826.[]=(core::_schemeEndIndex, start.-(1)) in
        let final dynamic #t829 = #t826.[]=(core::_hostStartIndex, start.-(1)) in
          let final dynamic #t830 = #t826.[]=(core::_notSimpleIndex, start.-(1)) in
            let final dynamic #t831 = #t826.[]=(core::_portStartIndex, start) in
              let final dynamic #t832 = #t826.[]=(core::_pathStartIndex, start) in
                let final dynamic #t833 = #t826.[]=(core::_queryStartIndex, end) in
                  let final dynamic #t834 = #t826.[]=(core::_fragmentStartIndex, end) in
                    #t826;
```

This later becomes in IL (on the example of `#t826.[]=(0, 0)`):

```
    t0 <- InstanceCall:120( []=, t0, t0, t0)
    StoreLocal(:var1 @-19, t0)
```

After SSA construction if locals liveness analysis is disabled
(`--no-prune-dead-locals`) we get essentially redundant phis constructed for
temporary let-variables which actually use result of the instance call:

```
    v25 <- InstanceCall:120( []=, v22, v24, v24)
...
    v629 <- phi(v636, v25)
```

These phis are redundant because their values can never be observed by the
program because they correspond to dead stores. In fact these phis only have
environment uses.

However subsequent optimization passes assume that result of a `v.[]=(...)`
invocation can never be used and replace `v.[]=(...)` with IL sequences that
don't actually produce any value - leading to malformed graphs where phis
refer to instructions outside of the graph.

To workaround the issue we explicitly drop the actual result of `v.[]=(...)`
and push a null-value to be used instead.

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

R=kmillikin@google.com, kustermann@google.com

Review-Url: https://codereview.chromium.org/2769313004 .
2017-03-24 17:35:05 +01:00
Ben Konyi a0b9c5a178 Fixed missing method referenced when MallocHooks is unsupported.
Added page to Observatory to display native memory allocation information.

BUG=

Review-Url: https://codereview.chromium.org/2778463002 .
2017-03-24 09:34:48 -07:00
Ben Konyi f30f312b48 Added page to Observatory to display native memory allocation information.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2748403002 .
2017-03-24 09:20:25 -07:00
John McCutchan 07a257573d Debugger support for step-into async and async* functions.
- [x] Support stepping into an async function.
- [x] Support stepping into the async generator in an await for loop.
- [x] Unit test for async function.
- [x] Unit test for async* function.

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

Review-Url: https://codereview.chromium.org/2768103002 .
2017-03-24 07:56:50 -07:00
Peter von der Ahé ec5d7cba1a Implement character offsets for fields and enum constants.
R=jensj@google.com

Review-Url: https://codereview.chromium.org/2771983004 .
2017-03-24 15:29:42 +01:00
Regis Crelier 3b33596ab0 Remove outdated special handling of 'void' when parsing class members.
This caused parsing of 'void Function() field;' to fail.
No regression test was added since lots of them are about to land with this cl:
https://codereview.chromium.org/2707033004

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2774713002 .
2017-03-23 10:49:14 -07:00
John McCutchan e246034fca Make :embedded_observatory_archive compilable on Win for Flutter
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2769893002 .
2017-03-23 10:19:57 -07:00
Ben Konyi c0511ad2ef Reimplemented zone memory tracking to avoid race conditions that were causing crashes in the previous implementation and made some minor name changes.
BUG=
R=asiva@google.com, johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2762323002 .
2017-03-23 09:03:08 -07:00
Kevin Millikin 91bc604415 Revert "Use canonical names for some name-based lookup."
This reverts commit a15b8c49ea.

BUG=

Review-Url: https://codereview.chromium.org/2772803002 .
2017-03-23 14:21:06 +01:00
Kevin Millikin a15b8c49ea Use canonical names for some name-based lookup.
For compiling the platform libraries separately and for hot reload, we
will not link canonical names of Kernel libraries, classes, and
members to their Kernel definitions.  Those definitions will not be
persistent.

As a first step, change name-based lookup of libraries and classes to
be be based on the canonical name instead of the Kernel definition.

BUG=
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2762213002 .
2017-03-23 12:24:05 +01:00
Jens Johansen dc566e137b [kernel] Fix getter, run service tests in debug mode
Don't create getters for uninitialized static fields.
This fixes two assert hits that was hit when running service tests in debug mode via kernel. These can thus now be enabled.

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2771443003 .
2017-03-23 08:26:10 +01:00
Ryan Macnak 442d177d3d Make gen_snapshot quiet for the Fuchsia build.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2774523002 .
2017-03-22 18:14:49 -07:00
Ryan Macnak 38da7d4858 Fix Dartium build.
Review-Url: https://codereview.chromium.org/2774533002 .
2017-03-22 18:05:54 -07:00
Ryan Macnak 2aecd5e588 Make --trace-loading great again.
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2775463002 .
2017-03-22 17:06:42 -07:00
Florian Schneider 030473f0ff Fix the fix for the native symbol resolver on Windows.
The 'start' output parameter is optional, so check for NULL is required.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2772563002 .
2017-03-22 14:50:18 -07:00
Zachary Anderson 6f45ea2247 [vm service] Have HTTP server retry binding for 10 seconds
This is for Fuchsia, where Flutter apps may start before the network
stack has finished initializing.

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2772463003 .
2017-03-22 14:20:39 -07:00
Florian Schneider 9111df606e Fix Windows native code profiling.
The start address for native symbols is now correctly computed.

Before it was left 0 - the symbol lookup code was just enabled in my previous CL.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2770863002 .
2017-03-22 14:17:48 -07:00
Florian Schneider c32bfb4e34 Enable native symbol resolving on Windows again
This is needed when dumping stack traces.

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2768913002 .
2017-03-22 12:51:40 -07:00