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

Unified Diff: src/api.cc

Issue 2801073006: Decouple root visitors from object visitors. (Closed)
Patch Set: rebase Created 3 years, 8 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
« no previous file with comments | « src/api.h ('k') | src/api-arguments.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index d7c01afb2cd603f6992067cbf20ab950c35bc598..ba8a3c3a16a778ecb20323b0ad09fc51994c7b2f 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -10326,8 +10326,7 @@ char* HandleScopeImplementer::RestoreThread(char* storage) {
return storage + ArchiveSpacePerThread();
}
-
-void HandleScopeImplementer::IterateThis(ObjectVisitor* v) {
+void HandleScopeImplementer::IterateThis(RootVisitor* v) {
#ifdef DEBUG
bool found_block_before_deferred = false;
#endif
@@ -10337,13 +10336,14 @@ void HandleScopeImplementer::IterateThis(ObjectVisitor* v) {
if (last_handle_before_deferred_block_ != NULL &&
(last_handle_before_deferred_block_ <= &block[kHandleBlockSize]) &&
(last_handle_before_deferred_block_ >= block)) {
- v->VisitPointers(block, last_handle_before_deferred_block_);
+ v->VisitRootPointers(Root::kHandleScope, block,
+ last_handle_before_deferred_block_);
DCHECK(!found_block_before_deferred);
#ifdef DEBUG
found_block_before_deferred = true;
#endif
} else {
- v->VisitPointers(block, &block[kHandleBlockSize]);
+ v->VisitRootPointers(Root::kHandleScope, block, &block[kHandleBlockSize]);
}
}
@@ -10352,30 +10352,30 @@ void HandleScopeImplementer::IterateThis(ObjectVisitor* v) {
// Iterate over live handles in the last block (if any).
if (!blocks()->is_empty()) {
- v->VisitPointers(blocks()->last(), handle_scope_data_.next);
+ v->VisitRootPointers(Root::kHandleScope, blocks()->last(),
+ handle_scope_data_.next);
}
List<Context*>* context_lists[2] = { &saved_contexts_, &entered_contexts_};
for (unsigned i = 0; i < arraysize(context_lists); i++) {
if (context_lists[i]->is_empty()) continue;
Object** start = reinterpret_cast<Object**>(&context_lists[i]->first());
- v->VisitPointers(start, start + context_lists[i]->length());
+ v->VisitRootPointers(Root::kHandleScope, start,
+ start + context_lists[i]->length());
}
if (microtask_context_) {
- Object** start = reinterpret_cast<Object**>(&microtask_context_);
- v->VisitPointers(start, start + 1);
+ v->VisitRootPointer(Root::kHandleScope,
+ reinterpret_cast<Object**>(&microtask_context_));
}
}
-
-void HandleScopeImplementer::Iterate(ObjectVisitor* v) {
+void HandleScopeImplementer::Iterate(RootVisitor* v) {
HandleScopeData* current = isolate_->handle_scope_data();
handle_scope_data_ = *current;
IterateThis(v);
}
-
-char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
+char* HandleScopeImplementer::Iterate(RootVisitor* v, char* storage) {
HandleScopeImplementer* scope_implementer =
reinterpret_cast<HandleScopeImplementer*>(storage);
scope_implementer->IterateThis(v);
@@ -10428,17 +10428,17 @@ DeferredHandles::~DeferredHandles() {
}
}
-
-void DeferredHandles::Iterate(ObjectVisitor* v) {
+void DeferredHandles::Iterate(RootVisitor* v) {
DCHECK(!blocks_.is_empty());
DCHECK((first_block_limit_ >= blocks_.first()) &&
(first_block_limit_ <= &(blocks_.first())[kHandleBlockSize]));
- v->VisitPointers(blocks_.first(), first_block_limit_);
+ v->VisitRootPointers(Root::kHandleScope, blocks_.first(), first_block_limit_);
for (int i = 1; i < blocks_.length(); i++) {
- v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
+ v->VisitRootPointers(Root::kHandleScope, blocks_[i],
+ &blocks_[i][kHandleBlockSize]);
}
}
« no previous file with comments | « src/api.h ('k') | src/api-arguments.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698