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

Side by Side Diff: runtime/vm/isolate.cc

Issue 9655011: Implement prologue weak persistent handles. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: final revision Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/object.cc » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/code_index_table.h" 9 #include "vm/code_index_table.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 } 425 }
426 } 426 }
427 } 427 }
428 428
429 // Indicates success. 429 // Indicates success.
430 return Error::null(); 430 return Error::null();
431 } 431 }
432 432
433 433
434 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, 434 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
435 bool visit_prologue_weak_handles,
435 bool validate_frames) { 436 bool validate_frames) {
436 ASSERT(visitor != NULL); 437 ASSERT(visitor != NULL);
437 438
438 // Visit objects in the object store. 439 // Visit objects in the object store.
439 object_store()->VisitObjectPointers(visitor); 440 object_store()->VisitObjectPointers(visitor);
440 441
441 // Visit objects in per isolate stubs. 442 // Visit objects in per isolate stubs.
442 StubCode::VisitObjectPointers(visitor); 443 StubCode::VisitObjectPointers(visitor);
443 444
444 // Visit objects in zones. 445 // Visit objects in zones.
445 current_zone()->VisitObjectPointers(visitor); 446 current_zone()->VisitObjectPointers(visitor);
446 447
447 // Iterate over all the stack frames and visit objects on the stack. 448 // Iterate over all the stack frames and visit objects on the stack.
448 StackFrameIterator frames_iterator(validate_frames); 449 StackFrameIterator frames_iterator(validate_frames);
449 StackFrame* frame = frames_iterator.NextFrame(); 450 StackFrame* frame = frames_iterator.NextFrame();
450 while (frame != NULL) { 451 while (frame != NULL) {
451 frame->VisitObjectPointers(visitor); 452 frame->VisitObjectPointers(visitor);
452 frame = frames_iterator.NextFrame(); 453 frame = frames_iterator.NextFrame();
453 } 454 }
454 455
455 // Visit the dart api state for all local and persistent handles. 456 // Visit the dart api state for all local and persistent handles.
456 if (api_state() != NULL) { 457 if (api_state() != NULL) {
457 api_state()->VisitObjectPointers(visitor); 458 api_state()->VisitObjectPointers(visitor, visit_prologue_weak_handles);
458 } 459 }
459 460
460 // Visit all objects in the code index table. 461 // Visit all objects in the code index table.
461 if (code_index_table() != NULL) { 462 if (code_index_table() != NULL) {
462 code_index_table()->VisitObjectPointers(visitor); 463 code_index_table()->VisitObjectPointers(visitor);
463 } 464 }
464 465
465 // Visit the top context which is stored in the isolate. 466 // Visit the top context which is stored in the isolate.
466 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); 467 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_));
467 468
468 // Visit objects in the debugger. 469 // Visit objects in the debugger.
469 debugger()->VisitObjectPointers(visitor); 470 debugger()->VisitObjectPointers(visitor);
470 } 471 }
471 472
472 473
473 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor) { 474 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor,
475 bool visit_prologue_weak_handles) {
474 if (api_state() != NULL) { 476 if (api_state() != NULL) {
475 api_state()->VisitWeakHandles(visitor); 477 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles);
476 } 478 }
477 } 479 }
478 480
479 } // namespace dart 481 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698