OLD | NEW |
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void Destroy(Object** location); | 119 void Destroy(Object** location); |
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 weak_reference_callback, |
| 130 NearDeathCallback near_death_callback); |
130 | 131 |
131 void RecordStats(HeapStats* stats); | 132 void RecordStats(HeapStats* stats); |
132 | 133 |
133 // Returns the current number of weak handles. | 134 // Returns the current number of weak handles. |
134 int NumberOfWeakHandles(); | 135 int NumberOfWeakHandles(); |
135 | 136 |
136 // Returns the current number of weak handles to global objects. | 137 // Returns the current number of weak handles to global objects. |
137 // These handles are also included in NumberOfWeakHandles(). | 138 // These handles are also included in NumberOfWeakHandles(). |
138 int NumberOfGlobalObjectWeakHandles(); | 139 int NumberOfGlobalObjectWeakHandles(); |
139 | 140 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 275 |
275 friend class Isolate; | 276 friend class Isolate; |
276 | 277 |
277 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); | 278 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); |
278 }; | 279 }; |
279 | 280 |
280 | 281 |
281 } } // namespace v8::internal | 282 } } // namespace v8::internal |
282 | 283 |
283 #endif // V8_GLOBAL_HANDLES_H_ | 284 #endif // V8_GLOBAL_HANDLES_H_ |
OLD | NEW |