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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 STATIC_ASSERT(static_cast<int>(IsIndependent::kShift) == | 69 STATIC_ASSERT(static_cast<int>(IsIndependent::kShift) == |
70 Internals::kNodeIsIndependentShift); | 70 Internals::kNodeIsIndependentShift); |
71 STATIC_ASSERT(static_cast<int>(IsPartiallyDependent::kShift) == | 71 STATIC_ASSERT(static_cast<int>(IsPartiallyDependent::kShift) == |
72 Internals::kNodeIsPartiallyDependentShift); | 72 Internals::kNodeIsPartiallyDependentShift); |
73 } | 73 } |
74 | 74 |
75 #ifdef DEBUG | 75 #ifdef DEBUG |
76 ~Node() { | 76 ~Node() { |
77 // TODO(1428): if it's a weak handle we should have invoked its callback. | 77 // TODO(1428): if it's a weak handle we should have invoked its callback. |
78 // Zap the values for eager trapping. | 78 // Zap the values for eager trapping. |
79 object_ = NULL; | 79 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue); |
80 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; | 80 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; |
81 index_ = 0; | 81 index_ = 0; |
82 set_independent(false); | 82 set_independent(false); |
83 set_partially_dependent(false); | 83 set_partially_dependent(false); |
84 set_in_new_space_list(false); | 84 set_in_new_space_list(false); |
85 parameter_or_next_free_.next_free = NULL; | 85 parameter_or_next_free_.next_free = NULL; |
86 weak_reference_callback_ = NULL; | 86 weak_reference_callback_ = NULL; |
87 near_death_callback_ = NULL; | 87 near_death_callback_ = NULL; |
88 } | 88 } |
89 #endif | 89 #endif |
(...skipping 16 matching lines...) Expand all Loading... |
106 set_state(NORMAL); | 106 set_state(NORMAL); |
107 parameter_or_next_free_.parameter = NULL; | 107 parameter_or_next_free_.parameter = NULL; |
108 weak_reference_callback_ = NULL; | 108 weak_reference_callback_ = NULL; |
109 near_death_callback_ = NULL; | 109 near_death_callback_ = NULL; |
110 IncreaseBlockUses(global_handles); | 110 IncreaseBlockUses(global_handles); |
111 } | 111 } |
112 | 112 |
113 void Release(GlobalHandles* global_handles) { | 113 void Release(GlobalHandles* global_handles) { |
114 ASSERT(state() != FREE); | 114 ASSERT(state() != FREE); |
115 set_state(FREE); | 115 set_state(FREE); |
116 #ifdef DEBUG | 116 // TODO(176056): Enable as soon as WebKit bindings are fixed. |
| 117 #ifdef DEBUG_TODO |
117 // Zap the values for eager trapping. | 118 // Zap the values for eager trapping. |
118 object_ = NULL; | 119 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue); |
119 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; | 120 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; |
120 set_independent(false); | 121 set_independent(false); |
121 set_partially_dependent(false); | 122 set_partially_dependent(false); |
122 weak_reference_callback_ = NULL; | 123 weak_reference_callback_ = NULL; |
123 near_death_callback_ = NULL; | 124 near_death_callback_ = NULL; |
124 #endif | 125 #endif |
125 parameter_or_next_free_.next_free = global_handles->first_free_; | 126 parameter_or_next_free_.next_free = global_handles->first_free_; |
126 global_handles->first_free_ = this; | 127 global_handles->first_free_ = this; |
127 DecreaseBlockUses(global_handles); | 128 DecreaseBlockUses(global_handles); |
128 } | 129 } |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 implicit_ref_groups_.Clear(); | 854 implicit_ref_groups_.Clear(); |
854 } | 855 } |
855 | 856 |
856 | 857 |
857 void GlobalHandles::TearDown() { | 858 void GlobalHandles::TearDown() { |
858 // TODO(1428): invoke weak callbacks. | 859 // TODO(1428): invoke weak callbacks. |
859 } | 860 } |
860 | 861 |
861 | 862 |
862 } } // namespace v8::internal | 863 } } // namespace v8::internal |
OLD | NEW |