Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(845)

Side by Side Diff: src/global-handles.cc

Issue 12388080: Enable zapping of disposed global handles in release mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // TODO(176056): Enable as soon as WebKit bindings are fixed. 116 // TODO(mstarzinger): Put behind debug flag once embedders are stabilized.
117 #ifdef DEBUG_TODO 117 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue);
118 #ifdef DEBUG
118 // Zap the values for eager trapping. 119 // Zap the values for eager trapping.
119 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue);
120 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; 120 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
121 set_independent(false); 121 set_independent(false);
122 set_partially_dependent(false); 122 set_partially_dependent(false);
123 weak_reference_callback_ = NULL; 123 weak_reference_callback_ = NULL;
124 near_death_callback_ = NULL; 124 near_death_callback_ = NULL;
125 #endif 125 #endif
126 parameter_or_next_free_.next_free = global_handles->first_free_; 126 parameter_or_next_free_.next_free = global_handles->first_free_;
127 global_handles->first_free_ = this; 127 global_handles->first_free_ = this;
128 DecreaseBlockUses(global_handles); 128 DecreaseBlockUses(global_handles);
129 } 129 }
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 implicit_ref_groups_.Clear(); 854 implicit_ref_groups_.Clear();
855 } 855 }
856 856
857 857
858 void GlobalHandles::TearDown() { 858 void GlobalHandles::TearDown() {
859 // TODO(1428): invoke weak callbacks. 859 // TODO(1428): invoke weak callbacks.
860 } 860 }
861 861
862 862
863 } } // namespace v8::internal 863 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698