| 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 3591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3602 var endPos = descriptor['endPos']; | 3602 var endPos = descriptor['endPos']; |
| 3603 var scopeId = descriptor['scopeId']; | 3603 var scopeId = descriptor['scopeId']; |
| 3604 var kind = descriptor['kind'].trim(); | 3604 var kind = descriptor['kind'].trim(); |
| 3605 descriptors.add( | 3605 descriptors.add( |
| 3606 new LocalVarDescriptor(id, name, index, beginPos, endPos, scopeId, | 3606 new LocalVarDescriptor(id, name, index, beginPos, endPos, scopeId, |
| 3607 kind)); | 3607 kind)); |
| 3608 } | 3608 } |
| 3609 } | 3609 } |
| 3610 } | 3610 } |
| 3611 | 3611 |
| 3612 class ObjectPool extends HeapObject implements M.ObjectPoolRef { | 3612 class ObjectPool extends HeapObject implements M.ObjectPool { |
| 3613 bool get immutable => false; | 3613 bool get immutable => false; |
| 3614 | 3614 |
| 3615 @observable int length; | 3615 @observable int length; |
| 3616 @observable List entries; | 3616 @observable List<ObjectPoolEntry> entries; |
| 3617 | 3617 |
| 3618 ObjectPool._empty(ServiceObjectOwner owner) : super._empty(owner); | 3618 ObjectPool._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 3619 | 3619 |
| 3620 void _update(ObservableMap map, bool mapIsRef) { | 3620 void _update(ObservableMap map, bool mapIsRef) { |
| 3621 _upgradeCollection(map, isolate); | 3621 _upgradeCollection(map, isolate); |
| 3622 super._update(map, mapIsRef); | 3622 super._update(map, mapIsRef); |
| 3623 | 3623 |
| 3624 length = map['length']; | 3624 length = map['length']; |
| 3625 if (mapIsRef) { | 3625 if (mapIsRef) { |
| 3626 return; | 3626 return; |
| 3627 } | 3627 } |
| 3628 entries = map['_entries']; | 3628 entries = map['_entries'].map((map) => new ObjectPoolEntry(map)); |
| 3629 } | 3629 } |
| 3630 } | 3630 } |
| 3631 | 3631 |
| 3632 class ObjectPoolEntry implements M.ObjectPoolEntry { |
| 3633 final int offset; |
| 3634 final M.ObjectPoolEntryKind kind; |
| 3635 final M.ObjectRef asObject; |
| 3636 final int asInteger; |
| 3637 |
| 3638 factory ObjectPoolEntry(map) { |
| 3639 M.ObjectPoolEntryKind kind = stringToObjectPoolEntryKind(map['kind']); |
| 3640 int offset = map['offset']; |
| 3641 switch (kind) { |
| 3642 case M.ObjectPoolEntryKind.object: |
| 3643 return new ObjectPoolEntry._fromObject(map['value'], offset); |
| 3644 default: |
| 3645 return new ObjectPoolEntry._fromInteger(kind, map['value'], offset); |
| 3646 } |
| 3647 } |
| 3648 |
| 3649 ObjectPoolEntry._fromObject(this.asObject, this.offset) |
| 3650 : kind = M.ObjectPoolEntryKind.object, |
| 3651 asInteger = null; |
| 3652 |
| 3653 ObjectPoolEntry._fromInteger(this.kind, this.asInteger, this.offset) |
| 3654 : asObject = null; |
| 3655 } |
| 3656 |
| 3657 M.ObjectPoolEntryKind stringToObjectPoolEntryKind(String kind) { |
| 3658 switch (kind) { |
| 3659 case 'Object': |
| 3660 return M.ObjectPoolEntryKind.object; |
| 3661 case 'Immediate': |
| 3662 return M.ObjectPoolEntryKind.immediate; |
| 3663 case 'NativeEntry': |
| 3664 return M.ObjectPoolEntryKind.nativeEntry; |
| 3665 } |
| 3666 throw new Exception('Unknown ObjectPoolEntryKind ($kind)'); |
| 3667 } |
| 3668 |
| 3632 class ICData extends HeapObject implements M.ICData { | 3669 class ICData extends HeapObject implements M.ICData { |
| 3633 @observable HeapObject dartOwner; | 3670 @observable HeapObject dartOwner; |
| 3634 @observable String selector; | 3671 @observable String selector; |
| 3635 @observable Instance argumentsDescriptor; | 3672 @observable Instance argumentsDescriptor; |
| 3636 @observable Instance entries; | 3673 @observable Instance entries; |
| 3637 | 3674 |
| 3638 bool get immutable => false; | 3675 bool get immutable => false; |
| 3639 | 3676 |
| 3640 ICData._empty(ServiceObjectOwner owner) : super._empty(owner); | 3677 ICData._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 3641 | 3678 |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4330 var v = list[i]; | 4367 var v = list[i]; |
| 4331 if ((v is ObservableMap) && _isServiceMap(v)) { | 4368 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 4332 list[i] = owner.getFromMap(v); | 4369 list[i] = owner.getFromMap(v); |
| 4333 } else if (v is ObservableList) { | 4370 } else if (v is ObservableList) { |
| 4334 _upgradeObservableList(v, owner); | 4371 _upgradeObservableList(v, owner); |
| 4335 } else if (v is ObservableMap) { | 4372 } else if (v is ObservableMap) { |
| 4336 _upgradeObservableMap(v, owner); | 4373 _upgradeObservableMap(v, owner); |
| 4337 } | 4374 } |
| 4338 } | 4375 } |
| 4339 } | 4376 } |
| OLD | NEW |