| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/global-handles.h" | 5 #include "src/global-handles.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 #include "src/vm-state-inl.h" | 9 #include "src/vm-state-inl.h" |
| 10 | 10 |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 637 |
| 638 bool GlobalHandles::IsNearDeath(Object** location) { | 638 bool GlobalHandles::IsNearDeath(Object** location) { |
| 639 return Node::FromLocation(location)->IsNearDeath(); | 639 return Node::FromLocation(location)->IsNearDeath(); |
| 640 } | 640 } |
| 641 | 641 |
| 642 | 642 |
| 643 bool GlobalHandles::IsWeak(Object** location) { | 643 bool GlobalHandles::IsWeak(Object** location) { |
| 644 return Node::FromLocation(location)->IsWeak(); | 644 return Node::FromLocation(location)->IsWeak(); |
| 645 } | 645 } |
| 646 | 646 |
| 647 | |
| 648 void GlobalHandles::IterateWeakRoots(ObjectVisitor* v) { | 647 void GlobalHandles::IterateWeakRoots(ObjectVisitor* v) { |
| 649 for (NodeIterator it(this); !it.done(); it.Advance()) { | 648 for (NodeIterator it(this); !it.done(); it.Advance()) { |
| 650 Node* node = it.node(); | 649 Node* node = it.node(); |
| 651 if (node->IsWeakRetainer()) { | 650 if (node->IsWeakRetainer()) { |
| 652 // Pending weak phantom handles die immediately. Everything else survives. | 651 // Pending weak phantom handles die immediately. Everything else survives. |
| 653 if (node->state() == Node::PENDING && | 652 if (node->state() == Node::PENDING && |
| 654 node->weakness_type() != NORMAL_WEAK) { | 653 node->weakness_type() != NORMAL_WEAK) { |
| 655 node->CollectPhantomCallbackData(isolate(), | 654 node->CollectPhantomCallbackData(isolate(), |
| 656 &pending_phantom_callbacks_); | 655 &pending_phantom_callbacks_); |
| 657 } else { | 656 } else { |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 blocks_[block][offset] = object; | 1482 blocks_[block][offset] = object; |
| 1484 if (isolate->heap()->InNewSpace(object)) { | 1483 if (isolate->heap()->InNewSpace(object)) { |
| 1485 new_space_indices_.Add(size_); | 1484 new_space_indices_.Add(size_); |
| 1486 } | 1485 } |
| 1487 *index = size_++; | 1486 *index = size_++; |
| 1488 } | 1487 } |
| 1489 | 1488 |
| 1490 | 1489 |
| 1491 } // namespace internal | 1490 } // namespace internal |
| 1492 } // namespace v8 | 1491 } // namespace v8 |
| OLD | NEW |