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

Unified Diff: runtime/vm/isolate.h

Issue 22632010: Added following dart API changes to enable more efficient access based (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.h
===================================================================
--- runtime/vm/isolate.h (revision 26045)
+++ runtime/vm/isolate.h (working copy)
@@ -707,84 +707,11 @@
static Dart_IsolateInterruptCallback vmstats_callback_;
friend class ReusableHandleScope;
+ friend class ReusableObjectHandleScope;
DISALLOW_COPY_AND_ASSIGN(Isolate);
};
-// The class ReusableHandleScope is used in regions of the
-// virtual machine where isolate specific reusable handles are used.
-// This class asserts that we do not add code that will result in recursive
-// uses of reusable handles.
-// It is used as follows:
-// {
-// ReusableHandleScope reused_handles(isolate);
-// ....
-// .....
-// code that uses isolate specific reusable handles.
-// Array& funcs = reused_handles.ArrayHandle();
-// ....
-// }
-#if defined(DEBUG)
-class ReusableHandleScope : public StackResource {
- public:
- explicit ReusableHandleScope(Isolate* isolate)
- : StackResource(isolate), isolate_(isolate) {
- ASSERT(!isolate->reusable_handle_scope_active());
- isolate->set_reusable_handle_scope_active(true);
- }
- ReusableHandleScope()
- : StackResource(Isolate::Current()), isolate_(Isolate::Current()) {
- ASSERT(!isolate()->reusable_handle_scope_active());
- isolate()->set_reusable_handle_scope_active(true);
- }
- ~ReusableHandleScope() {
- ASSERT(isolate()->reusable_handle_scope_active());
- isolate()->set_reusable_handle_scope_active(false);
- ResetHandles();
- }
-#define REUSABLE_HANDLE_ACCESSORS(object) \
- object& object##Handle() { \
- ASSERT(isolate_->object##_handle_ != NULL); \
- return *isolate_->object##_handle_; \
- } \
-
- REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_ACCESSORS)
-#undef REUSABLE_HANDLE_ACCESSORS
-
- private:
- void ResetHandles();
- Isolate* isolate_;
- DISALLOW_COPY_AND_ASSIGN(ReusableHandleScope);
-};
-#else
-class ReusableHandleScope : public ValueObject {
- public:
- explicit ReusableHandleScope(Isolate* isolate) : isolate_(isolate) {
- }
- ReusableHandleScope() : isolate_(Isolate::Current()) {
- }
- ~ReusableHandleScope() {
- ResetHandles();
- }
-
-#define REUSABLE_HANDLE_ACCESSORS(object) \
- object& object##Handle() { \
- ASSERT(isolate_->object##_handle_ != NULL); \
- return *isolate_->object##_handle_; \
- } \
-
- REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_ACCESSORS)
-#undef REUSABLE_HANDLE_ACCESSORS
-
- private:
- void ResetHandles();
- Isolate* isolate_;
- DISALLOW_COPY_AND_ASSIGN(ReusableHandleScope);
-};
-#endif // defined(DEBUG)
-
-
-
// When we need to execute code in an isolate, we use the
// StartIsolateScope.
class StartIsolateScope {
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698