Commit Graph

1103 Commits

Author SHA1 Message Date
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
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
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
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
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
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
John McCutchan 9dd7680fd8 Straw man setExceptionPauseMode
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1399743002 .
2015-10-12 11:04:44 -07:00
Todd Turnidge 435bcdbe6c We can now name the current VM using the service protocol.
Adds a 'VM' stream and a 'VMUpdate' event.

Makes Event.isolate optional in service.md.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1398823002 .
2015-10-08 15:37:49 -07:00
Todd Turnidge 97c643a5f4 Improve isolate list. Expose isolate origin.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1395693003 .
2015-10-07 14:35:01 -07:00
Ryan Macnak 129d7d3cec Ensure the debugger considers parameters to be in scope at the method entry debug step.
Push entry debug step check after parameter capturing and give it the token position of the last parameter.

BUG=http://b/24200673
R=hausner@google.com

Review URL: https://codereview.chromium.org/1393453004 .
2015-10-07 12:33:29 -07:00
Todd Turnidge 3388f2dc98 Fix evaluation in frames with _private variable names.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1391953003 .
2015-10-07 11:09:44 -07:00
Todd Turnidge b3267fe638 Support tab completion of line:col in the debugger.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1393523002 .
2015-10-07 09:44:38 -07:00
Todd Turnidge 0d501ad53d VM restart + shutdown fixes
This change add the ability to restart the vm through the service
protocol.  All isolates are killed, and then the main isolate is
restarted cooperatively by the embedder.

This change also fixes the message handler to prevent it from
accidentally ignoring vm shutdown messages.

Previously, we would stop handling messages whenever we hit an error
(such as a compile error or an unhandled exception).  This would leave
shutdown requests sitting the oob queue, neglected.

We now process *all* oob requests, up to the first shutdown request.
When we hit a shutdown request, we clear the oob queue and process no
more messages.

To make all of this work, we had to change the return value of
HandleMessage from bool to a new enum type, allowing the message
handler to distinguish *normal* error cases from the more rarified
shutdown and restart cases.

R=johnmccutchan@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1371193005 .
2015-10-06 11:27:26 -07:00
John McCutchan fd6135927e Ensure that service protocol specification and implementation use the correct numeric types
Fixes #24245

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1387433002 .
2015-10-01 11:05:13 -07:00
Rico Wind c2ff661740 Mark service/process_service_test as flaky on arm
Updated issue 24344 to reflect that this is flaky

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org//1373853002 .
2015-09-28 17:01:35 +02:00
Ryan Macnak d7b46bf5c1 Don't use a special var descriptor for :async_op since it can now be either stack or context allocated.
BUG=http://dartbug.com/24439
R=regis@google.com

Review URL: https://codereview.chromium.org//1361423004 .
2015-09-25 13:47:41 -07:00
Ryan Macnak d4fa240a25 Address static warning about service library's Isolate hiding dart:isolate's Isolate.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1364903002 .
2015-09-23 14:05:55 -07:00
Todd Turnidge 66f9abc7e3 Refactor isolate interrupts to use OOB messages instead of interrupt bits.
Closes #24349

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1344993002 .
2015-09-23 12:13:25 -07:00
Todd Turnidge b956f981e5 getIsolate rpc now returns collected sentinel for expired isolate.
Closes #24353

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1347693004 .
2015-09-16 10:10:16 -07:00
Rico Wind b6e48e9617 Use cammelCase for all service extension variables
R=johnmccutchan@google.com, johnmmccutchan@google.com
BUG=

Review URL: https://codereview.chromium.org//1343033002 .
2015-09-16 07:27:45 +02:00
John McCutchan fad876aa30 Fix static analysis warnings in Observatory
- Type check SourceLocation and UnresolvedSourceLocation.
- Return null explicitly.
- Remove unused import.

R=turnidge@google.com

Review URL: https://codereview.chromium.org//1340073002 .
2015-09-15 12:57:43 -07:00
Rico Wind f3f358e5f3 Change times reported from io resource meta data to be milliseconds since epoch
Change tests accordingly (and add a few extra tests)

Move the logic to the _IOResource class to only have one datetime and one stopwatch.

R=johnmccutchan@google.com, sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//1341733003 .
2015-09-15 07:42:06 +02:00
Rico Wind 3507b7d3f0 suppress service/process_service_test on arm
Filled issue 24344 to track this

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//1336303003 .
2015-09-14 14:29:49 +02:00
Rico Wind 38b579fa78 Add tracking of open processes to the new io resource tracking.
I plan on refactoring the io_resource_info.dart file a bit in a follow up, but I keept this simple

I also plan on adding some sort of sanity checking when the vm exits, to make sure
all 3 maps are empty (in debug mode)

This fixes issue #24314, before we would hold on to process that failed to start
running in the _processes map.

Closes #24314
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1331033003 .
2015-09-14 12:54:36 +02:00
Todd Turnidge dee6ddf966 Support column-based breakpoints in the VM and Observatory.
BUG=
R=hausner@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org//1312763010 .
2015-09-09 09:01:13 -07:00
Rico Wind c6918fb126 Refactor the io resource classes
Move stopwatch so that we will only ever need one instance

