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" |
11 #include "vm/os.h" | 11 #include "vm/os.h" |
12 #include "vm/raw_object.h" | 12 #include "vm/raw_object.h" |
13 #include "vm/visitor.h" | 13 #include "vm/visitor.h" |
14 #include "vm/zone.h" | 14 #include "vm/zone.h" |
15 | 15 |
16 #include "vm/handles_impl.h" | 16 #include "vm/handles_impl.h" |
17 | 17 |
18 namespace dart { | 18 namespace dart { |
19 | 19 |
20 DEFINE_FLAG(bool, verify_handles, false, "Verify handles."); | 20 DEFINE_FLAG(bool, verify_handles, false, "Verify handles."); |
21 DEFINE_DEBUG_FLAG(bool, trace_handles, | 21 DEFINE_DEBUG_FLAG(bool, trace_handles, |
22 false, "Traces allocation of handles."); | 22 false, "Traces allocation of handles."); |
23 | 23 |
24 | 24 |
25 VMHandles::~VMHandles() { | 25 VMHandles::~VMHandles() { |
26 #ifdef DEBUG | 26 #ifdef DEBUG |
27 if (FLAG_trace_handles) { | 27 if (FLAG_trace_handles) { |
28 OS::PrintErr("*** Handle Counts for 0x(%"Px"):Zone = %d,Scoped = %d\n", | 28 OS::PrintErr("*** Handle Counts for 0x(%" Px |
| 29 "):Zone = %d,Scoped = %d\n", |
29 reinterpret_cast<intptr_t>(this), | 30 reinterpret_cast<intptr_t>(this), |
30 CountZoneHandles(), CountScopedHandles()); | 31 CountZoneHandles(), CountScopedHandles()); |
31 OS::PrintErr("*** Deleting VM handle block 0x%"Px"\n", | 32 OS::PrintErr("*** Deleting VM handle block 0x%" Px "\n", |
32 reinterpret_cast<intptr_t>(this)); | 33 reinterpret_cast<intptr_t>(this)); |
33 } | 34 } |
34 #endif | 35 #endif |
35 } | 36 } |
36 | 37 |
37 | 38 |
38 void VMHandles::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 39 void VMHandles::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
39 return Handles<kVMHandleSizeInWords, | 40 return Handles<kVMHandleSizeInWords, |
40 kVMHandlesPerChunk, | 41 kVMHandlesPerChunk, |
41 kOffsetOfRawPtr>::VisitObjectPointers(visitor); | 42 kOffsetOfRawPtr>::VisitObjectPointers(visitor); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 isolate()->IncrementNoHandleScopeDepth(); | 118 isolate()->IncrementNoHandleScopeDepth(); |
118 } | 119 } |
119 | 120 |
120 | 121 |
121 NoHandleScope::~NoHandleScope() { | 122 NoHandleScope::~NoHandleScope() { |
122 isolate()->DecrementNoHandleScopeDepth(); | 123 isolate()->DecrementNoHandleScopeDepth(); |
123 } | 124 } |
124 #endif // defined(DEBUG) | 125 #endif // defined(DEBUG) |
125 | 126 |
126 } // namespace dart | 127 } // namespace dart |
OLD | NEW |