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