Chromium Code Reviews| Index: src/api.h |
| diff --git a/src/api.h b/src/api.h |
| index 6be447424687a51812c4126edd333ddb6b9cfb88..179ae52111e68bebacc7c4101f62951f2f0ac647 100644 |
| --- a/src/api.h |
| +++ b/src/api.h |
| @@ -397,13 +397,13 @@ class DeferredHandles { |
| ~DeferredHandles(); |
| private: |
| - DeferredHandles(DeferredHandles* next, Object** first_block_limit, |
| - HandleScopeImplementer* impl) |
| - : next_(next), |
| + DeferredHandles(Object** first_block_limit, Isolate* isolate) |
| + : next_(isolate->deferred_handles_head_), |
| previous_(NULL), |
| first_block_limit_(first_block_limit), |
| - impl_(impl) { |
| - if (next != NULL) next->previous_ = this; |
| + isolate_(isolate) { |
| + if (next_ != NULL) next_->previous_ = this; |
| + isolate->deferred_handles_head_ = this; |
|
danno
2012/07/18 13:36:17
I don't think you should reach into the isolate li
sanjoy
2012/07/18 14:00:43
Done.
|
| } |
| void Iterate(ObjectVisitor* v); |
| @@ -412,9 +412,10 @@ class DeferredHandles { |
| DeferredHandles* next_; |
| DeferredHandles* previous_; |
| Object** first_block_limit_; |
| - HandleScopeImplementer* impl_; |
| + Isolate* isolate_; |
| friend class HandleScopeImplementer; |
| + friend class Isolate; |
| }; |
| @@ -436,8 +437,7 @@ class HandleScopeImplementer { |
| saved_contexts_(0), |
| spare_(NULL), |
| call_depth_(0), |
| - last_handle_before_deferred_block_(NULL), |
| - deferred_handles_head_(NULL) { } |
| + last_handle_before_deferred_block_(NULL) { } |
| ~HandleScopeImplementer() { |
| DeleteArray(spare_); |
| @@ -475,13 +475,18 @@ class HandleScopeImplementer { |
| inline List<internal::Object**>* blocks() { return &blocks_; } |
| Isolate* isolate() const { return isolate_; } |
| + void ReturnBlock(Object** block) { |
| + ASSERT(block != NULL); |
| + if (spare_ != NULL) DeleteArray(spare_); |
| + spare_ = block; |
| + } |
| + |
| private: |
| void ResetAfterArchive() { |
| blocks_.Initialize(0); |
| entered_contexts_.Initialize(0); |
| saved_contexts_.Initialize(0); |
| spare_ = NULL; |
| - deferred_handles_head_ = NULL; |
| last_handle_before_deferred_block_ = NULL; |
| call_depth_ = 0; |
| } |
| @@ -490,7 +495,6 @@ class HandleScopeImplementer { |
| ASSERT(blocks_.length() == 0); |
| ASSERT(entered_contexts_.length() == 0); |
| ASSERT(saved_contexts_.length() == 0); |
| - ASSERT(deferred_handles_head_ == NULL); |
| blocks_.Free(); |
| entered_contexts_.Free(); |
| saved_contexts_.Free(); |
| @@ -503,7 +507,6 @@ class HandleScopeImplementer { |
| void BeginDeferredScope(); |
| DeferredHandles* Detach(Object** prev_limit); |
| - void DestroyDeferredHandles(DeferredHandles* handles); |
| Isolate* isolate_; |
| List<internal::Object**> blocks_; |
| @@ -514,7 +517,6 @@ class HandleScopeImplementer { |
| Object** spare_; |
| int call_depth_; |
| Object** last_handle_before_deferred_block_; |
| - DeferredHandles* deferred_handles_head_; |
| // This is only used for threading support. |
| v8::ImplementationUtilities::HandleScopeData handle_scope_data_; |