| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 Object* object() const { return object_; } | 122 Object* object() const { return object_; } |
| 123 Object** location() { return &object_; } | 123 Object** location() { return &object_; } |
| 124 Handle<Object> handle() { return Handle<Object>(location()); } | 124 Handle<Object> handle() { return Handle<Object>(location()); } |
| 125 | 125 |
| 126 // Wrapper class ID accessors. | 126 // Wrapper class ID accessors. |
| 127 bool has_wrapper_class_id() const { | 127 bool has_wrapper_class_id() const { |
| 128 return class_id_ != v8::HeapProfiler::kPersistentHandleNoClassId; | 128 return class_id_ != v8::HeapProfiler::kPersistentHandleNoClassId; |
| 129 } | 129 } |
| 130 | 130 |
| 131 uint16_t wrapper_class_id() const { return class_id_; } | 131 uint16_t wrapper_class_id() const { return class_id_; } |
| 132 void set_wrapper_class_id(uint16_t class_id) { class_id_ = class_id; } | |
| 133 | 132 |
| 134 // State and flag accessors. | 133 // State and flag accessors. |
| 135 | 134 |
| 136 State state() const { | 135 State state() const { |
| 137 return NodeState::decode(flags_); | 136 return NodeState::decode(flags_); |
| 138 } | 137 } |
| 139 void set_state(State state) { | 138 void set_state(State state) { |
| 140 flags_ = NodeState::update(flags_, state); | 139 flags_ = NodeState::update(flags_, state); |
| 141 } | 140 } |
| 142 | 141 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 bool GlobalHandles::IsNearDeath(Object** location) { | 500 bool GlobalHandles::IsNearDeath(Object** location) { |
| 502 return Node::FromLocation(location)->IsNearDeath(); | 501 return Node::FromLocation(location)->IsNearDeath(); |
| 503 } | 502 } |
| 504 | 503 |
| 505 | 504 |
| 506 bool GlobalHandles::IsWeak(Object** location) { | 505 bool GlobalHandles::IsWeak(Object** location) { |
| 507 return Node::FromLocation(location)->IsWeak(); | 506 return Node::FromLocation(location)->IsWeak(); |
| 508 } | 507 } |
| 509 | 508 |
| 510 | 509 |
| 511 void GlobalHandles::SetWrapperClassId(Object** location, uint16_t class_id) { | |
| 512 Node::FromLocation(location)->set_wrapper_class_id(class_id); | |
| 513 } | |
| 514 | |
| 515 uint16_t GlobalHandles::GetWrapperClassId(Object** location) { | |
| 516 return Node::FromLocation(location)->wrapper_class_id(); | |
| 517 } | |
| 518 | |
| 519 void GlobalHandles::IterateWeakRoots(ObjectVisitor* v) { | 510 void GlobalHandles::IterateWeakRoots(ObjectVisitor* v) { |
| 520 for (NodeIterator it(this); !it.done(); it.Advance()) { | 511 for (NodeIterator it(this); !it.done(); it.Advance()) { |
| 521 if (it.node()->IsWeakRetainer()) v->VisitPointer(it.node()->location()); | 512 if (it.node()->IsWeakRetainer()) v->VisitPointer(it.node()->location()); |
| 522 } | 513 } |
| 523 } | 514 } |
| 524 | 515 |
| 525 | 516 |
| 526 void GlobalHandles::IterateWeakRoots(WeakReferenceGuest f, | 517 void GlobalHandles::IterateWeakRoots(WeakReferenceGuest f, |
| 527 WeakReferenceCallback callback) { | 518 WeakReferenceCallback callback) { |
| 528 for (NodeIterator it(this); !it.done(); it.Advance()) { | 519 for (NodeIterator it(this); !it.done(); it.Advance()) { |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 implicit_ref_groups_.Clear(); | 817 implicit_ref_groups_.Clear(); |
| 827 } | 818 } |
| 828 | 819 |
| 829 | 820 |
| 830 void GlobalHandles::TearDown() { | 821 void GlobalHandles::TearDown() { |
| 831 // TODO(1428): invoke weak callbacks. | 822 // TODO(1428): invoke weak callbacks. |
| 832 } | 823 } |
| 833 | 824 |
| 834 | 825 |
| 835 } } // namespace v8::internal | 826 } } // namespace v8::internal |
| OLD | NEW |