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

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

Issue 18316006: Introduce a handle zapping setting, and enable it by default for release and debug (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | « src/api.cc ('k') | src/handles.h » ('j') | 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_EXTRA_CHECKS 81 #ifdef ENABLE_HANDLE_ZAPPING
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
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_EXTRA_CHECKS 120 #ifdef ENABLE_HANDLE_ZAPPING
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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 } 1001 }
1002 } 1002 }
1003 object_group_connections_.Clear(); 1003 object_group_connections_.Clear();
1004 object_group_connections_.Initialize(kObjectGroupConnectionsCapacity); 1004 object_group_connections_.Initialize(kObjectGroupConnectionsCapacity);
1005 retainer_infos_.Clear(); 1005 retainer_infos_.Clear();
1006 implicit_ref_connections_.Clear(); 1006 implicit_ref_connections_.Clear();
1007 } 1007 }
1008 1008
1009 1009
1010 } } // namespace v8::internal 1010 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698