| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 PENDING, // Has been recognized as only reachable by weak handles. | 52 PENDING, // Has been recognized as only reachable by weak handles. |
| 53 NEAR_DEATH // Callback has informed the handle is near death. | 53 NEAR_DEATH // Callback has informed the handle is near death. |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 // Maps handle location (slot) to the containing node. | 56 // Maps handle location (slot) to the containing node. |
| 57 static Node* FromLocation(Object** location) { | 57 static Node* FromLocation(Object** location) { |
| 58 ASSERT(OFFSET_OF(Node, object_) == 0); | 58 ASSERT(OFFSET_OF(Node, object_) == 0); |
| 59 return reinterpret_cast<Node*>(location); | 59 return reinterpret_cast<Node*>(location); |
| 60 } | 60 } |
| 61 | 61 |
| 62 Node() {} | 62 Node() { |
| 63 ASSERT(OFFSET_OF(Node, flags_) == Internals::kNodeFlagsOffset); |
| 64 ASSERT(static_cast<int>(IsIndependent::kShift) == |
| 65 Internals::kNodeIsIndependentShift); |
| 66 ASSERT(static_cast<int>(IsPartiallyDependent::kShift) == |
| 67 Internals::kNodeIsPartiallyDependentShift); |
| 68 } |
| 63 | 69 |
| 64 #ifdef DEBUG | 70 #ifdef DEBUG |
| 65 ~Node() { | 71 ~Node() { |
| 66 // TODO(1428): if it's a weak handle we should have invoked its callback. | 72 // TODO(1428): if it's a weak handle we should have invoked its callback. |
| 67 // Zap the values for eager trapping. | 73 // Zap the values for eager trapping. |
| 68 object_ = NULL; | 74 object_ = NULL; |
| 69 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; | 75 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; |
| 70 index_ = 0; | 76 index_ = 0; |
| 71 set_independent(false); | 77 set_independent(false); |
| 72 set_partially_dependent(false); | 78 set_partially_dependent(false); |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 implicit_ref_groups_.Clear(); | 825 implicit_ref_groups_.Clear(); |
| 820 } | 826 } |
| 821 | 827 |
| 822 | 828 |
| 823 void GlobalHandles::TearDown() { | 829 void GlobalHandles::TearDown() { |
| 824 // TODO(1428): invoke weak callbacks. | 830 // TODO(1428): invoke weak callbacks. |
| 825 } | 831 } |
| 826 | 832 |
| 827 | 833 |
| 828 } } // namespace v8::internal | 834 } } // namespace v8::internal |
| OLD | NEW |