chromium/v8/src/compiler/heap-refs.h

// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_COMPILER_HEAP_REFS_H_
#define V8_COMPILER_HEAP_REFS_H_

#include <optional>
#include <type_traits>

#include "src/ic/call-optimization.h"
#include "src/objects/elements-kind.h"
#include "src/objects/feedback-vector.h"
#include "src/objects/instance-type.h"
#include "src/objects/object-list-macros.h"
#include "src/utils/boxed-float.h"
#include "src/zone/zone-compact-set.h"

namespace v8 {

class CFunctionInfo;

namespace internal {

class BytecodeArray;
class FixedDoubleArray;
class FunctionTemplateInfo;
class HeapNumber;
class InternalizedString;
class JSBoundFunction;
class JSDataView;
class JSGlobalProxy;
class JSTypedArray;
class NativeContext;
class ScriptContextTable;
template <typename>
class Signature;

namespace interpreter {
class Register;
}  // namespace interpreter

namespace wasm {
class ValueType;
struct WasmModule;
}  // namespace wasm

compiler  // namespace compiler

template <typename T>
struct ZoneCompactSetTraits<T, std::enable_if_t<compiler::is_ref<T>::value>> {
  using handle_type = T;
  using data_type = compiler::ObjectData;

  static data_type* HandleToPointer(handle_type handle) {
    return handle.data();
  }
  static handle_type PointerToHandle(data_type* ptr) {
    return handle_type(ptr);
  }
};

namespace compiler {

ZoneRefSet;

inline bool AnyMapIsHeapNumber(const ZoneRefSet<Map>& maps) {}

inline bool AnyMapIsHeapNumber(const base::Vector<const MapRef>& maps) {}

}  // namespace compiler

}  // namespace internal
}  // namespace v8

#endif  // V8_COMPILER_HEAP_REFS_H_