Previously, some of the tasks got the type provider from the context,
which meant we were at risk of invoking the task manager reentrantly
(which might have broken some task manager assumptions and potentially
degraded responsiveness). With this CL, all tasks that need the type
provider get it using an explicit input.
Assertions are added so that if we accidentally introduce future code
paths that invoke the task manager in a reentrant fashion, we will see
the problem during unit tests.
R=brianwilkerson@google.com, scheglov@google.com
Review URL: https://codereview.chromium.org//1124003007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45794 260f80e4-7a28-3924-810f-c04153c831b5
In JSON RPC, error results and regular results are distinguished structurally. We now do this in the service protocol instead of returning a regular result with the "Error" type.
VM:
- Add PrintError method to JSONStream. Use this to generate all errors in the service protocol.
- Fix some bugs with "limit" parameter handling.
- Change return value for heap rpcs when they find a collected/expired reference.
- Update tests.
Observatory:
- Add app.handleExceptions -- this is a widely-used exception handler that puts up a notification when there is an uncaught/unexpected exception. Added a top-level zone catch that uses this handler, as well as explicit uses of this handler at various points in the code. Most pages use this implicitly or explictly, except for the debugger page, which displays exceptions in the console.
[ General rule, when a function returns a Future, generally let the error pass through. If a function does async work but doesn't return the Future, then it should handle errors explicitly by calling app.handleExceptions, etc. ]
- Fixed notifications. They were generally broken. Some hard-coded type names needed to be fixed, some hacks needed to be removed.
- Add a new class RpcException and a variety of subclasses which capture the error cases when making an rpc.
- Redo refresh buttons so their callbacks return Futures instead of taking a "done" closure. Cleaner. Allows us to move error handling outside of the callback.
- Drop ServiceError, ServiceException and the associated views.
- Redo notifications so that event and exception notifications are supported.
- No longer null out the vm when it is disconnected.
- Remove notifications when we visit the vm-connect page. Only show the "Proceeding will lose current page" dialog when we aren't on the vm-connect page already.
- Improve error message on cpu profile page when profiling is disabled on the VM.
- Allow variables to wrap on debugger page.
- Make eval-box and eval-link tolerant of errors during rpc. Make the errors display nicely.
- When a breakpoint is marked "not possible", make sure it disappears. This got broken during script view refactor.
- Drop vm's errors and exceptions streams. No longer needed.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//1120133002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45792 260f80e4-7a28-3924-810f-c04153c831b5
- Add ServiceIdZone interface for getting temporary ids.
- Add RingServiceIdZone which uses the isolate's object id ring.
- Add GrowableServiceIdZone which uses a growable array.
- Unit tests for ServiceIdZones.
- JSONStream has a service id zone.
- Default service id zone is ring with eager id allocation.
- All service RPCs can include a _serviceIdZone parameter.
- Value of _serviceIdZone can be Ring.NewId or Ring.ExistingId.
- All ObjectIdRing usage in object.cc has been replaced with `jsobj.AddServiceId("id", *this);`
- Add a policy for id reuse to ObjectIdRing::GetIdForObject
- ObjectIdRing can dump its contents to JSON.
- Add _dumpRingRequests RPC which dumps the isolate's ring.
- _getCrashDump includes complete object id ring.
R=turnidge@google.com
Review URL: https://codereview.chromium.org//1132323002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45754 260f80e4-7a28-3924-810f-c04153c831b5
Closures that appear in error messages, especially NoSuchMethodError, need to identify the function so that captured error messages and stack traces are useful.
Old:
1. Instance of 'Object'
2. Instance of 'Object'
3. Instance of 'anonymous'
4. Instance of 'anonymous'
5. Instance of 'main_localFunction'
New:
1. Closure 'print'
2. Closure 'Widget_staticMethod'
3. Closure 'foo' of Instance of 'Widget'
4. Closure 'remainder' of 1234
5. Closure 'main_localFunction'
In minified code the names are (usually) minified. Being able to unminify them later is separate issue.
This CL makes NoSuchMethodError variants more uniform in quoting of method to assist unminifying the message.
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1138313002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45753 260f80e4-7a28-3924-810f-c04153c831b5
Dart2js used to just emit static non-final fields, even if they were not referenced.
This is bad, because in some cases it referenced a constant that didn't exist (was tree-shaken away). In the old emitter this just became a reference to a non-existing property, but in the new emitter it crashed.
This CL also fixes (partially) static non-final fields for the lazy emitter.
R=sra@google.com
Review URL: https://codereview.chromium.org//1132363003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45752 260f80e4-7a28-3924-810f-c04153c831b5