Commit Graph

713 Commits

Author SHA1 Message Date
Ryan Macnak c6bc0031f3 [vm, bytecode] Field initializer for schema changes.
Bug: https://github.com/dart-lang/sdk/issues/32299
Change-Id: Id6359ad36db183f4cdd091e7fd778c879e868d99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108901
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-07-15 22:58:16 +00:00
Ben Konyi 8e3a75c3fe [ VM / Observatory ] Fixed getInstances invocation still using 'classId' instead of 'objectId' parameter.
Change-Id: I6e56b927b317e685b384949fb2f8554323f71e43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108686
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-07-10 22:59:00 +00:00
Ben Konyi 0de18dce6c [ VM / Service ] Make _registerService and related streams / events public
Change-Id: I243bed9e1f4b3bbcfd232a8c27bf352f55284644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108366
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-07-10 16:07:15 +00:00
Ben Konyi 43891316ca [ VM / Observatory ] Emit IsolateReload event after reload completes
Also fixed issue in observatory where script object ID expires in
source_link after a reload, spewing exception dialogues.

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

Change-Id: Ic52a2879fae5366e88d6dd3a3fb81490902f8bd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108164
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-07-03 20:40:37 +00:00
Ben Konyi 6af218685e [ VM / Service ] Add getInstances and InstanceSet to the service protocol.
Change-Id: Ia5aab0f1bbdb99a7690a107eeef08de6a1f33656
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106561
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-19 23:59:32 +00:00
Ben Konyi a75ded625e [ VM / Service ] Made VM timeline functionality public through the service API.
Change-Id: I8228f0417047af53edc6f570940d452da3155bbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106061
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-06-19 16:06:12 +00:00
Ben Konyi 74af4a00b2 [ VM / Service ] Created public implementation of getAllocationProfile RPC
Change-Id: I8c8cb4d47466ae6a298961652eeded762c769568
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105730
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-06-13 23:45:52 +00:00
Ben Konyi 554f9db768 [ VM / Service ] Made Logging event and LogRecord public
Change-Id: Ib1c99a1f2483b98bc414edb9ad0b109ce909cecb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100661
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-28 19:20:40 +00:00
Daco Harkes 50b0d85804 [vm/ffi] Observatory support for FFI
Fixes: https://github.com/dart-lang/sdk/issues/36845

Change-Id: Ia013e5930655893db2384ffb141ab6e96843e653
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103812
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-05-28 10:19:27 +00:00
Kevin Moore eba45291fb [observatory] Cleanup unused imports, fix warning about SDK version
Change-Id: I80f1861b8dd1d1fa5eea93cc305fa0ee2475580d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101884
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2019-05-13 16:27:41 +00:00
Ryan Macnak a91cc6c701 [observatory] Remove use of custom elements.
document.registerElement is going away soon, and dart2js never implemented window.customElements.define.

Replace the inheritance with composition for each FooElement.

When used to create a DOM tree, replace `new FooElement()` with `new FooElement().element`.

In CSS, replace each custom element selector with a class selector, i.e. `foo-element` with `.foo-element`.

Bug: https://github.com/dart-lang/sdk/issues/34107
Change-Id: Id5ab5b6104a6165a8ad3b01d73ee9d76e46024ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101061
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-05-08 18:23:26 +00:00
Jens Johansen a58aa6f705 Fix NoSuchMethodError in observatory when setting breakpoint via debugger console
Reproduction without this fix:
Create 2 files, test1.dart and test2.dart:

```
$ cat test1.dart
import "test2.dart";

main() {
  test();
  test();
}

$ cat test2.dart
test() {
  // blank line.
  print("hello");
}
```

Launch with observatory enabled and paused at start, e.g.
`out/ReleaseX64/dart --observe --pause-isolates-on-start test1.dart`

Set a breakpoint on the second (*not* the first!) call to `test()`.
Continue execution.
Now write `break test2.dart:2` into the debugger console and you will be
presented with a stack trace looking something like this:

