Commit Graph

1605 Commits

Author SHA1 Message Date
John McCutchan ec020a301b Improve Observatory debugger behaviour when an isolate exits with unhandled exceptions
- When an isolate is paused at exit and has a sticky error, have the debugger display the error.
- Add --pause-isolates-on-unhandled-exceptions flag which sets a default value for break-on-exception.
- Have the debugger display help text about 'set break-on-exception' and '--pause-isolates-on-unhandled-exceptions'
- Signal an unhandled exception even if no client is connected to Observatory.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1636083002 .
2016-01-26 10:12:46 -08:00
John McCutchan 146efcfde0 Mark coverage_test as Pass Slow and enable tracing
BUG=

Review URL: https://codereview.chromium.org/1630993002 .
2016-01-25 13:02:56 -08:00
Regis Crelier 7f57ebcfa1 Remove signature classes from the VM.
They were used as the class of closure instances and as the type class of
function types.
All closure instances now have class _Closure and function types are represented
by a new class FunctionType extending AbstractType.
Fix issue 24567 and add regression test.

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

Review URL: https://codereview.chromium.org/1584223006 .
2016-01-19 16:32:59 -08:00
John McCutchan 77101d63e3 Source positions for constructors and lots of async machinery
- Rework token position address space.
- Use ClassifyingTokenPositions::kMethodExtractor for the token position of a method extractor.
- Plumb token positions through all of Ast Transformer.
- Plumb token positions for temporary expressions, etc in Flow Graph Builder.
- Add token positions for parts of the await machinery.
- Move ClassifyingTokenPositions into token.h.
- Remove default token position of Scanner::kNoSourcePos for many IR instructions.
- A couple of unit tests.
- Use synthetic token positions for synthetic AstNodes.
- Fix SLEB128 encoding / decoding + test
- s/Scanner::kNoSourcePos/Token::kNoSourcePos.
- Remove >= 0 and < 0 checks against token positions and use helpers instead.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1589643002 .
2016-01-19 15:01:08 -08:00
Todd Turnidge 1fdde601da Properly display un-compiled nested functions.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1596563003 .
2016-01-15 15:13:09 -08:00
Todd Turnidge 3bf009d8d3 Make local variables sticky-scroll in debugger frames.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1594603003 .
2016-01-15 15:09:08 -08:00
Todd Turnidge 318db33875 Only show breakpoints at possible breakpoint positions in Observatory.
We now use getSourceReport to get an accurate list of possible
breakpoints rather than relying on inaccurate heuristics.  This means,
for example, that variable declarations will stop being labeled
incorrectly as potential breakpoints.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1590353002 .
2016-01-15 14:56:35 -08:00
Todd Turnidge f23610b3e3 Use getSourceReport for coverage/callsites in Observatory.
Move script reloading into the script inset instead of the navbar.

Make the refresh icon do a sticky-header scroll thing (fancy!).

Remove old coverage code from observatory.

BUG=

Review URL: https://codereview.chromium.org/1584173003 .
2016-01-15 09:18:57 -08:00
Todd Turnidge 539ac23fb4 Add PossibleBreakpoints source reporting.
This allows tools developers to discover which token positions
correspond to possible breakpoints in the code.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1586253002 .
2016-01-15 09:02:38 -08:00
Todd Turnidge 97a7db5a71 typo: association -> associations
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1578703003 .
2016-01-12 10:31:47 -08:00
Rico Wind 55c7aa561b Print the data we get back from the tcp socket meta data service
We are seeing flakes on win64 with this test

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org/1565403003 .
2016-01-08 11:46:33 +01:00
Todd Turnidge a283265955 Add the forceCompile param to _getSourceReport.
Deal with some empty ranges that were being emitted.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1562993003 .
2016-01-07 11:33:33 -08:00
Todd Turnidge 61d9752c7e Expose the new _getSourceReport api in the service protocol.
Allow multiple reports to be requested simultaneously.

