#ifndef V8_OBJECTS_CASTING_H_
#define V8_OBJECTS_CASTING_H_
#include "include/v8-source-location.h"
#include "src/base/logging.h"
#include "src/objects/tagged.h"
namespace v8::internal {
template <typename To>
struct CastTraits;
template <typename T, typename U>
inline bool Is(Tagged<U> value) { … }
#ifdef DEBUG
#define INIT_SOURCE_LOCATION_IN_DEBUG …
#else
#define INIT_SOURCE_LOCATION_IN_DEBUG …
#endif
template <typename To, typename From>
inline Tagged<To> Cast(Tagged<From> value, const v8::SourceLocation& loc =
INIT_SOURCE_LOCATION_IN_DEBUG) { … }
template <typename To, typename From>
inline Tagged<To> Cast(const From& value, const v8::SourceLocation& loc =
INIT_SOURCE_LOCATION_IN_DEBUG) { … }
template <typename To, typename From>
inline Handle<To> Cast(Handle<From> value, const v8::SourceLocation& loc =
INIT_SOURCE_LOCATION_IN_DEBUG);
template <typename To, typename From>
inline MaybeHandle<To> Cast(
MaybeHandle<From> value,
const v8::SourceLocation& loc = INIT_SOURCE_LOCATION_IN_DEBUG);
#ifdef V8_ENABLE_DIRECT_HANDLE
template <typename To, typename From>
inline DirectHandle<To> Cast(
DirectHandle<From> value,
const v8::SourceLocation& loc = INIT_SOURCE_LOCATION_IN_DEBUG);
template <typename To, typename From>
inline MaybeDirectHandle<To> Cast(
MaybeDirectHandle<From> value,
const v8::SourceLocation& loc = INIT_SOURCE_LOCATION_IN_DEBUG);
#endif
template <typename To, typename From>
inline Tagged<To> UncheckedCast(Tagged<From> value) { … }
template <typename To, typename From>
inline Tagged<To> UncheckedCast(const From& value) { … }
template <typename T, typename U>
inline bool Is(Tagged<MaybeWeak<U>> value) { … }
CastTraits<MaybeWeak<T>>;
template <>
struct CastTraits<Object> { … };
template <>
struct CastTraits<Smi> { … };
template <>
struct CastTraits<HeapObject> { … };
}
#undef INIT_SOURCE_LOCATION_IN_DEBUG
#endif