OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // Remove this once we remove RefPtrWillBeMember. | 312 // Remove this once we remove RefPtrWillBeMember. |
313 template<typename T> | 313 template<typename T> |
314 void trace(const RefPtr<T>&) | 314 void trace(const RefPtr<T>&) |
315 { | 315 { |
316 #if ENABLE(OILPAN) | 316 #if ENABLE(OILPAN) |
317 // RefPtrs should never be traced. | 317 // RefPtrs should never be traced. |
318 ASSERT_NOT_REACHED(); | 318 ASSERT_NOT_REACHED(); |
319 #endif | 319 #endif |
320 } | 320 } |
321 | 321 |
322 // Similarly, this trace method is to trace a RawPtrWillBeMember | |
323 // when ENABLE(OILPAN) is not enabled. | |
324 // Remove this once we remove RawPtrWillBeMember. | |
325 template<typename T> | |
326 void trace(const RawPtr<T>&) | |
327 { | |
328 #if ENABLE(OILPAN) | |
329 // RawPtrs should never be traced. | |
330 ASSERT_NOT_REACHED(); | |
331 #endif | |
332 } | |
333 | |
334 // This method marks an object and adds it to the set of objects | 322 // This method marks an object and adds it to the set of objects |
335 // that should have their trace method called. Since not all | 323 // that should have their trace method called. Since not all |
336 // objects have vtables we have to have the callback as an | 324 // objects have vtables we have to have the callback as an |
337 // explicit argument, but we can use the templated one-argument | 325 // explicit argument, but we can use the templated one-argument |
338 // mark method above to automatically provide the callback | 326 // mark method above to automatically provide the callback |
339 // function. | 327 // function. |
340 virtual void mark(const void*, TraceCallback) = 0; | 328 virtual void mark(const void*, TraceCallback) = 0; |
341 | 329 |
342 // Used to mark objects during conservative scanning. | 330 // Used to mark objects during conservative scanning. |
343 virtual void mark(HeapObjectHeader*, TraceCallback) = 0; | 331 virtual void mark(HeapObjectHeader*, TraceCallback) = 0; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 return visitor->isMarked(obj); | 531 return visitor->isMarked(obj); |
544 } | 532 } |
545 template<typename T> bool ObjectAliveTrait<Member<T> >::isAlive(Visitor* visitor
, const Member<T>& obj) | 533 template<typename T> bool ObjectAliveTrait<Member<T> >::isAlive(Visitor* visitor
, const Member<T>& obj) |
546 { | 534 { |
547 return visitor->isMarked(obj.get()); | 535 return visitor->isMarked(obj.get()); |
548 } | 536 } |
549 | 537 |
550 } | 538 } |
551 | 539 |
552 #endif | 540 #endif |
OLD | NEW |