I'm not exposing this publicly yet -- still nailing down the format a bit.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1566793002 .
2016-01-06 13:01:33 -08:00
John McCutchan cb8b641cc9 Make Scanner::kNoSourcePos be a true sentinel value
- It is possible to write a Dart program with a function token_pos of 0.
- Switch Scanner::kNoSourcePos from 0 to -1.

R=hausner@google.com

Review URL: https://codereview.chromium.org/1564493002 .
2016-01-06 09:06:28 -08:00
John McCutchan bedd2cbf25 Support narrowing a timeline to a given time window
- Assign correct timestamps for timeline events from Dart code.
- Support optional 'timeOriginMicros' and 'timeExtentMicros' to _getVMTimeline service RPC.
- Relax time extent check in profiler.

R=asiva@google.com

Review URL: https://codereview.chromium.org/1533323004 .
2015-12-22 09:18:45 -08:00
Ryan Macnak 6b964b83ac Add ./tools/test.py -c precompiler -r dart_precompiled.
- Make --gen/run-precompiled-snapshot take a directory to use for the snapshot pieces.
 - Throw on Platform.executeable to prevent tests from becoming fork-bombs.
 - Update status files so 'dart_precompiled' is generally expected to behave the same as 'vm'.

Currently multitests will fail unless run with --jobs=1 because the test harness assigns them the same temporary directory.

Running this also requires a great deal of space. My out directory is 380G.

BUG=http://dartbug.com/24975
R=fschneider@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org/1507943002 .
2015-12-18 12:08:10 -08:00
John McCutchan 89c49b9e87 Add dart:developer.postEvent for posting events to the service protocol from Dart code
- Add dart:developer.postEvent for posting events to the service protocol.
- Add 'Extension' service protocol event stream.
- Unit test.
- Update service.md

- Bug fix for logging stream.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1537523002 .
2015-12-17 09:34:52 -08:00
William Hesse 6485590527 Remove old java-based analyzer from test scripts and status files
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1537653002 .
2015-12-17 14:44:57 +01:00
Ryan Macnak 0980c1af96 Further fix get_cpu_profile_timeline_rpc_test.
Review URL: https://codereview.chromium.org/1529093005 .
2015-12-16 14:59:33 -08:00
John McCutchan f3ee772308 Provide list of service protocol extensions in isolate and emit an event when one is registered.
- Doc improvements.
- Type annotation improvements.
- Isolate includes list of currently registered extensions.
- New event kind on isolate stream emitted whenever an extension is registered (IsolateServiceExtensionRegistered).

Fixes https://dartbug.com/25208
Fixes https://dartbug.com/25257

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1527793004 .
2015-12-16 13:49:37 -08:00
Ryan Macnak 55a22037fb Fix get_cpu_profile_timeline_rpc_test.
AddProperty64 encodes as a JSON integer, not a JSON string.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1535513002 .
2015-12-16 13:42:06 -08:00
John McCutchan 2db0ad84d0 Test that we can load Observatory frontend resources
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1529153003 .
2015-12-16 13:03:01 -08:00
Ryan Macnak a0e0ac78cb Observatory: Include profiler samples in the timeline view.
- Add pre-isolate service RPC that emits profiler samples in about:tracing format.
 - Make timeline UI automatically merge the event timeline with the sample timelines.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1525913002 .
2015-12-16 10:11:44 -08:00
John McCutchan fb33d9deff Fix get_vm_timeline_rpc_test
BUG=

Review URL: https://codereview.chromium.org/1530703002 .
2015-12-15 11:17:45 -08:00
Todd Turnidge 3a28a1297e Fix line number reporting for unresolved breakpoints.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1524263002 .
2015-12-15 10:08:30 -08:00
Todd Turnidge 08ce763e26 Update observatory_pub_packages_rev.
I want to pick up the new version of charted to drop some build warnings.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1519183003 .
2015-12-14 10:36:40 -08:00
Zachary Anderson a0970835f0 Adds a special case for sending an int over a port with the native API.
This improves dart <=> C++ IPC round-trip-times for Mojo by 10-20%.

