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

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

Issue 11959031: Add a new weak handle callback that passes an Isolate to an embedder (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Applied sven's comments Created 7 years, 11 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
« no previous file with comments | « src/api.cc ('k') | src/global-handles.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 // Make the global handle weak and set the callback parameter for the 121 // Make the global handle weak and set the callback parameter for the
122 // handle. When the garbage collector recognizes that only weak global 122 // handle. When the garbage collector recognizes that only weak global
123 // handles point to an object the handles are cleared and the callback 123 // handles point to an object the handles are cleared and the callback
124 // function is invoked (for each handle) with the handle and corresponding 124 // function is invoked (for each handle) with the handle and corresponding
125 // parameter as arguments. Note: cleared means set to Smi::FromInt(0). The 125 // parameter as arguments. Note: cleared means set to Smi::FromInt(0). The
126 // reason is that Smi::FromInt(0) does not change during garage collection. 126 // reason is that Smi::FromInt(0) does not change during garage collection.
127 void MakeWeak(Object** location, 127 void MakeWeak(Object** location,
128 void* parameter, 128 void* parameter,
129 WeakReferenceCallback callback); 129 WeakReferenceCallback callback);
130 void MakeWeak(Object** location,
131 void* parameter,
132 WeakHandleCallback callback);
130 133
131 void RecordStats(HeapStats* stats); 134 void RecordStats(HeapStats* stats);
132 135
133 // Returns the current number of weak handles. 136 // Returns the current number of weak handles.
134 int NumberOfWeakHandles(); 137 int NumberOfWeakHandles();
135 138
136 // Returns the current number of weak handles to global objects. 139 // Returns the current number of weak handles to global objects.
137 // These handles are also included in NumberOfWeakHandles(). 140 // These handles are also included in NumberOfWeakHandles().
138 int NumberOfGlobalObjectWeakHandles(); 141 int NumberOfGlobalObjectWeakHandles();
139 142
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 273
271 friend class Isolate; 274 friend class Isolate;
272 275
273 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); 276 DISALLOW_COPY_AND_ASSIGN(GlobalHandles);
274 }; 277 };
275 278
276 279
277 } } // namespace v8::internal 280 } } // namespace v8::internal
278 281
279 #endif // V8_GLOBAL_HANDLES_H_ 282 #endif // V8_GLOBAL_HANDLES_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698