Chromium Code Reviews| Index: src/handles.h |
| diff --git a/src/handles.h b/src/handles.h |
| index 29ece281e0984d3fe9224860b3aa2703911cddd1..ff5aed2a6d4b94a96387e9278d6ece3ac9f30200 100644 |
| --- a/src/handles.h |
| +++ b/src/handles.h |
| @@ -85,7 +85,7 @@ class Handle { |
| inline Handle<T> EscapeFrom(v8::HandleScope* scope); |
| #ifdef DEBUG |
| - bool IsDereferenceAllowed(bool allow_deferred) const; |
| + bool IsDereferenceAllowed(bool explicitly_allow_deferred) const; |
| #endif // DEBUG |
| private: |
| @@ -330,14 +330,17 @@ Handle<ObjectHashTable> PutIntoObjectHashTable(Handle<ObjectHashTable> table, |
| Handle<Object> key, |
| Handle<Object> value); |
| -class NoHandleAllocation BASE_EMBEDDED { |
| + |
| +// Seal off the current HandleScope so that new handles can only be created |
| +// if a new HandleScope is entered. |
| +class RequireNewHandleScope BASE_EMBEDDED { |
|
Sven Panne
2013/06/03 09:58:23
As discussed offline, rename this to "SealHandleSc
Yang
2013/06/03 13:37:15
Done.
|
| public: |
| #ifndef DEBUG |
| - explicit NoHandleAllocation(Isolate* isolate) {} |
| - ~NoHandleAllocation() {} |
| + explicit RequireNewHandleScope(Isolate* isolate) {} |
| + ~RequireNewHandleScope() {} |
| #else |
| - explicit inline NoHandleAllocation(Isolate* isolate); |
| - inline ~NoHandleAllocation(); |
| + explicit inline RequireNewHandleScope(Isolate* isolate); |
| + inline ~RequireNewHandleScope(); |
| private: |
| Isolate* isolate_; |
| Object** limit_; |
| @@ -346,30 +349,6 @@ class NoHandleAllocation BASE_EMBEDDED { |
| #endif |
| }; |
| - |
| -class HandleDereferenceGuard BASE_EMBEDDED { |
| - public: |
| - enum State { ALLOW, DISALLOW, DISALLOW_DEFERRED }; |
| -#ifndef DEBUG |
| - HandleDereferenceGuard(Isolate* isolate, State state) { } |
| - ~HandleDereferenceGuard() { } |
| -#else |
| - inline HandleDereferenceGuard(Isolate* isolate, State state); |
| - inline ~HandleDereferenceGuard(); |
| - private: |
| - Isolate* isolate_; |
| - State old_state_; |
| -#endif |
| -}; |
| - |
| -#ifdef DEBUG |
| -#define ALLOW_HANDLE_DEREF(isolate, why_this_is_safe) \ |
| - HandleDereferenceGuard allow_deref(isolate, \ |
| - HandleDereferenceGuard::ALLOW); |
| -#else |
| -#define ALLOW_HANDLE_DEREF(isolate, why_this_is_safe) |
| -#endif // DEBUG |
| - |
| } } // namespace v8::internal |
| #endif // V8_HANDLES_H_ |