Add utility functions for doing reads and writes

The only functional change here is that I say that an except is a read
of one byte, which also updates the readcount. I think this is just as
correct as what we did before.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1320023008 .
2015-09-09 09:18:07 +02:00
Rico Wind db0d25efd1 Add resource metadata for open files.
Start tracking the read/write information for files in the new
resource management class.

There is currently no time information, I will refactor the timings so that the
static stopwatch from the socket_patch class is moved into the resource class
instead in a follow up (keeping this simply and only about the file addition).

The testing setup may seem a bit strange, but it is the only way I
seem to be able to guarantee that setup actually finishes and that we
get it cleaned up. John may know of a better way

R=sgjesse@google.com, johnmccutchan@google.com
BUG=

Review URL: https://codereview.chromium.org//1326703004 .
2015-09-08 11:27:06 +02:00
Todd Turnidge 8d68f91055 Do not emit coverage/callsite info for implicit closure functions.
They are all forwarding functions now, and this was causing some
oddities in the observatory UI where some functions had coverage info
on their first line and some didn't.  The coverage info always
reflected merely whether or not the closure had been invoked yet,
which was confusing.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1330703002 .
2015-09-04 14:48:34 -07:00
Rico Wind 5a0a8aede9 IO resource tracking. Add test that we correctly remove closed sockets
The other tests simply check that we actually get the open sockets, this will make sure we don't get sockets already closed

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//1317683009 .
2015-09-04 05:55:19 +02:00
Rico Wind 06ab2bdbdd Extract meta data about open sockets into separate class.
The current implementation only has information about tcp and udp
sockets, and we explicitly do not track internal and pipe uses of
_NativeSockets.

The testing of this is done through the service layer, which is the end user of
this.

BUG=
R=sgjesse@google.com

Committed: https://github.com/dart-lang/sdk/commit/01eff8ce18be7eceb6ce0be1097005965edf2588

Review URL: https://codereview.chromium.org//1323943003 .
2015-09-03 19:18:42 +02:00
Rico Wind 665f397bb8 Revert "Extract meta data about open sockets into separate class."
This reverts commit 01eff8ce18.

Seeing issues on windows and on dart2js

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//1323183002 .
2015-09-02 16:18:52 +02:00
Rico Wind 01eff8ce18 Extract meta data about open sockets into separate class.
The current implementation only has information about tcp and udp
sockets, and we explicitly do not track internal and pipe uses of
_NativeSockets.

The testing of this is done through the service layer, which is the end user of
this.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1323943003 .
2015-09-02 15:26:35 +02:00
Todd Turnidge 7ac3150ee3 Improve display of simd vector types and stack traces in Observatory.
Associated protocol changes.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1316123004 .
2015-08-31 10:35:01 -07:00
John McCutchan ea873dceca Stop analyzer from looking at developer_extension_test 2015-08-27 12:03:41 -07:00
John McCutchan 7052bd6bed Rework service extensions to be safe
- When scheduling a service extension to be invoked, store the closure in an array held in the isolate.
- At the tail of IsolateMessageHandler::HandleMessage, invoke all pending service extension closures.

R=iposva@google.com, turnidge@google.com

Review URL: https://codereview.chromium.org//1299493007 .
2015-08-27 11:23:39 -07:00
John McCutchan c9a4013553 More logging for pause tests
BUG=

Review URL: https://codereview.chromium.org//1310863004 .
2015-08-26 16:45:36 -07:00
Todd Turnidge 7f0916d16e Use --trace-service to help diagnose flaky tests.
BUG=

Review URL: https://codereview.chromium.org//1318823002 .
2015-08-26 13:36:56 -07:00
Todd Turnidge fc9d9a495d Adding debugging output to flaky tests to help diagnose problems on the bots.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1320693002 .
2015-08-26 11:33:47 -07:00
Ryan Macnak cc483aaa3d Update manual inspector test.
R=turnidge@google.com

Review URL: https://codereview.chromium.org//1306743004 .
2015-08-26 11:16:56 -07:00
John McCutchan d0882dd363 Remember when an isolate was paused and subtly display it in Obseravatory
- Display paused time as tooltip over "paused" word.
- Send a timestamp with every ServiceEvent.
- Unit tests verifying that paused on start, exit, and breakpoint timestamps are stable.
- Remember the pause time in DebuggerEvent.
- Remember the pause time in MessageHandler.
- Updated service protocol documentation.

R=turnidge@google.com

Review URL: https://codereview.chromium.org//1311503004 .
2015-08-26 10:57:59 -07:00
Todd Turnidge af72ed3afc Fix bug in isolate_lifecycle_test.
Closes #24174

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1305353004 .
2015-08-24 12:55:54 -07:00
John McCutchan a9be61a358 Static analysis fixes and debug prints for wedging test
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1302313003 .
2015-08-21 14:31:33 -07:00
Todd Turnidge 7e8bb130f2 Add an IsolateRunnable event to the service protocol. Improve service docs.
Closes #24140

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1293383011 .
2015-08-21 10:25:38 -07:00
Todd Turnidge 0706f6de29 Fix the error response for bad isolate ids, etc.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1297313005 .
2015-08-20 12:58:28 -07:00