| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of observatory; | 5 part of observatory; |
| 6 | 6 |
| 7 /// State for a running isolate. | 7 /// State for a running isolate. |
| 8 class Isolate extends Observable { | 8 class Isolate extends Observable { |
| 9 @observable dprof.Isolate profiler; | 9 @observable Profile profile; |
| 10 @observable final List<Code> codes = new List<Code>(); |
| 10 @observable String id; | 11 @observable String id; |
| 11 @observable String name; | 12 @observable String name; |
| 12 @observable final Map<String, ScriptSource> scripts = | 13 @observable final Map<String, ScriptSource> scripts = |
| 13 toObservable(new Map<String, ScriptSource>()); | 14 toObservable(new Map<String, ScriptSource>()); |
| 14 | 15 |
| 15 Isolate(this.id, this.name); | 16 Isolate(this.id, this.name); |
| 16 | 17 |
| 17 String toString() => '$id $name'; | 18 String toString() => '$id $name'; |
| 18 } | 19 |
| 20 Code findCodeByAddress(int address) { |
| 21 for (var i = 0; i < codes.length; i++) { |
| 22 if (codes[i].contains(address)) { |
| 23 return codes[i]; |
| 24 } |
| 25 } |
| 26 } |
| 27 |
| 28 Code findCodeByName(String name) { |
| 29 for (var i = 0; i < codes.length; i++) { |
| 30 if (codes[i].name == name) { |
| 31 return codes[i]; |
| 32 } |
| 33 } |
| 34 } |
| 35 |
| 36 void resetCodeTicks() { |
| 37 Logger.root.info('Reset all code ticks.'); |
| 38 for (var i = 0; i < codes.length; i++) { |
| 39 codes[i].resetTicks(); |
| 40 } |
| 41 } |
| 42 } |
| OLD | NEW |