```
Unexpected exception:

NoSuchMethodError: method not found: 'gi4'
Receiver: Instance of 'minified:hS'
Arguments: []

StackTrace:

main.dart.js 459:3      Object.n
main.dart.js 15752:9    hS.G
main.dart.js 15901:28   hS.gi4
main.dart.js 40703:10   GE.$1
main.dart.js 43127:29   Hz.$0
main.dart.js 43100:9    pN.lG
main.dart.js 43124:12   HA.$1
main.dart.js 43127:29   Hz.$0
main.dart.js 43100:9    pN.lG
main.dart.js 43124:12   HA.$1
===== asynchronous gap ===========================
main.dart.js 14033:115  LH.cG
main.dart.js 13585:17   qm.eB
main.dart.js 13571:3    qm.kC
main.dart.js 13870:3    cQ.aV
main.dart.js 13873:27   cQ.I
main.dart.js 40226:79   P.R
===== asynchronous gap ===========================
[...]
```

This CL fixes the issue by catching the NoSuchMethod
(it will succeed for UnresolvedSourceLocation for instance)
and then using the scriptref and token position on the
abstract class Location to get the actual line.

Change-Id: Id951e2727a5edb8ba52a65959c833dcbf923406c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98667
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-04-23 08:58:58 +00:00
Ryan Macnak d9c40462c2 [vm] Rename kImplicitStaticFinalGetter to kImplicitStaticGetter.
This function kind is used for any static field with an initializer. It has nothing to do with whether the field is final.

Change-Id: I3faa2d2d77fd4bbd801624bc0bba88476b8f3cb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99622
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-17 00:47:15 +00:00
Ryan Macnak 144bfdfce6 [vm] Use a separate kind tag for static field initializers.
This is preparation for handling implicit static getters as a bytecode.

Change-Id: Ic9fd186161d900c3b4c0bb773726b0cd0f35451e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99105
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-15 22:54:36 +00:00
Ben Konyi 15b11b0183 [ VM / Service / Observatory ] The VM service now requires an authentication code by default.
Previously, a valid web socket connection would use the following URI:

`ws://127.0.0.1/ws`

Now, by default, the VM service requires a connection to be made with a
URI similar to the following:

`ws://127.0.0.1:8181/Ug_U0QVsqFs=/ws`

where `Ug_U0QVsqFs` is an authentication code generated and shared by the
service.

This behavior can be disabled with the `--disable-service-auth-codes`
flag.

Change-Id: I288aac58e3ba9d35dca8071f3f7e7a073896c271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98433
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-04-09 22:57:29 +00:00
Ryan Macnak 6d934b94c5 [vm, service] Remove _getCrashDump.
This has been broken since Dart 2.

Bug: https://github.com/dart-lang/sdk/issues/36281
Change-Id: I1b92c079ca3d7720a654c56457fd5aebeb7b8df4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97445
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-04-02 18:00:49 +00:00
Ben Konyi 380ae2ce55 [ Observatory ] Fixed links for 'part's in dart:* scripts not being created.
For example in the dart:io script, `part 'bytes_builder.dart';` would not
link to the script inset for 'bytes_builder.dart'.

Change-Id: I9252980cb2621f0bc2ea4b224209cb07dc21b896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97848
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-03-28 16:35:35 +00:00
Ben Konyi 585eb7f507 [ VM / Service ] Added disableBreakpoints parameter to evaluate, evaluateInFrame and invoke RPCs
- Setting the `disableBreakpoints` parameter to true will result in any
breakpoints hit during execution resulting from an evaluate or invoke
call to be ignored.
- Default behavior is the same (break on breakpoints).
- Updated Observatory eval box to disable breakpoints.
- Added tests

Change-Id: Ibf40f8a8de018718435118e13cc2e969f8ed7944
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95320
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-03-08 02:19:06 +00:00
Ben Konyi b61efcd3c4 [ VM / Service ] Started cleaning up tests for the service protocol.
Mostly focused on app_jitk tests in this CL, but updated issue numbers
and statuses where appropriate.

Change-Id: I6b57d0a3091ad10ddd143c5b420f6b2121e9cc73
Reviewed-on: https://dart-review.googlesource.com/c/88128
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-12-28 20:53:39 +00:00
Ryan Macnak e92c7678a7 [vm, observatory] Respect requested tag order even when --profile-vm=false.
Blame time waiting for service or kernel isolate startup against LoadWait instead of VM.

