| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 service; | 5 part of service; |
| 6 | 6 |
| 7 // Some value smaller than the object ring, so requesting a large array | 7 // Some value smaller than the object ring, so requesting a large array |
| 8 // doesn't result in an expired ref because the elements lapped it in the | 8 // doesn't result in an expired ref because the elements lapped it in the |
| 9 // object ring. | 9 // object ring. |
| 10 const int kDefaultFieldLimit = 100; | 10 const int kDefaultFieldLimit = 100; |
| (...skipping 3606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3617 var endPos = descriptor['endPos']; | 3617 var endPos = descriptor['endPos']; |
| 3618 var scopeId = descriptor['scopeId']; | 3618 var scopeId = descriptor['scopeId']; |
| 3619 var kind = descriptor['kind'].trim(); | 3619 var kind = descriptor['kind'].trim(); |
| 3620 descriptors.add( | 3620 descriptors.add( |
| 3621 new LocalVarDescriptor(id, name, index, beginPos, endPos, scopeId, | 3621 new LocalVarDescriptor(id, name, index, beginPos, endPos, scopeId, |
| 3622 kind)); | 3622 kind)); |
| 3623 } | 3623 } |
| 3624 } | 3624 } |
| 3625 } | 3625 } |
| 3626 | 3626 |
| 3627 class ObjectPool extends HeapObject implements M.ObjectPoolRef { | 3627 class ObjectPool extends HeapObject implements M.ObjectPool { |
| 3628 bool get immutable => false; | 3628 bool get immutable => false; |
| 3629 | 3629 |
| 3630 @observable int length; | 3630 @observable int length; |
| 3631 @observable List entries; | 3631 @observable List<ObjectPoolEntry> entries; |
| 3632 | 3632 |
| 3633 ObjectPool._empty(ServiceObjectOwner owner) : super._empty(owner); | 3633 ObjectPool._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 3634 | 3634 |
| 3635 void _update(ObservableMap map, bool mapIsRef) { | 3635 void _update(ObservableMap map, bool mapIsRef) { |
| 3636 _upgradeCollection(map, isolate); | 3636 _upgradeCollection(map, isolate); |
| 3637 super._update(map, mapIsRef); | 3637 super._update(map, mapIsRef); |
| 3638 | 3638 |
| 3639 length = map['length']; | 3639 length = map['length']; |
| 3640 if (mapIsRef) { | 3640 if (mapIsRef) { |
| 3641 return; | 3641 return; |
| 3642 } | 3642 } |
| 3643 entries = map['_entries']; | 3643 entries = map['_entries'].map((map) => new ObjectPoolEntry(map)); |
| 3644 } | 3644 } |
| 3645 } | 3645 } |
| 3646 | 3646 |
| 3647 class ObjectPoolEntry implements M.ObjectPoolEntry { |
| 3648 final int offset; |
| 3649 final M.ObjectPoolEntryKind kind; |
| 3650 final M.ObjectRef asObject; |
| 3651 final int asInteger; |
| 3652 |
| 3653 factory ObjectPoolEntry(map) { |
| 3654 M.ObjectPoolEntryKind kind = stringToObjectPoolEntryKind(map['kind']); |
| 3655 int offset = map['offset']; |
| 3656 switch (kind) { |
| 3657 case M.ObjectPoolEntryKind.object: |
| 3658 return new ObjectPoolEntry._fromObject(map['value'], offset); |
| 3659 default: |
| 3660 return new ObjectPoolEntry._fromInteger(kind, map['value'], offset); |
| 3661 } |
| 3662 } |
| 3663 |
| 3664 ObjectPoolEntry._fromObject(this.asObject, this.offset) |
| 3665 : kind = M.ObjectPoolEntryKind.object, |
| 3666 asInteger = null; |
| 3667 |
| 3668 ObjectPoolEntry._fromInteger(this.kind, this.asInteger, this.offset) |
| 3669 : asObject = null; |
| 3670 } |
| 3671 |
| 3672 M.ObjectPoolEntryKind stringToObjectPoolEntryKind(String kind) { |
| 3673 switch (kind) { |
| 3674 case 'Object': |
| 3675 return M.ObjectPoolEntryKind.object; |
| 3676 case 'Immediate': |
| 3677 return M.ObjectPoolEntryKind.immediate; |
| 3678 case 'NativeEntry': |
| 3679 return M.ObjectPoolEntryKind.nativeEntry; |
| 3680 } |
| 3681 throw new Exception('Unknown ObjectPoolEntryKind ($kind)'); |
| 3682 } |
| 3683 |
| 3647 class ICData extends HeapObject implements M.ICData { | 3684 class ICData extends HeapObject implements M.ICData { |
| 3648 @observable HeapObject dartOwner; | 3685 @observable HeapObject dartOwner; |
| 3649 @observable String selector; | 3686 @observable String selector; |
| 3650 @observable Instance argumentsDescriptor; | 3687 @observable Instance argumentsDescriptor; |
| 3651 @observable Instance entries; | 3688 @observable Instance entries; |
| 3652 | 3689 |
| 3653 bool get immutable => false; | 3690 bool get immutable => false; |
| 3654 | 3691 |
| 3655 ICData._empty(ServiceObjectOwner owner) : super._empty(owner); | 3692 ICData._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 3656 | 3693 |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4345 var v = list[i]; | 4382 var v = list[i]; |
| 4346 if ((v is ObservableMap) && _isServiceMap(v)) { | 4383 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 4347 list[i] = owner.getFromMap(v); | 4384 list[i] = owner.getFromMap(v); |
| 4348 } else if (v is ObservableList) { | 4385 } else if (v is ObservableList) { |
| 4349 _upgradeObservableList(v, owner); | 4386 _upgradeObservableList(v, owner); |
| 4350 } else if (v is ObservableMap) { | 4387 } else if (v is ObservableMap) { |
| 4351 _upgradeObservableMap(v, owner); | 4388 _upgradeObservableMap(v, owner); |
| 4352 } | 4389 } |
| 4353 } | 4390 } |
| 4354 } | 4391 } |
| OLD | NEW |