OLD | NEW |
---|---|
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 p = (*p)->next_addr(); | 383 p = (*p)->next_addr(); |
384 } | 384 } |
385 } | 385 } |
386 set_first_free(NULL); | 386 set_first_free(NULL); |
387 if (first_deallocated()) { | 387 if (first_deallocated()) { |
388 first_deallocated()->set_next(head()); | 388 first_deallocated()->set_next(head()); |
389 } | 389 } |
390 } | 390 } |
391 | 391 |
392 | 392 |
393 void GlobalHandles::IterateRoots(ObjectVisitor* v) { | 393 void GlobalHandles::IterateStrongRoots(ObjectVisitor* v) { |
394 // Traversal of global handles marked as NORMAL or NEAR_DEATH. | 394 // Traversal of global handles marked as NORMAL or NEAR_DEATH. |
Mads Ager (chromium)
2009/11/05 15:06:19
This comment looks wrong. We are only interating
Christian Plesner Hansen
2009/11/05 15:11:03
Fixed
| |
395 for (Node* current = head_; current != NULL; current = current->next()) { | 395 for (Node* current = head_; current != NULL; current = current->next()) { |
396 if (current->state_ == Node::NORMAL) { | 396 if (current->state_ == Node::NORMAL) { |
397 v->VisitPointer(¤t->object_); | 397 v->VisitPointer(¤t->object_); |
398 } | 398 } |
399 } | 399 } |
400 } | 400 } |
401 | 401 |
402 | 402 |
403 void GlobalHandles::IterateAllRoots(ObjectVisitor* v) { | |
404 for (Node* current = head_; current != NULL; current = current->next()) { | |
405 if (current->state_ != Node::DESTROYED) { | |
406 v->VisitPointer(¤t->object_); | |
407 } | |
408 } | |
409 } | |
410 | |
411 | |
403 void GlobalHandles::TearDown() { | 412 void GlobalHandles::TearDown() { |
404 // Reset all the lists. | 413 // Reset all the lists. |
405 set_head(NULL); | 414 set_head(NULL); |
406 set_first_free(NULL); | 415 set_first_free(NULL); |
407 set_first_deallocated(NULL); | 416 set_first_deallocated(NULL); |
408 pool_.Release(); | 417 pool_.Release(); |
409 } | 418 } |
410 | 419 |
411 | 420 |
412 int GlobalHandles::number_of_weak_handles_ = 0; | 421 int GlobalHandles::number_of_weak_handles_ = 0; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
469 void GlobalHandles::RemoveObjectGroups() { | 478 void GlobalHandles::RemoveObjectGroups() { |
470 List<ObjectGroup*>* object_groups = ObjectGroups(); | 479 List<ObjectGroup*>* object_groups = ObjectGroups(); |
471 for (int i = 0; i< object_groups->length(); i++) { | 480 for (int i = 0; i< object_groups->length(); i++) { |
472 delete object_groups->at(i); | 481 delete object_groups->at(i); |
473 } | 482 } |
474 object_groups->Clear(); | 483 object_groups->Clear(); |
475 } | 484 } |
476 | 485 |
477 | 486 |
478 } } // namespace v8::internal | 487 } } // namespace v8::internal |
OLD | NEW |