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

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
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/handles.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 } 456 }
457 if (!raw_obj->IsOldObject()) { 457 if (!raw_obj->IsOldObject()) {
458 return false; 458 return false;
459 } 459 }
460 return !raw_obj->IsMarked(); 460 return !raw_obj->IsMarked();
461 } 461 }
462 462
463 463
464 class MarkingWeakVisitor : public HandleVisitor { 464 class MarkingWeakVisitor : public HandleVisitor {
465 public: 465 public:
466 MarkingWeakVisitor() : HandleVisitor(Isolate::Current()) { 466 MarkingWeakVisitor() : HandleVisitor(Thread::Current()) {
467 } 467 }
468 468
469 void VisitHandle(uword addr) { 469 void VisitHandle(uword addr) {
470 FinalizablePersistentHandle* handle = 470 FinalizablePersistentHandle* handle =
471 reinterpret_cast<FinalizablePersistentHandle*>(addr); 471 reinterpret_cast<FinalizablePersistentHandle*>(addr);
472 RawObject* raw_obj = handle->raw(); 472 RawObject* raw_obj = handle->raw();
473 if (IsUnreachable(raw_obj)) { 473 if (IsUnreachable(raw_obj)) {
474 handle->UpdateUnreachable(isolate()); 474 handle->UpdateUnreachable(thread()->isolate());
475 } 475 }
476 } 476 }
477 477
478 private: 478 private:
479 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); 479 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor);
480 }; 480 };
481 481
482 482
483 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { 483 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
484 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) { 484 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) {
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 barrier.Exit(); 818 barrier.Exit();
819 } 819 }
820 delay_set.ClearReferences(); 820 delay_set.ClearReferences();
821 ProcessWeakTables(page_space); 821 ProcessWeakTables(page_space);
822 ProcessObjectIdTable(isolate); 822 ProcessObjectIdTable(isolate);
823 } 823 }
824 Epilogue(isolate, invoke_api_callbacks); 824 Epilogue(isolate, invoke_api_callbacks);
825 } 825 }
826 826
827 } // namespace dart 827 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698