Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Unified Diff: src/isolate.cc

Issue 10778036: The deferred handes list belongs to the Isolate and not to the (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/isolate.h ('K') | « src/isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index cb73c26b98e8849d3ee1048a47e05e5f1d0b1d43..06a7f1e15416ba49ccdf774def7984d863fec6be 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -477,6 +477,14 @@ void Isolate::Iterate(ObjectVisitor* v) {
Iterate(v, current_t);
}
+void Isolate::IterateDeferredHandles(ObjectVisitor* visitor) {
+ for (DeferredHandles* deferred = deferred_handles_head_;
+ deferred;
danno 2012/07/18 13:36:17 Use explicit test against NULL
sanjoy 2012/07/18 14:00:44 Done.
+ deferred = deferred->next_) {
+ deferred->Iterate(visitor);
+ }
+}
+
void Isolate::RegisterTryCatchHandler(v8::TryCatch* that) {
// The ARM simulator has a separate JS stack. We therefore register
@@ -1484,7 +1492,8 @@ Isolate::Isolate()
string_tracker_(NULL),
regexp_stack_(NULL),
date_cache_(NULL),
- context_exit_happened_(false) {
+ context_exit_happened_(false),
+ deferred_handles_head_(NULL) {
TRACE_ISOLATE(constructor);
memset(isolate_addresses_, 0,
@@ -1989,6 +1998,33 @@ void Isolate::Exit() {
}
+void Isolate::DestroyDeferredHandles(DeferredHandles* deferred) {
+#ifdef DEBUG
+ DeferredHandles* deferred_iterator = deferred;
+ while (deferred_iterator->previous_ != NULL) {
+ deferred_iterator = deferred_iterator->previous_;
+ }
+ ASSERT(deferred_handles_head_ == deferred_iterator);
+#endif
+ if (deferred_handles_head_ == deferred) {
+ deferred_handles_head_ = deferred_handles_head_->next_;
+ }
+ if (deferred->next_ != NULL) {
+ deferred->next_->previous_ = deferred->previous_;
+ }
+ if (deferred->previous_ != NULL) {
+ deferred->previous_->next_ = deferred->next_;
+ }
+ for (int i = 0; i < deferred->blocks_.length(); i++) {
+#ifdef DEBUG
+ HandleScope::ZapRange(deferred->blocks_[i],
+ &deferred->blocks_[i][kHandleBlockSize]);
+#endif
+ handle_scope_implementer()->ReturnBlock(deferred->blocks_[i]);
+ }
+}
+
+
#ifdef DEBUG
#define ISOLATE_FIELD_OFFSET(type, name, ignored) \
const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
« src/isolate.h ('K') | « src/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698