OLD | NEW |
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 // Transition diagram: | 204 // Transition diagram: |
205 // NORMAL <-> WEAK -> PENDING -> NEAR_DEATH -> { NORMAL, WEAK, DESTROYED } | 205 // NORMAL <-> WEAK -> PENDING -> NEAR_DEATH -> { NORMAL, WEAK, DESTROYED } |
206 enum State { | 206 enum State { |
207 NORMAL, // Normal global handle. | 207 NORMAL, // Normal global handle. |
208 WEAK, // Flagged as weak but not yet finalized. | 208 WEAK, // Flagged as weak but not yet finalized. |
209 PENDING, // Has been recognized as only reachable by weak handles. | 209 PENDING, // Has been recognized as only reachable by weak handles. |
210 NEAR_DEATH, // Callback has informed the handle is near death. | 210 NEAR_DEATH, // Callback has informed the handle is near death. |
211 DESTROYED | 211 DESTROYED |
212 }; | 212 }; |
213 State state_; | 213 State state_ : 4; // Need one more bit for MSVC as it treats enums as signed. |
214 | 214 |
215 private: | 215 private: |
216 // Handle specific callback. | 216 // Handle specific callback. |
217 WeakReferenceCallback callback_; | 217 WeakReferenceCallback callback_; |
218 // Provided data for callback. In DESTROYED state, this is used for | 218 // Provided data for callback. In DESTROYED state, this is used for |
219 // the free list link. | 219 // the free list link. |
220 union { | 220 union { |
221 void* parameter; | 221 void* parameter; |
222 Node* next_free; | 222 Node* next_free; |
223 } parameter_or_next_free_; | 223 } parameter_or_next_free_; |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 | 553 |
554 void GlobalHandles::RemoveObjectGroups() { | 554 void GlobalHandles::RemoveObjectGroups() { |
555 List<ObjectGroup*>* object_groups = ObjectGroups(); | 555 List<ObjectGroup*>* object_groups = ObjectGroups(); |
556 for (int i = 0; i< object_groups->length(); i++) { | 556 for (int i = 0; i< object_groups->length(); i++) { |
557 delete object_groups->at(i); | 557 delete object_groups->at(i); |
558 } | 558 } |
559 object_groups->Clear(); | 559 object_groups->Clear(); |
560 } | 560 } |
561 | 561 |
562 } } // namespace v8::internal | 562 } } // namespace v8::internal |
OLD | NEW |