OLD | NEW |
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 ASSERT(result.IsNull()); | 416 ASSERT(result.IsNull()); |
417 } | 417 } |
418 } | 418 } |
419 | 419 |
420 // Indicates success. | 420 // Indicates success. |
421 return Error::null(); | 421 return Error::null(); |
422 } | 422 } |
423 | 423 |
424 | 424 |
425 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, | 425 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, |
| 426 bool visit_prologue_weak_handles, |
426 bool validate_frames) { | 427 bool validate_frames) { |
427 ASSERT(visitor != NULL); | 428 ASSERT(visitor != NULL); |
428 | 429 |
429 // Visit objects in the object store. | 430 // Visit objects in the object store. |
430 object_store()->VisitObjectPointers(visitor); | 431 object_store()->VisitObjectPointers(visitor); |
431 | 432 |
432 // Visit objects in per isolate stubs. | 433 // Visit objects in per isolate stubs. |
433 StubCode::VisitObjectPointers(visitor); | 434 StubCode::VisitObjectPointers(visitor); |
434 | 435 |
435 // Visit objects in zones. | 436 // Visit objects in zones. |
436 current_zone()->VisitObjectPointers(visitor); | 437 current_zone()->VisitObjectPointers(visitor); |
437 | 438 |
438 // Iterate over all the stack frames and visit objects on the stack. | 439 // Iterate over all the stack frames and visit objects on the stack. |
439 StackFrameIterator frames_iterator(validate_frames); | 440 StackFrameIterator frames_iterator(validate_frames); |
440 StackFrame* frame = frames_iterator.NextFrame(); | 441 StackFrame* frame = frames_iterator.NextFrame(); |
441 while (frame != NULL) { | 442 while (frame != NULL) { |
442 frame->VisitObjectPointers(visitor); | 443 frame->VisitObjectPointers(visitor); |
443 frame = frames_iterator.NextFrame(); | 444 frame = frames_iterator.NextFrame(); |
444 } | 445 } |
445 | 446 |
446 // Visit the dart api state for all local and persistent handles. | 447 // Visit the dart api state for all local and persistent handles. |
447 if (api_state() != NULL) { | 448 if (api_state() != NULL) { |
448 api_state()->VisitObjectPointers(visitor); | 449 api_state()->VisitObjectPointers(visitor, visit_prologue_weak_handles); |
449 } | 450 } |
450 | 451 |
451 // Visit all objects in the code index table. | 452 // Visit all objects in the code index table. |
452 if (code_index_table() != NULL) { | 453 if (code_index_table() != NULL) { |
453 code_index_table()->VisitObjectPointers(visitor); | 454 code_index_table()->VisitObjectPointers(visitor); |
454 } | 455 } |
455 | 456 |
456 // Visit the top context which is stored in the isolate. | 457 // Visit the top context which is stored in the isolate. |
457 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); | 458 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); |
458 | 459 |
459 // Visit objects in the debugger. | 460 // Visit objects in the debugger. |
460 debugger()->VisitObjectPointers(visitor); | 461 debugger()->VisitObjectPointers(visitor); |
461 } | 462 } |
462 | 463 |
463 | 464 |
464 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor) { | 465 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, |
| 466 bool visit_prologue_weak_handles) { |
465 if (api_state() != NULL) { | 467 if (api_state() != NULL) { |
466 api_state()->VisitWeakHandles(visitor); | 468 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); |
467 } | 469 } |
468 } | 470 } |
469 | 471 |
470 } // namespace dart | 472 } // namespace dart |
OLD | NEW |