| 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 #include "vm/service.h" | 5 #include "vm/service.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 | 10 |
| (...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 class GetInstancesVisitor : public ObjectGraph::Visitor { | 1852 class GetInstancesVisitor : public ObjectGraph::Visitor { |
| 1853 public: | 1853 public: |
| 1854 GetInstancesVisitor(const Class& cls, const Array& storage) | 1854 GetInstancesVisitor(const Class& cls, const Array& storage) |
| 1855 : cls_(cls), storage_(storage), count_(0) {} | 1855 : cls_(cls), storage_(storage), count_(0) {} |
| 1856 | 1856 |
| 1857 virtual Direction VisitObject(ObjectGraph::StackIterator* it) { | 1857 virtual Direction VisitObject(ObjectGraph::StackIterator* it) { |
| 1858 RawObject* raw_obj = it->Get(); | 1858 RawObject* raw_obj = it->Get(); |
| 1859 if (raw_obj->IsFreeListElement()) { | 1859 if (raw_obj->IsFreeListElement()) { |
| 1860 return kProceed; | 1860 return kProceed; |
| 1861 } | 1861 } |
| 1862 Isolate* isolate = Isolate::Current(); | 1862 Thread* thread = Thread::Current(); |
| 1863 REUSABLE_OBJECT_HANDLESCOPE(isolate); | 1863 REUSABLE_OBJECT_HANDLESCOPE(thread); |
| 1864 Object& obj = isolate->ObjectHandle(); | 1864 Object& obj = thread->ObjectHandle(); |
| 1865 obj = raw_obj; | 1865 obj = raw_obj; |
| 1866 if (obj.GetClassId() == cls_.id()) { | 1866 if (obj.GetClassId() == cls_.id()) { |
| 1867 if (!storage_.IsNull() && count_ < storage_.Length()) { | 1867 if (!storage_.IsNull() && count_ < storage_.Length()) { |
| 1868 storage_.SetAt(count_, obj); | 1868 storage_.SetAt(count_, obj); |
| 1869 } | 1869 } |
| 1870 ++count_; | 1870 ++count_; |
| 1871 } | 1871 } |
| 1872 return kProceed; | 1872 return kProceed; |
| 1873 } | 1873 } |
| 1874 | 1874 |
| (...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3280 ServiceMethodDescriptor& method = service_methods_[i]; | 3280 ServiceMethodDescriptor& method = service_methods_[i]; |
| 3281 if (strcmp(method_name, method.name) == 0) { | 3281 if (strcmp(method_name, method.name) == 0) { |
| 3282 return &method; | 3282 return &method; |
| 3283 } | 3283 } |
| 3284 } | 3284 } |
| 3285 return NULL; | 3285 return NULL; |
| 3286 } | 3286 } |
| 3287 | 3287 |
| 3288 | 3288 |
| 3289 } // namespace dart | 3289 } // namespace dart |
| OLD | NEW |