#ifndef V8_COMPILER_NODE_AUX_DATA_H_
#define V8_COMPILER_NODE_AUX_DATA_H_
#include "src/compiler/node.h"
#include "src/zone/zone-containers.h"
namespace v8 {
namespace internal {
namespace compiler {
class Node;
template <class T>
T DefaultConstruct(Zone* zone) { … }
template <class T>
T ZoneConstruct(Zone* zone) { … }
template <class T, T def(Zone*) = DefaultConstruct<T>>
class NodeAuxData {
public:
explicit NodeAuxData(Zone* zone) : … { … }
explicit NodeAuxData(size_t initial_size, Zone* zone)
: … { … }
bool Set(Node* node, T const& data) { … }
bool Set(NodeId id, T const& data) { … }
T Get(Node* node) const { … }
T Get(NodeId id) const { … }
class const_iterator;
friend class const_iterator;
const_iterator begin() const;
const_iterator end() const;
private:
Zone* zone_;
ZoneVector<T> aux_data_;
};
template <class T, T def(Zone*)>
class NodeAuxData<T, def>::const_iterator { … };
template <class T, T def(Zone*)>
typename NodeAuxData<T, def>::const_iterator NodeAuxData<T, def>::begin()
const {
return typename NodeAuxData<T, def>::const_iterator(&aux_data_, 0);
}
template <class T, T def(Zone*)>
typename NodeAuxData<T, def>::const_iterator NodeAuxData<T, def>::end() const {
return typename NodeAuxData<T, def>::const_iterator(&aux_data_,
aux_data_.size());
}
template <class T, T kNonExistent>
class NodeAuxDataMap { … };
}
}
}
#endif