Ignore:
Timestamp:
Sep 9, 2013, 10:10:19 AM (12 years ago)
Author:
[email protected]
Message:

Begin moving off of TypeTraits.h
https://bugs.webkit.org/show_bug.cgi?id=121006

Reviewed by Darin Adler.

Source/JavaScriptCore:

Convert uses of WTF type traits to STL type traits.

  • heap/PassWeak.h:
  • runtime/JSCell.h:

(JSC::jsCast):
(JSC::jsDynamicCast):

  • runtime/WriteBarrier.h:

(JSC::validateCell):

Source/WebKit2:

Convert uses of WTF type traits to STL type traits.

  • Platform/CoreIPC/ArgumentCoder.h:
  • Platform/CoreIPC/ArgumentCoders.h:
  • Platform/CoreIPC/ArgumentDecoder.h:
  • Platform/CoreIPC/ArgumentEncoder.h:
  • Platform/CoreIPC/Arguments.h:
  • Shared/API/c/WKSharedAPICast.h:

(WebKit::toImpl):

Source/WTF:

The C++11 has its own type traits implementation that is more complete and handles corner cases better
since it ties into the compiler. Begin switching uses of WTF type traits to STL type traits.

  • wtf/CheckedArithmetic.h:
  • wtf/HashTraits.h:
  • wtf/NeverDestroyed.h:
  • wtf/OwnPtr.h:
  • wtf/PassOwnPtr.h:

(WTF::adoptPtr):

  • wtf/RetainPtr.h:
Location:
trunk/Source/JavaScriptCore/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r154459 r155357  
    3232#include "WriteBarrier.h"
    3333#include <wtf/Noncopyable.h>
    34 #include <wtf/TypeTraits.h>
    3534
    3635namespace JSC {
     
    179178inline To jsCast(From* from)
    180179{
    181     ASSERT(!from || from->JSCell::inherits(WTF::RemovePointer<To>::Type::info()));
     180    ASSERT(!from || from->JSCell::inherits(std::remove_pointer<To>::type::info()));
    182181    return static_cast<To>(from);
    183182}
     
    186185inline To jsCast(JSValue from)
    187186{
    188     ASSERT(from.isCell() && from.asCell()->JSCell::inherits(WTF::RemovePointer<To>::Type::info()));
     187    ASSERT(from.isCell() && from.asCell()->JSCell::inherits(std::remove_pointer<To>::type::info()));
    189188    return static_cast<To>(from.asCell());
    190189}
     
    193192inline To jsDynamicCast(From* from)
    194193{
    195     return from->inherits(WTF::RemovePointer<To>::Type::info()) ? static_cast<To>(from) : 0;
     194    return from->inherits(std::remove_pointer<To>::type::info()) ? static_cast<To>(from) : 0;
    196195}
    197196
     
    199198inline To jsDynamicCast(JSValue from)
    200199{
    201     return from.isCell() && from.asCell()->inherits(WTF::RemovePointer<To>::Type::info()) ? static_cast<To>(from.asCell()) : 0;
     200    return from.isCell() && from.asCell()->inherits(std::remove_pointer<To>::type::info()) ? static_cast<To>(from.asCell()) : 0;
    202201}
    203202
  • trunk/Source/JavaScriptCore/runtime/WriteBarrier.h

    r154162 r155357  
    3131#include "Heap.h"
    3232#include "SamplingCounter.h"
    33 #include <wtf/TypeTraits.h>
    3433
    3534namespace JSC {
     
    5251template<class T> inline void validateCell(T cell)
    5352{
    54     ASSERT_GC_OBJECT_INHERITS(cell, WTF::RemovePointer<T>::Type::info());
     53    ASSERT_GC_OBJECT_INHERITS(cell, std::remove_pointer<T>::type::info());
    5554}
    5655
Note: See TracChangeset for help on using the changeset viewer.