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

Unified Diff: src/isolate.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/isolate.h ('k') | src/objects.h » ('j') | 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 2dc01358fa3c28e80dd55e4a3e3dfabc79a8c08c..ed30d84cf1fa3fb9421f68326953ebff7458c71f 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -50,6 +50,7 @@
#include "src/tracing/tracing-category-observer.h"
#include "src/v8.h"
#include "src/version.h"
+#include "src/visitors.h"
#include "src/vm-state-inl.h"
#include "src/wasm/wasm-module.h"
#include "src/wasm/wasm-objects.h"
@@ -200,8 +201,7 @@ Address Isolate::get_address_from_id(Isolate::AddressId id) {
return isolate_addresses_[id];
}
-
-char* Isolate::Iterate(ObjectVisitor* v, char* thread_storage) {
+char* Isolate::Iterate(RootVisitor* v, char* thread_storage) {
ThreadLocalTop* thread = reinterpret_cast<ThreadLocalTop*>(thread_storage);
Iterate(v, thread);
return thread_storage + sizeof(ThreadLocalTop);
@@ -213,19 +213,18 @@ void Isolate::IterateThread(ThreadVisitor* v, char* t) {
v->VisitThread(this, thread);
}
-
-void Isolate::Iterate(ObjectVisitor* v, ThreadLocalTop* thread) {
+void Isolate::Iterate(RootVisitor* v, ThreadLocalTop* thread) {
// Visit the roots from the top for a given thread.
- v->VisitPointer(&thread->pending_exception_);
- v->VisitPointer(&(thread->pending_message_obj_));
- v->VisitPointer(bit_cast<Object**>(&(thread->context_)));
- v->VisitPointer(&thread->scheduled_exception_);
+ v->VisitRootPointer(Root::kTop, &thread->pending_exception_);
+ v->VisitRootPointer(Root::kTop, &thread->pending_message_obj_);
+ v->VisitRootPointer(Root::kTop, bit_cast<Object**>(&(thread->context_)));
+ v->VisitRootPointer(Root::kTop, &thread->scheduled_exception_);
for (v8::TryCatch* block = thread->try_catch_handler();
block != NULL;
block = block->next_) {
- v->VisitPointer(bit_cast<Object**>(&(block->exception_)));
- v->VisitPointer(bit_cast<Object**>(&(block->message_obj_)));
+ v->VisitRootPointer(Root::kTop, bit_cast<Object**>(&(block->exception_)));
+ v->VisitRootPointer(Root::kTop, bit_cast<Object**>(&(block->message_obj_)));
}
// Iterate over pointers on native execution stack.
@@ -234,14 +233,12 @@ void Isolate::Iterate(ObjectVisitor* v, ThreadLocalTop* thread) {
}
}
-
-void Isolate::Iterate(ObjectVisitor* v) {
+void Isolate::Iterate(RootVisitor* v) {
ThreadLocalTop* current_t = thread_local_top();
Iterate(v, current_t);
}
-
-void Isolate::IterateDeferredHandles(ObjectVisitor* visitor) {
+void Isolate::IterateDeferredHandles(RootVisitor* visitor) {
for (DeferredHandles* deferred = deferred_handles_head_;
deferred != NULL;
deferred = deferred->next_) {
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698