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

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

Issue 19845007: wrap gc callbacks in handlescopes (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 | « no previous file | src/heap.cc » ('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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 Object** object = location(); 255 Object** object = location();
256 { 256 {
257 // Check that we are not passing a finalized external string to 257 // Check that we are not passing a finalized external string to
258 // the callback. 258 // the callback.
259 ASSERT(!object_->IsExternalAsciiString() || 259 ASSERT(!object_->IsExternalAsciiString() ||
260 ExternalAsciiString::cast(object_)->resource() != NULL); 260 ExternalAsciiString::cast(object_)->resource() != NULL);
261 ASSERT(!object_->IsExternalTwoByteString() || 261 ASSERT(!object_->IsExternalTwoByteString() ||
262 ExternalTwoByteString::cast(object_)->resource() != NULL); 262 ExternalTwoByteString::cast(object_)->resource() != NULL);
263 // Leaving V8. 263 // Leaving V8.
264 VMState<EXTERNAL> state(isolate); 264 VMState<EXTERNAL> state(isolate);
265 HandleScope handle_scope(isolate);
265 weak_reference_callback_(reinterpret_cast<v8::Isolate*>(isolate), 266 weak_reference_callback_(reinterpret_cast<v8::Isolate*>(isolate),
266 reinterpret_cast<Persistent<Value>*>(&object), 267 reinterpret_cast<Persistent<Value>*>(&object),
267 par); 268 par);
268 } 269 }
269 // Absence of explicit cleanup or revival of weak handle 270 // Absence of explicit cleanup or revival of weak handle
270 // in most of the cases would lead to memory leak. 271 // in most of the cases would lead to memory leak.
271 ASSERT(state() != NEAR_DEATH); 272 ASSERT(state() != NEAR_DEATH);
272 return true; 273 return true;
273 } 274 }
274 275
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 } 1012 }
1012 } 1013 }
1013 object_group_connections_.Clear(); 1014 object_group_connections_.Clear();
1014 object_group_connections_.Initialize(kObjectGroupConnectionsCapacity); 1015 object_group_connections_.Initialize(kObjectGroupConnectionsCapacity);
1015 retainer_infos_.Clear(); 1016 retainer_infos_.Clear();
1016 implicit_ref_connections_.Clear(); 1017 implicit_ref_connections_.Clear();
1017 } 1018 }
1018 1019
1019 1020
1020 } } // namespace v8::internal 1021 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698