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

Unified Diff: runtime/vm/isolate.cc

Issue 1394673002: Move reusable handles from isolate to thread. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix release build Created 5 years, 2 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
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 6089f2db721e057c24b9e4878c09bc754eedab5f..e7bbfffb9bba3202ad4c09524d2ccb37b43daf1f 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -766,10 +766,7 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
compilation_allowed_(true),
cha_(NULL),
next_(NULL),
- pause_loop_monitor_(NULL),
- REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
- REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
- reusable_handles_() {
+ pause_loop_monitor_(NULL) {
flags_.CopyFrom(api_flags);
Thread::Current()->set_vm_tag(VMTag::kEmbedderTagId);
set_user_tag(UserTags::kDefaultUserTag);
@@ -854,12 +851,6 @@ Isolate* Isolate::Init(const char* name_prefix,
// the current isolate.
Thread::EnterIsolate(result);
- // Setup the isolate specific resuable handles.
-#define REUSABLE_HANDLE_ALLOCATION(object) \
- result->object##_handle_ = result->AllocateReusableHandle<object>();
- REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_ALLOCATION)
-#undef REUSABLE_HANDLE_ALLOCATION
-
// Setup the isolate message handler.
MessageHandler* handler = new IsolateMessageHandler(result);
ASSERT(handler != NULL);
@@ -1554,13 +1545,13 @@ void Isolate::PrintInvokedFunctions() {
class FinalizeWeakPersistentHandlesVisitor : public HandleVisitor {
public:
- FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Isolate::Current()) {
+ FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Thread::Current()) {
}
void VisitHandle(uword addr) {
FinalizablePersistentHandle* handle =
reinterpret_cast<FinalizablePersistentHandle*>(addr);
- handle->UpdateUnreachable(I);
+ handle->UpdateUnreachable(thread()->isolate());
}
private:
@@ -1745,9 +1736,6 @@ void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
// Visit objects in per isolate stubs.
StubCode::VisitObjectPointers(visitor);
- // Visit objects in isolate specific handles area.
- reusable_handles_.VisitObjectPointers(visitor);
-
// Visit the dart api state for all local and persistent handles.
if (api_state() != NULL) {
api_state()->VisitObjectPointers(visitor, visit_prologue_weak_handles);
@@ -2285,14 +2273,6 @@ void Isolate::EnableIsolateCreation() {
}
-template<class C>
-C* Isolate::AllocateReusableHandle() {
- C* handle = reinterpret_cast<C*>(reusable_handles_.AllocateScopedHandle());
- C::initializeHandle(handle, C::null());
- return handle;
-}
-
-
void Isolate::KillLocked() {
Dart_CObject kill_msg;
Dart_CObject* list_values[4];
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/longjump.cc » ('j') | runtime/vm/thread.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698