BUG=

Review URL: https://codereview.chromium.org/1499853004 .
2015-12-11 16:07:16 -08:00
Ivan Posva 6d0453594a - Prevent running of the dart_bootstrap script by default.
- Fix argument handling in Python: argparse does not properly handle booleans.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1519063004 .
2015-12-11 13:23:12 -08:00
Matthias Hausner e3457758ed Remove Field::FindFieldIndex() and update service protocol
This paves the way to remove functions and fields from top-level
classes. They are looked up via the class dictionary when resolving
names.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1477573002 .
2015-11-24 15:42:03 -08:00
Ryan Macnak c44419805c - Display a pseudo-receiver for static function activations.
- Add missing breadcrumbs to class heirarchy, flags and timetime view.
 - Truncate large objects by default so we can look at them without falling over.
 - Demangle local variable names.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1463123002 .
2015-11-24 12:39:43 -08:00
Ryan Macnak 75cd019a9c Add RPC and UI for reachable size of an object / all instances of a class.
BUG=http://dartbug.com/24945
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1453983002 .
2015-11-20 10:02:16 -08:00
Matthias Hausner 648e52baa8 Collect closure functions in isolate
Instead of collecting closures functions in each class object, maintain one list per isolate. This is a step towards getting rid of top-level classes.

I'd appreciate if John could take a look at the service isolate and coverage related change.

I'd appreciate if Ryan could take a look at the precompilation related change.

When compiling all of corelib, the list of closures in the isolate is about 600 entries long. If this linear list should become a bottleneck, I'll deal with it later. (Sadly, some code relies on the fact that a closure can be identified with a list index, so making it a hash table instead of an array does not work.)

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1436243005 .
2015-11-17 15:40:27 -08:00
Todd Turnidge b9af3683fd Don't unsubscribe to streams we aren't subscribed to.
Gets rid of some stray uncaught exceptions when running Flutter.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1456643002 .
2015-11-17 11:29:39 -08:00
Ryan Macnak 5eb3bccaf1 Switch dominator algorithm from [1] to [2].
[1] has worse upper bound complexity than [2] but has lower
overhead. With [1] dart2js heaps would converge in ~10 iterations, but
with analyzer heaps would take ~10k iterations.

This reduces the time to analyze the final heap of the analyzer
analyzing dart2js from ~30 minutes to 26 seconds.

Increases peak memory usage by 21N bytes plus O(2N) words.

[1] "A Simple, Fast Dominance Algorithm." Keith D. Cooper, Timothy
J. Harvey, and Ken Kennedy.
[2] "A Fast Algorithm for Finding Dominators in a Flowgraph."
T. Lengauer and R. E. Tarjan.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1449243002 .
2015-11-17 11:20:38 -08:00
Ryan Macnak f1391c7841 Observatory: handle the case where package:foo imports are canonicalized as packages/foo.
BUG=http://dartbug.com/24925
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1447383002 .
2015-11-16 17:55:39 -08:00
Florian Loitsch 31c73aef7c Fix ambigous typos.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1443723004 .
2015-11-16 22:06:44 +01:00
Ryan Macnak 816e665ae1 Use the new Base64 support from dart:convert in Observatory.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1374113006 .
2015-11-13 15:36:27 -08:00
John McCutchan 5725b0a0a0 Fast path Dart Timeline events with no arguments to avoid calling JSON.encode
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1441683005 .
2015-11-13 07:47:22 -08:00
Ryan Macnak df64bb1619 - Annotate instructions that load objects from the ObjectPool or Thread.
- Remove disassembly tooltips.
- Surface whether a function has an intrinsic or is recognized.
- Mark intrinsified or ffi functions in the profile.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1439893002 .
2015-11-12 15:18:31 -08:00
John McCutchan c6a8c44eae Include field reference with implicit getter / setter functions
- When printing implicit getter or setter functions, include the field that the implicit functions were generated for.
- Display field on function view in Observatory.
- Service unit test.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1440753002 .
2015-11-11 14:13:45 -08:00
John McCutchan 291befa1cd Redo TimelineTask API
A TimelineTask represents an asynchronous track of operations on the timeline.