In the table profile view, include VM tags. Because of the flattening nature of this view, it is less intrusive than in the tree view.

Bug: https://github.com/dart-lang/sdk/issues/35394
Change-Id: If13c57daa96cb69c5e5a009dfd973b491b694d04
Reviewed-on: https://dart-review.googlesource.com/c/87380
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-12-17 23:35:24 +00:00
Régis Crelier 5f36c5f9d8 [vm] Delete BoundedType class in VM.
In Dart2, type bounds checking is either performed by the common front-end or
by explicitly generated code, but not by type finalization or runtime anymore,
as it was done in Dart1.
Consequently, the class BoundedType is not needed anymore, and malbounded or
malformed types are not seen by the runtime either.

Change-Id: I5d6e4c68d153d6730fa7ff7f6d9dcfa611299c16
Reviewed-on: https://dart-review.googlesource.com/c/86687
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-12-10 23:15:27 +00:00
Ryan Macnak 488d1f375c [vm] Make profiler bailout counters available over the VM service.
Change-Id: I4c0d30b21371e33f66ab142636aa669a46f8a799
Reviewed-on: https://dart-review.googlesource.com/c/85547
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-29 21:53:24 +00:00
Ryan Macnak 2535b1e021 [vm] Account for bytecode in profile processing and Observatory.
Change-Id: I220eca1f4a3aadaa271ead4de698c28e4a7b653a
Reviewed-on: https://dart-review.googlesource.com/c/84447
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-11-15 17:42:13 +00:00
Ben Konyi 5afc1ec336 [ VM / Observatory ] Fixed tests that were failing due to lack of sources in app_jitk mode
Change-Id: I74504cc5dea30a0b6841e0bf77d99c1cf3889269
Reviewed-on: https://dart-review.googlesource.com/c/84049
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2018-11-14 18:00:53 +00:00
Kevin Moore 037792876a Fix analysis hints/warnings in runtime/observatory
Change-Id: I1afee0f09476185b2690e0c2bc98a4b7ae7bffa6
Reviewed-on: https://dart-review.googlesource.com/c/83480
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-11-09 00:52:44 +00:00
Ryan Macnak 662ff7f112 [vm] Remove TokenStream, TokenValue, CompilerStats.
(CompilerStats timers have been replaced with the timeline events.)

Change-Id: Iddcb752c085de9762eb802371b6d2905fa608a76
Reviewed-on: https://dart-review.googlesource.com/c/79086
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-10-10 21:39:45 +00:00
Ryan Macnak 72b31316e4 [observatory] Fail gracefully when a Script lacks source code.
Change-Id: I0d19b6da1543447c50a47d70fb896c4d92afa3d4
Reviewed-on: https://dart-review.googlesource.com/c/79084
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-10-10 21:03:14 +00:00
G?nter Z?chbauer 2da0b9f4f1 fix some typos
Closes #34738
https://github.com/dart-lang/sdk/pull/34738

GitOrigin-RevId: d211bbacfe65355cf7304c990ffb6c79d7a229cf
Change-Id: If690e6d378e543b300e1f6a353ceae73e39c29db
Reviewed-on: https://dart-review.googlesource.com/c/78900
Reviewed-by: Alexander Thomas <athom@google.com>
2018-10-10 19:15:30 +00:00
Zach Anderson b4b02a6bde [vm] Include bytecode in core-jit and app-jit snapshots
when the --enable_interpreter flag is passed to gen_snapshot/dart.

Change-Id: I6e9481e1793e4c97fd6b14b56e55aafcb044fc23
Reviewed-on: https://dart-review.googlesource.com/c/78150
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-10-08 19:51:10 +00:00
asiva 76470aca47 [VM] use coresnapshot when initializing an Isolate
- use core snapshot when initializing an isolate (CorelibIsolateStartup benchmark moves from 39s to 2s)
- remove use_dart_frontend flag from the isolate specific flags
- the script snapshot API functions now return an error

