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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |
| 117 // Zap the values for eager trapping. |
| 118 object_ = NULL; |
| 119 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; |
| 120 set_independent(false); |
| 121 set_partially_dependent(false); |
| 122 weak_reference_callback_ = NULL; |
| 123 near_death_callback_ = NULL; |
| 124 #endif |
116 parameter_or_next_free_.next_free = global_handles->first_free_; | 125 parameter_or_next_free_.next_free = global_handles->first_free_; |
117 global_handles->first_free_ = this; | 126 global_handles->first_free_ = this; |
118 DecreaseBlockUses(global_handles); | 127 DecreaseBlockUses(global_handles); |
119 } | 128 } |
120 | 129 |
121 // Object slot accessors. | 130 // Object slot accessors. |
122 Object* object() const { return object_; } | 131 Object* object() const { return object_; } |
123 Object** location() { return &object_; } | 132 Object** location() { return &object_; } |
124 Handle<Object> handle() { return Handle<Object>(location()); } | 133 Handle<Object> handle() { return Handle<Object>(location()); } |
125 | 134 |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 implicit_ref_groups_.Clear(); | 853 implicit_ref_groups_.Clear(); |
845 } | 854 } |
846 | 855 |
847 | 856 |
848 void GlobalHandles::TearDown() { | 857 void GlobalHandles::TearDown() { |
849 // TODO(1428): invoke weak callbacks. | 858 // TODO(1428): invoke weak callbacks. |
850 } | 859 } |
851 | 860 |
852 | 861 |
853 } } // namespace v8::internal | 862 } } // namespace v8::internal |
OLD | NEW |