arkcompiler_ets_runtime/ecmascript/platform/ecma_string_hash_helper.h
yinwuxx 2321c81e4f Increase the speed of hash and fix the bug of stringconcat
Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAQ005
Signed-off-by: yinwuxiao <yinwuxiao@huawei.com>
Change-Id: Ieb8dd31348c722dbd55d592df02673fe346d538a
2024-09-18 14:50:37 +08:00

39 lines
1.4 KiB
C++

/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ECMASCRIPT_PLATFORM_ECMA_STRING_HASH_HELPER_H
#define ECMASCRIPT_PLATFORM_ECMA_STRING_HASH_HELPER_H
#include <cstdint>
#include "ecmascript/platform/ecma_string_hash.h"
#ifdef PANDA_TARGET_ARM64
#include "ecmascript/platform/arm64/ecma_string_hash_internal.h"
#else
#include "ecmascript/platform/common/ecma_string_hash_internal.h"
#endif
namespace panda::ecmascript {
class EcmaStringHashHelper {
public:
template <typename T>
static uint32_t ComputeHashForDataPlatform(const T *data, size_t size,
uint32_t hashSeed)
{
return EcmaStringHashInternal::ComputeHashForDataOfLongString(data, size, hashSeed);
}
};
} // namespace panda::ecmascript
#endif // ECMASCRIPT_PLATFORM_ECMA_STRING_HASH_HELPER_H