| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/handles.h" | 5 #include "vm/handles.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 | 115 |
| 116 NoHandleScope::NoHandleScope() : StackResource(Isolate::Current()) { | 116 NoHandleScope::NoHandleScope() : StackResource(Isolate::Current()) { |
| 117 isolate()->IncrementNoHandleScopeDepth(); | 117 isolate()->IncrementNoHandleScopeDepth(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 | 120 |
| 121 NoHandleScope::~NoHandleScope() { | 121 NoHandleScope::~NoHandleScope() { |
| 122 isolate()->DecrementNoHandleScopeDepth(); | 122 isolate()->DecrementNoHandleScopeDepth(); |
| 123 } | 123 } |
| 124 |
| 125 |
| 126 ReusableHandleScope::ReusableHandleScope(BaseIsolate* isolate) |
| 127 : StackResource(isolate) { |
| 128 ASSERT(!isolate->reusable_handle_scope_active()); |
| 129 isolate->set_reusable_handle_scope_active(true); |
| 130 } |
| 131 |
| 132 |
| 133 ReusableHandleScope::ReusableHandleScope() : StackResource(Isolate::Current()) { |
| 134 ASSERT(!isolate()->reusable_handle_scope_active()); |
| 135 isolate()->set_reusable_handle_scope_active(true); |
| 136 } |
| 137 |
| 138 |
| 139 ReusableHandleScope::~ReusableHandleScope() { |
| 140 ASSERT(isolate()->reusable_handle_scope_active()); |
| 141 isolate()->set_reusable_handle_scope_active(false); |
| 142 } |
| 124 #endif // defined(DEBUG) | 143 #endif // defined(DEBUG) |
| 125 | 144 |
| 126 } // namespace dart | 145 } // namespace dart |
| OLD | NEW |