| Index: runtime/vm/handles.cc
|
| diff --git a/runtime/vm/handles.cc b/runtime/vm/handles.cc
|
| index f3818d7cc69d0c536814e9b294a403b2eec60169..866260a42063cfa62431ff137bc82464f7fce113 100644
|
| --- a/runtime/vm/handles.cc
|
| +++ b/runtime/vm/handles.cc
|
| @@ -19,7 +19,6 @@ namespace dart {
|
|
|
| DEFINE_FLAG(bool, verify_handles, false, "Verify handles.");
|
|
|
| -
|
| VMHandles::~VMHandles() {
|
| if (FLAG_trace_handles) {
|
| OS::PrintErr("*** Handle Counts for 0x(%" Px "):Zone = %d,Scoped = %d\n",
|
| @@ -30,13 +29,11 @@ VMHandles::~VMHandles() {
|
| }
|
| }
|
|
|
| -
|
| void VMHandles::VisitObjectPointers(ObjectPointerVisitor* visitor) {
|
| return Handles<kVMHandleSizeInWords, kVMHandlesPerChunk,
|
| kOffsetOfRawPtr>::VisitObjectPointers(visitor);
|
| }
|
|
|
| -
|
| #if defined(DEBUG)
|
| static bool IsCurrentApiNativeScope(Zone* zone) {
|
| ApiNativeScope* scope = ApiNativeScope::Current();
|
| @@ -44,27 +41,23 @@ static bool IsCurrentApiNativeScope(Zone* zone) {
|
| }
|
| #endif // DEBUG
|
|
|
| -
|
| uword VMHandles::AllocateHandle(Zone* zone) {
|
| DEBUG_ASSERT(!IsCurrentApiNativeScope(zone));
|
| return Handles<kVMHandleSizeInWords, kVMHandlesPerChunk,
|
| kOffsetOfRawPtr>::AllocateHandle(zone);
|
| }
|
|
|
| -
|
| uword VMHandles::AllocateZoneHandle(Zone* zone) {
|
| DEBUG_ASSERT(!IsCurrentApiNativeScope(zone));
|
| return Handles<kVMHandleSizeInWords, kVMHandlesPerChunk,
|
| kOffsetOfRawPtr>::AllocateZoneHandle(zone);
|
| }
|
|
|
| -
|
| bool VMHandles::IsZoneHandle(uword handle) {
|
| return Handles<kVMHandleSizeInWords, kVMHandlesPerChunk,
|
| kOffsetOfRawPtr>::IsZoneHandle(handle);
|
| }
|
|
|
| -
|
| int VMHandles::ScopedHandleCount() {
|
| Thread* thread = Thread::Current();
|
| ASSERT(thread->zone() != NULL);
|
| @@ -72,7 +65,6 @@ int VMHandles::ScopedHandleCount() {
|
| return handles->CountScopedHandles();
|
| }
|
|
|
| -
|
| int VMHandles::ZoneHandleCount() {
|
| Thread* thread = Thread::Current();
|
| ASSERT(thread->zone() != NULL);
|
| @@ -80,7 +72,6 @@ int VMHandles::ZoneHandleCount() {
|
| return handles->CountZoneHandles();
|
| }
|
|
|
| -
|
| void HandleScope::Initialize() {
|
| ASSERT(thread()->no_handle_scope_depth() == 0);
|
| VMHandles* handles = thread()->zone()->handles();
|
| @@ -93,12 +84,10 @@ void HandleScope::Initialize() {
|
| #endif
|
| }
|
|
|
| -
|
| HandleScope::HandleScope(Thread* thread) : StackResource(thread) {
|
| Initialize();
|
| }
|
|
|
| -
|
| HandleScope::~HandleScope() {
|
| ASSERT(thread()->zone() != NULL);
|
| VMHandles* handles = thread()->zone()->handles();
|
| @@ -113,13 +102,11 @@ HandleScope::~HandleScope() {
|
| #endif
|
| }
|
|
|
| -
|
| #if defined(DEBUG)
|
| NoHandleScope::NoHandleScope(Thread* thread) : StackResource(thread) {
|
| thread->IncrementNoHandleScopeDepth();
|
| }
|
|
|
| -
|
| NoHandleScope::~NoHandleScope() {
|
| thread()->DecrementNoHandleScopeDepth();
|
| }
|
|
|