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 22909051: turn on global handle zapping (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 set_partially_dependent(false); 111 set_partially_dependent(false);
112 set_state(NORMAL); 112 set_state(NORMAL);
113 parameter_or_next_free_.parameter = NULL; 113 parameter_or_next_free_.parameter = NULL;
114 weak_reference_callback_ = NULL; 114 weak_reference_callback_ = NULL;
115 IncreaseBlockUses(); 115 IncreaseBlockUses();
116 } 116 }
117 117
118 void Release() { 118 void Release() {
119 ASSERT(state() != FREE); 119 ASSERT(state() != FREE);
120 set_state(FREE); 120 set_state(FREE);
121 #ifdef ENABLE_EXTRA_CHECKS
122 // Zap the values for eager trapping. 121 // Zap the values for eager trapping.
123 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue); 122 object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue);
124 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId; 123 class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
125 set_independent(false); 124 set_independent(false);
126 set_partially_dependent(false); 125 set_partially_dependent(false);
127 weak_reference_callback_ = NULL; 126 weak_reference_callback_ = NULL;
128 #endif
129 DecreaseBlockUses(); 127 DecreaseBlockUses();
130 } 128 }
131 129
132 // Object slot accessors. 130 // Object slot accessors.
133 Object* object() const { return object_; } 131 Object* object() const { return object_; }
134 Object** location() { return &object_; } 132 Object** location() { return &object_; }
135 Handle<Object> handle() { return Handle<Object>(location()); } 133 Handle<Object> handle() { return Handle<Object>(location()); }
136 134
137 // Wrapper class ID accessors. 135 // Wrapper class ID accessors.
138 bool has_wrapper_class_id() const { 136 bool has_wrapper_class_id() const {
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 ASSERT_EQ(isolate->heap()->the_hole_value(), blocks_[block][offset]); 1075 ASSERT_EQ(isolate->heap()->the_hole_value(), blocks_[block][offset]);
1078 blocks_[block][offset] = object; 1076 blocks_[block][offset] = object;
1079 if (isolate->heap()->InNewSpace(object)) { 1077 if (isolate->heap()->InNewSpace(object)) {
1080 new_space_indices_.Add(size_); 1078 new_space_indices_.Add(size_);
1081 } 1079 }
1082 return size_++; 1080 return size_++;
1083 } 1081 }
1084 1082
1085 1083
1086 } } // namespace v8::internal 1084 } } // 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