OLD | NEW |
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/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "vm/assert.h" | 9 #include "vm/assert.h" |
10 #include "vm/bigint_store.h" | 10 #include "vm/bigint_store.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 327 } |
328 } | 328 } |
329 | 329 |
330 // Indicates success. | 330 // Indicates success. |
331 return Object::null(); | 331 return Object::null(); |
332 } | 332 } |
333 | 333 |
334 | 334 |
335 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, | 335 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, |
336 bool validate_frames) { | 336 bool validate_frames) { |
| 337 VisitStrongObjectPointers(visitor, validate_frames); |
| 338 VisitWeakObjectPointers(visitor); |
| 339 } |
| 340 |
| 341 |
| 342 void Isolate::VisitStrongObjectPointers(ObjectPointerVisitor* visitor, |
| 343 bool validate_frames) { |
337 ASSERT(visitor != NULL); | 344 ASSERT(visitor != NULL); |
338 | 345 |
339 // Visit objects in the object store. | 346 // Visit objects in the object store. |
340 object_store()->VisitObjectPointers(visitor); | 347 object_store()->VisitObjectPointers(visitor); |
341 | 348 |
342 // Visit objects in per isolate stubs. | 349 // Visit objects in per isolate stubs. |
343 StubCode::VisitObjectPointers(visitor); | 350 StubCode::VisitObjectPointers(visitor); |
344 | 351 |
345 // Visit objects in zones. | 352 // Visit objects in zones. |
346 current_zone()->VisitObjectPointers(visitor); | 353 current_zone()->VisitObjectPointers(visitor); |
347 | 354 |
348 // Iterate over all the stack frames and visit objects on the stack. | 355 // Iterate over all the stack frames and visit objects on the stack. |
349 StackFrameIterator frames_iterator(validate_frames); | 356 StackFrameIterator frames_iterator(validate_frames); |
350 StackFrame* frame = frames_iterator.NextFrame(); | 357 StackFrame* frame = frames_iterator.NextFrame(); |
351 while (frame != NULL) { | 358 while (frame != NULL) { |
352 frame->VisitObjectPointers(visitor); | 359 frame->VisitObjectPointers(visitor); |
353 frame = frames_iterator.NextFrame(); | 360 frame = frames_iterator.NextFrame(); |
354 } | 361 } |
355 | 362 |
356 // Visit the dart api state for all local and persistent handles. | 363 // Visit the dart api state for all local and persistent handles. |
357 if (api_state() != NULL) { | 364 if (api_state() != NULL) { |
358 api_state()->VisitObjectPointers(visitor); | 365 api_state()->VisitStrongObjectPointers(visitor); |
359 } | 366 } |
360 | 367 |
361 // Visit all objects in the code index table. | 368 // Visit all objects in the code index table. |
362 if (code_index_table() != NULL) { | 369 if (code_index_table() != NULL) { |
363 code_index_table()->VisitObjectPointers(visitor); | 370 code_index_table()->VisitObjectPointers(visitor); |
364 } | 371 } |
365 | 372 |
366 // Visit the top context which is stored in the isolate. | 373 // Visit the top context which is stored in the isolate. |
367 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); | 374 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); |
368 | 375 |
369 // Visit objects in the debugger. | 376 // Visit objects in the debugger. |
370 debugger()->VisitObjectPointers(visitor); | 377 debugger()->VisitObjectPointers(visitor); |
371 } | 378 } |
372 | 379 |
| 380 |
| 381 void Isolate::VisitWeakObjectPointers(ObjectPointerVisitor* visitor) { |
| 382 if (api_state() != NULL) { |
| 383 api_state()->VisitWeakObjectPointers(visitor); |
| 384 } |
| 385 } |
| 386 |
373 } // namespace dart | 387 } // namespace dart |
OLD | NEW |