OLD | NEW |
---|---|
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 CloseScope(isolate_, prev_next_, prev_limit_); | 123 CloseScope(isolate_, prev_next_, prev_limit_); |
124 } | 124 } |
125 | 125 |
126 | 126 |
127 void HandleScope::CloseScope(Isolate* isolate, | 127 void HandleScope::CloseScope(Isolate* isolate, |
128 Object** prev_next, | 128 Object** prev_next, |
129 Object** prev_limit) { | 129 Object** prev_limit) { |
130 v8::ImplementationUtilities::HandleScopeData* current = | 130 v8::ImplementationUtilities::HandleScopeData* current = |
131 isolate->handle_scope_data(); | 131 isolate->handle_scope_data(); |
132 | 132 |
133 current->next = prev_next; | 133 std::swap(current->next, prev_next); |
Michael Starzinger
2013/09/27 11:24:30
nit: Two white-spaces after comma.
| |
134 current->level--; | 134 current->level--; |
135 if (current->limit != prev_limit) { | 135 if (current->limit != prev_limit) { |
136 current->limit = prev_limit; | 136 current->limit = prev_limit; |
137 DeleteExtensions(isolate); | 137 DeleteExtensions(isolate); |
138 #ifdef ENABLE_EXTRA_CHECKS | |
139 ZapRange(current->next, prev_limit); | |
140 } else { | |
141 ZapRange(current->next, prev_next); | |
142 #endif | |
138 } | 143 } |
139 | |
140 #ifdef ENABLE_EXTRA_CHECKS | |
141 ZapRange(prev_next, prev_limit); | |
142 #endif | |
143 } | 144 } |
144 | 145 |
145 | 146 |
146 template <typename T> | 147 template <typename T> |
147 Handle<T> HandleScope::CloseAndEscape(Handle<T> handle_value) { | 148 Handle<T> HandleScope::CloseAndEscape(Handle<T> handle_value) { |
148 v8::ImplementationUtilities::HandleScopeData* current = | 149 v8::ImplementationUtilities::HandleScopeData* current = |
149 isolate_->handle_scope_data(); | 150 isolate_->handle_scope_data(); |
150 | 151 |
151 T* value = *handle_value; | 152 T* value = *handle_value; |
152 // Throw away all handles in the current scope. | 153 // Throw away all handles in the current scope. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 current->level = level_; | 207 current->level = level_; |
207 ASSERT_EQ(current->next, current->limit); | 208 ASSERT_EQ(current->next, current->limit); |
208 current->limit = limit_; | 209 current->limit = limit_; |
209 } | 210 } |
210 | 211 |
211 #endif | 212 #endif |
212 | 213 |
213 } } // namespace v8::internal | 214 } } // namespace v8::internal |
214 | 215 |
215 #endif // V8_HANDLES_INL_H_ | 216 #endif // V8_HANDLES_INL_H_ |
OLD | NEW |