Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Unified Diff: runtime/observatory/lib/src/service/object.dart

Issue 1709383002: Improve behaviour when we hit a stack overflow / OOM error (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/lib/src/elements/isolate_summary.html ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 78b67659cb2d5cb5c10f6de89740e658d846127e..26535ecc7ceb38dff7b05b674715ca713d730973 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -389,6 +389,9 @@ abstract class HeapObject extends ServiceObject {
clazz = map['class'];
}
+ // Load the full class object.
+ clazz?.load();
+
if (mapIsRef) {
return;
}
@@ -2041,6 +2044,10 @@ class Library extends HeapObject {
bool get canCache => true;
bool get immutable => false;
+ bool isDart(String libraryName) {
+ return uri == 'dart:$libraryName';
+ }
+
Library._empty(ServiceObjectOwner owner) : super._empty(owner);
void _update(ObservableMap map, bool mapIsRef) {
@@ -2325,6 +2332,25 @@ class Instance extends HeapObject {
bool get isWeakProperty => kind == 'WeakProperty';
bool get isClosure => kind == 'Closure';
bool get isStackTrace => kind == 'StackTrace';
+ bool get isStackOverflowError {
+ if (clazz == null) {
+ return false;
+ }
+ if (clazz.library == null) {
+ return false;
+ }
+ return (clazz.name == 'StackOverflowError') && clazz.library.isDart('core');
+ }
+
+ bool get isOutOfMemoryError {
+ if (clazz == null) {
+ return false;
+ }
+ if (clazz.library == null) {
+ return false;
+ }
+ return (clazz.name == 'OutOfMemoryError') && clazz.library.isDart('core');
+ }
// TODO(turnidge): Is this properly backwards compatible when new
// instance kinds are added?
« no previous file with comments | « runtime/observatory/lib/src/elements/isolate_summary.html ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698