@@ -32,16 +32,13 @@ namespace dart {
32
32
33
33
#if defined(DEBUG)
34
34
#define REUSABLE_SCOPE (name ) \
35
- class Reusable ##name##HandleScope : public ValueObject { \
35
+ class Reusable ##name##HandleScope : public StackResource { \
36
36
public: \
37
- explicit Reusable##name##HandleScope(Thread* thread) : thread_(thread) { \
37
+ explicit Reusable##name##HandleScope(Thread* thread = Thread::Current()) \
38
+ : StackResource(thread), thread_(thread) { \
38
39
ASSERT (!thread->reusable_ ##name##_handle_scope_active ()); \
39
40
thread->set_reusable_ ##name##_handle_scope_active (true ); \
40
41
} \
41
- Reusable##name##HandleScope() : thread_(Thread::Current()) { \
42
- ASSERT (!thread_->reusable_ ##name##_handle_scope_active ()); \
43
- thread_->set_reusable_ ##name##_handle_scope_active (true ); \
44
- } \
45
42
~Reusable##name##HandleScope() { \
46
43
ASSERT (thread_->reusable_ ##name##_handle_scope_active ()); \
47
44
thread_->set_reusable_ ##name##_handle_scope_active (false ); \
@@ -60,10 +57,8 @@ namespace dart {
60
57
#define REUSABLE_SCOPE (name ) \
61
58
class Reusable ##name##HandleScope : public ValueObject { \
62
59
public: \
63
- explicit Reusable##name##HandleScope(Thread* thread) \
60
+ explicit Reusable##name##HandleScope(Thread* thread = Thread::Current()) \
64
61
: handle_(thread->name##_handle_) {} \
65
- Reusable##name##HandleScope() \
66
- : handle_(Thread::Current()->name##_handle_) {} \
67
62
~Reusable##name##HandleScope() { handle_->ptr_ = name::null (); } \
68
63
name& Handle () const { \
69
64
ASSERT (handle_ != NULL ); \
0 commit comments