Change-Id: Ia562e007fdbfd1d3ebd8e1a0c8feee238bada00b
Reviewed-on: https://dart-review.googlesource.com/76709
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-27 00:55:07 +00:00
Jens Johansen d560887ae5 Fix TypeError in Observatory
Get rid of stuff like this (that at least showed up in debug builds):
```
Unexpected exception:

TypeError: 604.0795288085938: type 'JSDouble' is not a subtype of type
'int'

StackTrace:

main.dart.js 3527:17   Object.wrapException
main.dart.js 4000:15   Object.intTypeCheck
main.dart.js 55623:39  HtmlElement._varsTop$1
main.dart.js 55631:23  HtmlElement.dart.DebuggerFrameElement._onScroll$1
main.dart.js 3941:14   Object.eval
[...]
```

(Note that I disabled minification in the example above).

Change-Id: Id79e726c3229ba96b1df5db7d4fb779e4be0913a
Reviewed-on: https://dart-review.googlesource.com/74623
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-09-20 06:59:44 +00:00
Jens Johansen 03d68355d6 More observatory fixes
Change-Id: I0a31f70a6c3e1472859c9ae8798dd498e221d672
Reviewed-on: https://dart-review.googlesource.com/70505
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-20 07:11:33 +00:00
Jens Johansen 06a785bf1e Speedup calculation of toplist by retained memory in Observatory
When clicking the "toplist by retained memory" button in Observatory
it always asks to find 10 objects of a specific size.
The previous implementation did this by taking all objects (millions if
using a lot of memory), sorting it (O(n log n)), filtering it (O(n)),
and ".take"ing the 10 we wanted. Total runtime should be O(n log n)
where n is the number of objects in the heap.

