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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class GarbageCollected; | 46 class GarbageCollected; |
47 class HeapObjectHeader; | 47 class HeapObjectHeader; |
48 class InlinedGlobalMarkingVisitor; | 48 class InlinedGlobalMarkingVisitor; |
49 template <typename T> | 49 template <typename T> |
50 class TraceTrait; | 50 class TraceTrait; |
51 template <typename T> | 51 template <typename T> |
52 class TraceEagerlyTrait; | 52 class TraceEagerlyTrait; |
53 class ThreadState; | 53 class ThreadState; |
54 class Visitor; | 54 class Visitor; |
55 | 55 |
56 // The TraceMethodDelegate is used to convert a trace method for type T to a Tra
ceCallback. | 56 // The TraceMethodDelegate is used to convert a trace method for type T to a |
57 // This allows us to pass a type's trace method as a parameter to the Persistent
Node | 57 // TraceCallback. This allows us to pass a type's trace method as a parameter |
58 // constructor. The PersistentNode constructor needs the specific trace method d
ue an issue | 58 // to the PersistentNode constructor. The PersistentNode constructor needs the |
59 // with the Windows compiler which instantiates even unused variables. This caus
es problems | 59 // specific trace method due an issue with the Windows compiler which |
| 60 // instantiates even unused variables. This causes problems |
60 // in header files where we have only forward declarations of classes. | 61 // in header files where we have only forward declarations of classes. |
61 template <typename T, void (T::*method)(Visitor*)> | 62 template <typename T, void (T::*method)(Visitor*)> |
62 struct TraceMethodDelegate { | 63 struct TraceMethodDelegate { |
63 STATIC_ONLY(TraceMethodDelegate); | 64 STATIC_ONLY(TraceMethodDelegate); |
64 static void trampoline(Visitor* visitor, void* self) { | 65 static void trampoline(Visitor* visitor, void* self) { |
65 (reinterpret_cast<T*>(self)->*method)(visitor); | 66 (reinterpret_cast<T*>(self)->*method)(visitor); |
66 } | 67 } |
67 }; | 68 }; |
68 | 69 |
69 #define DECLARE_TRACE_IMPL(maybevirtual) \ | 70 #define DECLARE_TRACE_IMPL(maybevirtual) \ |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 return static_cast<Visitor*>(helper); | 351 return static_cast<Visitor*>(helper); |
351 } | 352 } |
352 | 353 |
353 ThreadState* m_state; | 354 ThreadState* m_state; |
354 const MarkingMode m_markingMode; | 355 const MarkingMode m_markingMode; |
355 }; | 356 }; |
356 | 357 |
357 } // namespace blink | 358 } // namespace blink |
358 | 359 |
359 #endif // Visitor_h | 360 #endif // Visitor_h |
OLD | NEW |