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

Side by Side Diff: runtime/vm/gc_marker.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/gc_marker.h" 5 #include "vm/gc_marker.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 } 399 }
400 if (!raw_obj->IsOldObject()) { 400 if (!raw_obj->IsOldObject()) {
401 return false; 401 return false;
402 } 402 }
403 return !raw_obj->IsMarked(); 403 return !raw_obj->IsMarked();
404 } 404 }
405 405
406 406
407 class MarkingWeakVisitor : public HandleVisitor { 407 class MarkingWeakVisitor : public HandleVisitor {
408 public: 408 public:
409 MarkingWeakVisitor() : HandleVisitor(Isolate::Current()) { 409 MarkingWeakVisitor() : HandleVisitor(Thread::Current()) {
410 } 410 }
411 411
412 void VisitHandle(uword addr) { 412 void VisitHandle(uword addr) {
413 FinalizablePersistentHandle* handle = 413 FinalizablePersistentHandle* handle =
414 reinterpret_cast<FinalizablePersistentHandle*>(addr); 414 reinterpret_cast<FinalizablePersistentHandle*>(addr);
415 RawObject* raw_obj = handle->raw(); 415 RawObject* raw_obj = handle->raw();
416 if (IsUnreachable(raw_obj)) { 416 if (IsUnreachable(raw_obj)) {
417 handle->UpdateUnreachable(isolate()); 417 handle->UpdateUnreachable(thread()->isolate());
418 } 418 }
419 } 419 }
420 420
421 private: 421 private:
422 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); 422 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor);
423 }; 423 };
424 424
425 425
426 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { 426 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
427 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) { 427 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 barrier.Exit(); 708 barrier.Exit();
709 } 709 }
710 delay_set.ClearReferences(); 710 delay_set.ClearReferences();
711 ProcessWeakTables(page_space); 711 ProcessWeakTables(page_space);
712 ProcessObjectIdTable(isolate); 712 ProcessObjectIdTable(isolate);
713 } 713 }
714 Epilogue(isolate, invoke_api_callbacks); 714 Epilogue(isolate, invoke_api_callbacks);
715 } 715 }
716 716
717 } // namespace dart 717 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/handles.h » ('j') | runtime/vm/thread.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698