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

Side by Side Diff: runtime/vm/service.cc

Issue 1394673002: Move reusable handles from isolate to thread. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix release build Created 5 years, 2 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 unified diff | Download patch
OLDNEW
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 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 class GetInstancesVisitor : public ObjectGraph::Visitor { 1834 class GetInstancesVisitor : public ObjectGraph::Visitor {
1835 public: 1835 public:
1836 GetInstancesVisitor(const Class& cls, const Array& storage) 1836 GetInstancesVisitor(const Class& cls, const Array& storage)
1837 : cls_(cls), storage_(storage), count_(0) {} 1837 : cls_(cls), storage_(storage), count_(0) {}
1838 1838
1839 virtual Direction VisitObject(ObjectGraph::StackIterator* it) { 1839 virtual Direction VisitObject(ObjectGraph::StackIterator* it) {
1840 RawObject* raw_obj = it->Get(); 1840 RawObject* raw_obj = it->Get();
1841 if (raw_obj->IsFreeListElement()) { 1841 if (raw_obj->IsFreeListElement()) {
1842 return kProceed; 1842 return kProceed;
1843 } 1843 }
1844 Isolate* isolate = Isolate::Current(); 1844 Thread* thread = Thread::Current();
1845 REUSABLE_OBJECT_HANDLESCOPE(isolate); 1845 REUSABLE_OBJECT_HANDLESCOPE(thread);
1846 Object& obj = isolate->ObjectHandle(); 1846 Object& obj = thread->ObjectHandle();
1847 obj = raw_obj; 1847 obj = raw_obj;
1848 if (obj.GetClassId() == cls_.id()) { 1848 if (obj.GetClassId() == cls_.id()) {
1849 if (!storage_.IsNull() && count_ < storage_.Length()) { 1849 if (!storage_.IsNull() && count_ < storage_.Length()) {
1850 storage_.SetAt(count_, obj); 1850 storage_.SetAt(count_, obj);
1851 } 1851 }
1852 ++count_; 1852 ++count_;
1853 } 1853 }
1854 return kProceed; 1854 return kProceed;
1855 } 1855 }
1856 1856
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
3218 ServiceMethodDescriptor& method = service_methods_[i]; 3218 ServiceMethodDescriptor& method = service_methods_[i];
3219 if (strcmp(method_name, method.name) == 0) { 3219 if (strcmp(method_name, method.name) == 0) {
3220 return &method; 3220 return &method;
3221 } 3221 }
3222 } 3222 }
3223 return NULL; 3223 return NULL;
3224 } 3224 }
3225 3225
3226 3226
3227 } // namespace dart 3227 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/scavenger.cc ('k') | runtime/vm/stack_frame.cc » ('j') | runtime/vm/thread.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698