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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 STATIC_ASSERT(static_cast<int>(NodeState::kMask) == | 71 STATIC_ASSERT(static_cast<int>(NodeState::kMask) == |
72 Internals::kNodeStateMask); | 72 Internals::kNodeStateMask); |
73 STATIC_ASSERT(WEAK == Internals::kNodeStateIsWeakValue); | 73 STATIC_ASSERT(WEAK == Internals::kNodeStateIsWeakValue); |
74 STATIC_ASSERT(NEAR_DEATH == Internals::kNodeStateIsNearDeathValue); | 74 STATIC_ASSERT(NEAR_DEATH == Internals::kNodeStateIsNearDeathValue); |
75 STATIC_ASSERT(static_cast<int>(IsIndependent::kShift) == | 75 STATIC_ASSERT(static_cast<int>(IsIndependent::kShift) == |
76 Internals::kNodeIsIndependentShift); | 76 Internals::kNodeIsIndependentShift); |
77 STATIC_ASSERT(static_cast<int>(IsPartiallyDependent::kShift) == | 77 STATIC_ASSERT(static_cast<int>(IsPartiallyDependent::kShift) == |
78 Internals::kNodeIsPartiallyDependentShift); | 78 Internals::kNodeIsPartiallyDependentShift); |
79 } | 79 } |
80 | 80 |
81 #ifdef ENABLE_HANDLE_ZAPPING | 81 #ifdef ENABLE_EXTRA_CHECKS |
82 ~Node() { | 82 ~Node() { |
83 // TODO(1428): if it's a weak handle we should have invoked its callback. | 83 // TODO(1428): if it's a weak handle we should have invoked its callback. |
84 // Zap the values for eager trapping. | 84 // Zap the values for eager trapping. |
85 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue); | 85 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue); |
86 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; | 86 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; |
87 index_ = 0; | 87 index_ = 0; |
88 set_independent(false); | 88 set_independent(false); |
89 set_partially_dependent(false); | 89 set_partially_dependent(false); |
90 set_in_new_space_list(false); | 90 set_in_new_space_list(false); |
91 parameter_or_next_free_.next_free = NULL; | 91 parameter_or_next_free_.next_free = NULL; |
(...skipping 18 matching lines...) Expand all Loading... |
110 set_partially_dependent(false); | 110 set_partially_dependent(false); |
111 set_state(NORMAL); | 111 set_state(NORMAL); |
112 parameter_or_next_free_.parameter = NULL; | 112 parameter_or_next_free_.parameter = NULL; |
113 weak_reference_callback_ = NULL; | 113 weak_reference_callback_ = NULL; |
114 IncreaseBlockUses(); | 114 IncreaseBlockUses(); |
115 } | 115 } |
116 | 116 |
117 void Release() { | 117 void Release() { |
118 ASSERT(state() != FREE); | 118 ASSERT(state() != FREE); |
119 set_state(FREE); | 119 set_state(FREE); |
120 #ifdef ENABLE_HANDLE_ZAPPING | 120 #ifdef ENABLE_EXTRA_CHECKS |
121 // Zap the values for eager trapping. | 121 // Zap the values for eager trapping. |
122 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue); | 122 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue); |
123 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; | 123 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; |
124 set_independent(false); | 124 set_independent(false); |
125 set_partially_dependent(false); | 125 set_partially_dependent(false); |
126 weak_reference_callback_ = NULL; | 126 weak_reference_callback_ = NULL; |
127 #endif | 127 #endif |
128 DecreaseBlockUses(); | 128 DecreaseBlockUses(); |
129 } | 129 } |
130 | 130 |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 } | 1011 } |
1012 } | 1012 } |
1013 object_group_connections_.Clear(); | 1013 object_group_connections_.Clear(); |
1014 object_group_connections_.Initialize(kObjectGroupConnectionsCapacity); | 1014 object_group_connections_.Initialize(kObjectGroupConnectionsCapacity); |
1015 retainer_infos_.Clear(); | 1015 retainer_infos_.Clear(); |
1016 implicit_ref_connections_.Clear(); | 1016 implicit_ref_connections_.Clear(); |
1017 } | 1017 } |
1018 | 1018 |
1019 | 1019 |
1020 } } // namespace v8::internal | 1020 } } // namespace v8::internal |
OLD | NEW |