constant_pool: Convert hashtype from tuple
to pair
This commit is contained in:
parent
befc22a61e
commit
e57bb0569a
2 changed files with 5 additions and 5 deletions
|
@ -21,7 +21,7 @@ ConstantPool::ConstantPool(BlockOfCode& code, size_t size)
|
|||
}
|
||||
|
||||
Xbyak::Address ConstantPool::GetConstant(const Xbyak::AddressFrame& frame, u64 lower, u64 upper) {
|
||||
const auto constant = std::make_tuple(lower, upper);
|
||||
const auto constant = std::make_pair(lower, upper);
|
||||
auto iter = constant_info.find(constant);
|
||||
if (iter == constant_info.end()) {
|
||||
ASSERT(static_cast<size_t>(current_pool_ptr - pool_begin) < pool_size);
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <bit>
|
||||
#include <tuple>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
#include <xbyak/xbyak.h>
|
||||
|
||||
|
@ -31,12 +31,12 @@ private:
|
|||
static constexpr size_t align_size = 16; // bytes
|
||||
|
||||
struct ConstantHash {
|
||||
std::size_t operator()(const std::tuple<u64, u64>& constant) const {
|
||||
return std::get<0>(constant) ^ std::rotl<u64>(std::get<1>(constant), 1);
|
||||
std::size_t operator()(const std::pair<u64, u64>& constant) const noexcept {
|
||||
return constant.first ^ std::rotl<u64>(constant.second, 1);
|
||||
}
|
||||
};
|
||||
|
||||
std::unordered_map<std::tuple<u64, u64>, void*, ConstantHash> constant_info;
|
||||
std::unordered_map<std::pair<u64, u64>, void*, ConstantHash> constant_info;
|
||||
|
||||
BlockOfCode& code;
|
||||
size_t pool_size;
|
||||
|
|
Loading…
Reference in a new issue