OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // GarbageCollectedMixin because casting to it is potentially ambiguous. | 50 // GarbageCollectedMixin because casting to it is potentially ambiguous. |
51 template<typename T> | 51 template<typename T> |
52 struct IsGarbageCollectedMixin { | 52 struct IsGarbageCollectedMixin { |
53 typedef char TrueType; | 53 typedef char TrueType; |
54 struct FalseType { | 54 struct FalseType { |
55 char dummy[2]; | 55 char dummy[2]; |
56 }; | 56 }; |
57 | 57 |
58 #if COMPILER(MSVC) | 58 #if COMPILER(MSVC) |
59 template<typename U> static TrueType hasAdjustAndMark(char[&U::adjustAndMark
!= 0]); | 59 template<typename U> static TrueType hasAdjustAndMark(char[&U::adjustAndMark
!= 0]); |
60 template<typename U> static TrueType hasIsAlive(char[&U::isAlive != 0]); | 60 template<typename U> static TrueType hasIsHeapObjectAlive(char[&U::isHeapObj
ectAlive != 0]); |
61 #else | 61 #else |
62 template<size_t> struct F; | 62 template<size_t> struct F; |
63 template<typename U> static TrueType hasAdjustAndMark(F<sizeof(&U::adjustAnd
Mark)>*); | 63 template<typename U> static TrueType hasAdjustAndMark(F<sizeof(&U::adjustAnd
Mark)>*); |
64 template<typename U> static TrueType hasIsAlive(F<sizeof(&U::isAlive)>*); | 64 template<typename U> static TrueType hasIsHeapObjectAlive(F<sizeof(&U::isHea
pObjectAlive)>*); |
65 #endif | 65 #endif |
66 template<typename U> static FalseType hasIsAlive(...); | 66 template<typename U> static FalseType hasIsHeapObjectAlive(...); |
67 template<typename U> static FalseType hasAdjustAndMark(...); | 67 template<typename U> static FalseType hasAdjustAndMark(...); |
68 | 68 |
69 static bool const value = (sizeof(TrueType) == sizeof(hasAdjustAndMark<T>(0)
)) && (sizeof(TrueType) == sizeof(hasIsAlive<T>(0))); | 69 static bool const value = (sizeof(TrueType) == sizeof(hasAdjustAndMark<T>(0)
)) && (sizeof(TrueType) == sizeof(hasIsHeapObjectAlive<T>(0))); |
70 }; | 70 }; |
71 | 71 |
72 template <typename T> | 72 template <typename T> |
73 struct IsGarbageCollectedType { | 73 struct IsGarbageCollectedType { |
74 typedef char TrueType; | 74 typedef char TrueType; |
75 struct FalseType { | 75 struct FalseType { |
76 char dummy[2]; | 76 char dummy[2]; |
77 }; | 77 }; |
78 | 78 |
79 typedef typename WTF::RemoveConst<T>::Type NonConstType; | 79 typedef typename WTF::RemoveConst<T>::Type NonConstType; |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa
rbageCollectedType<T>::value> { | 1396 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa
rbageCollectedType<T>::value> { |
1397 }; | 1397 }; |
1398 | 1398 |
1399 template<typename T> | 1399 template<typename T> |
1400 struct ParamStorageTraits<RawPtr<T> > : public PointerParamStorageTraits<T*, bli
nk::IsGarbageCollectedType<T>::value> { | 1400 struct ParamStorageTraits<RawPtr<T> > : public PointerParamStorageTraits<T*, bli
nk::IsGarbageCollectedType<T>::value> { |
1401 }; | 1401 }; |
1402 | 1402 |
1403 } // namespace WTF | 1403 } // namespace WTF |
1404 | 1404 |
1405 #endif | 1405 #endif |
OLD | NEW |