The old API allowed multiple isolates to emit events simultaneously on the same task or to start / finish events in any order. This isn't supported by our UI and probably many other tools that consume trace-event.

With this change, operations within a TimelineTask must complete in the reverse order of their start calls (aka a stack). You can pass a TimelineTask from one isolate to another but you must first complete all open operations before passing it.

Example:

var task = new TimelineTask();

task.start('Some phase');
await someFuture;
task.finish();

Also: Add support for instant events.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1412183008 .
2015-11-11 10:59:38 -08:00
John McCutchan 43b0ae00e7 Timeline service protocol support with Observatory UI
Service Protocol:
- _clearVMTimeline (clear timeline)
- _getVMTimeline (fetch timeline)
- _setVMTimelineFlag (control recording)
- _getVMTimelineFlag (...)
- _getVMTimeline service unit test

Observatory:
- timeline page with record on/off, clear timeline, and refresh buttons.
- trace-viewer based timeline view that runs in an iframe driven by a small javascript program

Misc:
- Fix default enable logic bugs
- Add 'Debugger Pause' timeline event
- Threads can have a name and that name will be displayed in Observatory
- Tighten up locking when printing JSON

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1406413006 .
2015-11-10 08:02:22 -08:00
John McCutchan b9399cd964 Allow for FakeVMRpcExceptions when listening for streams
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1406343004 .
2015-10-27 07:44:10 -07:00
John McCutchan 30e77221bc Some cleanups to observatory BUILD.gn
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1416293003 .
2015-10-27 07:42:27 -07:00
John McCutchan 1b9f7bca1c Add Observatory BUILD.gn rules
BUG=

Review URL: https://codereview.chromium.org/1419943003 .
2015-10-26 14:18:50 -07:00
Ryan Macnak 371a5dc932 Get tools/test.py --noopt green.
More specifically ./tools/test.py --noopt -mall -ax64,simarm,simarm64,simmips --exclude-suite=pkg

 - Add missing dart:io entry point.
 - Add checks that Dart_FinalizeLoading, Dart_Precompile, Dart_CreatePrecompiledSnapshot are called in order.
 - Add checks for --precompilation flag.
 - Add checks for dropped class in Dart_New/Allocate/AllocateWithNativeFields.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1407393005 .
2015-10-21 10:35:01 -07:00
Ryan Macnak 9de6b3be0a Move selector and arguments descriptor into MegamorphicCache.
Towards making call sites swappable between ICs and MegamorphicCaches.

R=srdjan@google.com

Review URL: https://codereview.chromium.org/1420433004 .
2015-10-20 13:44:21 -07:00
Todd Turnidge f5a07f6a9c Pad line number appropriately when generating script insets.
This avoid jagged indentation when we jump from 9->10, 99->100, etc.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1402193003 .
2015-10-14 13:28:33 -07:00
Todd Turnidge cc672473b9 Use offset and count to request slices of lists, maps, and typed_data.
This should allow debugging clients to support pagination of these
potentially large types.

Closes #24536

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1400393002 .
2015-10-14 11:05:21 -07:00
Ryan Macnak 8df96f0f48 -Fix display of megamorphic miss function.
-Fix inbound reference of megamorphic miss function.
-Speculative fix for eval Script.
-Rationalize isolate list as isolate list.
-Fix attempted eval in precompiled isolate.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1403883002 .
2015-10-13 10:26:44 -07:00