This CL optimizes this for the (to my knowledge) only case there exists,
and instead, while iterationg over all elements (O(n)) keeps a sorted
working list of the top m objects (this is 10 for all intents and purpose
as far as I can see; I've if-cased it to be at most 20). Total runtime
should be O(n log m) where n is the number of objects in the heap and m
is the requested number, which - as said - is at most 20, i.e. a constant,
maying that the runtime is more like O(n).

Instrumenting the code slightly to measure how long it takes:
```
diff --git a/runtime/observatory/lib/src/repositories/top_retaining_instances.dart b/runtime/observatory/lib/src/repositories/top_retaining_instances.dart
index 400ac1427ed..b7e5c429fac 100644
--- a/runtime/observatory/lib/src/repositories/top_retaining_instances.dart
+++ b/runtime/observatory/lib/src/repositories/top_retaining_instances.dart
@@ -7,6 +7,8 @@ part of repositories;
 class TopRetainingInstancesRepository
     implements M.TopRetainingInstancesRepository {
   Future<Iterable<M.RetainingObject>> get(M.IsolateRef i, M.ClassRef c) async {
+    Stopwatch stopwatch = new Stopwatch()..start();
+    try {
       S.Isolate isolate = i as S.Isolate;
       S.Class cls = c as S.Class;
       assert(isolate != null);
@@ -18,5 +20,9 @@ class TopRetainingInstancesRepository
       return (await Future.wait(
               snapshot.getMostRetained(isolate, classId: cls.vmCid, limit: 10)))
           .map((object) => new S.RetainingObject(object));
+    } finally {
+      int ms = stopwatch.elapsedMilliseconds;
+      print("TopRetainingInstancesRepository took $ms ms.");
+    }
   }
 }
```

I ran this program:
```
import "dart:isolate";

List<Object> data = [];

main() {
  RawReceivePort preventClose = new RawReceivePort();
  for(int i = 0; i < 10000000; i++) {
    data.add(new List<int>()..add(i));
  }
  for(int i = 0; i < 100000; i++) {
    data.add(new Foo(i));
  }
}

class Foo {
  final int i;
  Foo(this.i);
}
```

and requested the toplist by retained memory for class `Foo`.
What before took 121778 ms now takes 81026 ms.

(For smaller numbers in the same test it went from ~10 seconds to ~8 seconds).

Change-Id: I6aee4b0c91af8a9ade116b79e56d1e6cbbee5d09
Reviewed-on: https://dart-review.googlesource.com/70502
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-20 07:07:15 +00:00
Jens Johansen 3290f60a31 Fix 'toplist by retained memory' in observatory
Prior to this fix I get errors like

```
TypeError: Instance of 'b2<bQ>': type 'b2<bQ>' is not a subtype of type 'List<bQ>'

StackTrace:

main.dart.js 1631:3    Object.m
main.dart.js 2001:9    Object.p
[...]
```

Change-Id: I2fc6329c05cb76bff76929aeee1eca3954fbc0a9
Reviewed-on: https://dart-review.googlesource.com/70501
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-20 07:03:25 +00:00
Jens Johansen 4deab5bfa1 Observatory: Don't give a stacktrace on Sentinel
E.g. on this:
```
import "dart:developer";

class C {
  foo2() {
    var temp = 1;
    [1, 2, 3].forEach((outer_ea){
      [1, 2, 3].forEach((inner_ea){
         debugger();
         throw "Two!";
      });
    });
  }
}

main() {
  new C().foo2();
}
```

Saying `p this` in the debugger when it stops now says `<optimized out>`
instead of something like
```
Internal error: TypeError: Instance of 'qp': type 'qp' is not a subtype of type 'b6'

TypeError: Instance of 'qp': type 'qp' is not a subtype of type 'b6'
    at Object.m (http://127.0.0.1:54975/main.dart.js:1630:3)
    at Object.os (http://127.0.0.1:54975/main.dart.js:1830:26)
    at Object.b (http://127.0.0.1:54975/main.dart.js:1835:3)
    at http://127.0.0.1:54975/main.dart.js:26687:14
    at a1I.a (http://127.0.0.1:54975/main.dart.js:3202:71)
    at a1I.$2 (http://127.0.0.1:54975/main.dart.js:3547:23)
    at TB.$0 (http://127.0.0.1:54975/main.dart.js:39207:33)
    at Tz.lp (http://127.0.0.1:54975/main.dart.js:39181:9)
    at TC.$2 (http://127.0.0.1:54975/main.dart.js:39205:15)
    at TB.$0 (http://127.0.0.1:54975/main.dart.js:39207:33)
```
Change-Id: I7e001816742ff84dad5859f83b08da86d1043ccf
Reviewed-on: https://dart-review.googlesource.com/68660
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-07 09:41:38 +00:00
Mike Fairhurst eb4b4d3699 Make loadScript() return a future, so it can be awaited in dart 2.
Currently it returns void, which cannot be awaited.

It looks like this code should indeed return a Future, though.

Change-Id: Id093ce2866b89e30a707f9c14751394211b16488
Reviewed-on: https://dart-review.googlesource.com/66404
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-07-24 19:04:26 +00:00
Ryan Macnak a0f517834e [observatory] Progress toward static mode compatibility.
Bug: https://github.com/dart-lang/sdk/issues/32503
Change-Id: Ic4390dce8874aab4aaa87fa4153aef668f28738e
Reviewed-on: https://dart-review.googlesource.com/64982
Reviewed-by: Zach Anderson <zra@google.com>
2018-07-16 17:16:33 +00:00
Ryan Macnak c95f323af2 [observatory] Progress toward static mode compatibility.
Bug: https://github.com/dart-lang/sdk/issues/32503
Change-Id: I4c3358dcc69aa26e3d296275f6ec4da22814c162
Reviewed-on: https://dart-review.googlesource.com/64820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-07-13 22:37:29 +00:00
Devon Carew 188ef5e3d5 Analyze all the pkg/ code on the bots.
Bug: https://github.com/dart-lang/sdk/issues/29318
Change-Id: Iccb16ddbccbb43fa7a12eb818c2dde3a75700b97
Reviewed-on: https://dart-review.googlesource.com/64663
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-07-12 16:35:03 +00:00
Ryan Macnak 32522fe214 [observatory] Progress toward static mode compatibility.
Bug: https://github.com/dart-lang/sdk/issues/32503
Change-Id: I0251eb730e7781491e7d7b50d2c6c5cdf30e6352
Reviewed-on: https://dart-review.googlesource.com/64460
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-07-11 18:14:53 +00:00
Kevin Millikin 29924c4000 In observatory use ArgumentError instead of FallThroughError
Throwing a programmer-constructed FallThroughError is not useful.  It
prints something like:

    'null': Switch case fall-through at line null.

And if you can track that down, it's confusing because it's being used
to signal things that don't have anything to do with falling through
from one switch case to the next one.  Usually, there turns out to be
no matching case in the first place so there's no possible way that
anything fell through to the next case.

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

Change-Id: I68d8aaf22c95163f87a159928f924c25c19f094e
Reviewed-on: https://dart-review.googlesource.com/62522
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-06-28 11:28:33 +00:00
Ryan Macnak 65a3c4443b [observatory] Update packages and remove dead dependencies.
Change-Id: I6dbf547e30a6be9a303d7fc08c9f4c024164334e
Reviewed-on: https://dart-review.googlesource.com/62200
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-25 22:09:54 +00:00
Vyacheslav Egorov 20ca5bbb05 [vm/jit] Introduce dynamic invocation forwarders that perform type checking
This forwarders are used at dynamic call-sites and perform type checking
for all non-generic-covariant arguments. This allows to skip the same
type checks in the actual method body.

This yield on average 10% improvement in performance across the body of
benchmarks including dart2js compilation times.

Bug: https://github.com/dart-lang/sdk/issues/33257
Change-Id: If3fc94a2e0a6f496ec0633f0b379d053a54a40ca
Reviewed-on: https://dart-review.googlesource.com/61244
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-06-25 07:27:04 +00:00
Ryan Macnak b375d69800 [observatory] When the VM is forwarding events to the Android or Fuchsia system tracers, link to the document describing how to use them.
Change-Id: I940b2d5b47a54661c5d25e6d52e714b8819d79a6
Reviewed-on: https://dart-review.googlesource.com/58601
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-05 21:55:56 +00:00
Paul Berry b66dd3d456 Stop using generic comment syntax in observatory.
In most cases the correct fix is to simply drop the generic comment
syntax (e.g. replace "List/*<Map>*/" with "List").  We can't use the
more precise type because the runtime type is actually more general
(e.g. when processing an object that came from the JSON parser, all
lists have runtime type List<dynamic>, even if their elements happen
to be uniform).  But we can introduce more precise types when handling
substructures.

Exception: all JSON-derived maps have type Map<String, dynamic> (since
JSON maps always have string keys), so we can use a more precise type
when dealing with JSON maps.
Change-Id: I48c9dbdda97c11530978212146f74db7b43f5197
Reviewed-on: https://dart-review.googlesource.com/58320
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-06-05 18:29:26 +00:00
Paul Berry 60631b0944 Remove unnecessary casts from observatory.
Change-Id: I2ad59645471b41ce0c8530665b9dc2bcd3e56e7d
Reviewed-on: https://dart-review.googlesource.com/58321
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-06-05 15:55:00 +00:00
Alexander Aprelev a5e41681e5 Add support for expression compilation via service.
If there is registered expression compiler, VM debugger uses it to compile expressions. Otherwise, it will fallback to use kernel service compiler.
This is needed to support Flutter use case where compiler is running on developer's host machine, not on the device where VM is running.

Bug: dartbug.com/31981
Change-Id: I8bdfc8ab45a57c306169abe189f1e24e1b0bcf40
Reviewed-on: https://dart-review.googlesource.com/57520
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-05 04:16:39 +00:00
Paul Berry 648f62a170 Rename Function to ServiceFunction, since creating a class called Function is deprecated.
Change-Id: Ia052b1663252a8786f94577626e631a66d69dff5
Reviewed-on: https://dart-review.googlesource.com/58280
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-04 22:02:29 +00:00
Paul Berry a518d3c6dc Use int.tryParse rather than deprecated onError parameter of int.parse.
Change-Id: I20943a59e367fa6bd328604063b4a736ec300c0e
Reviewed-on: https://dart-review.googlesource.com/58260
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-06-04 17:49:39 +00:00
Paul Berry 6ba8c711fa Observatory strong mode fix: expand the class hierarchy for debug events.
This CL adds base classes for breakpoint events (which support a
`breakpoint` getter) and async suspension events (which support an
`atAsyncSuspension` getter).  Previously these getters were accessed
through dynamic dispatch.

Change-Id: I9bc450a8988483cd0662b1dfe31b4adaf0936ff9
Reviewed-on: https://dart-review.googlesource.com/57380
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-06-01 22:43:29 +00:00