Date: Sun Nov 5 10:33:47 2023 +0800

Revert "Reason:add FindElementWithCache IR"

    Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I8DV3U

    This reverts commit b50494ca31c75232fcd42147c2608dfb96f40cde.

    Change-Id: Ife5c0725cc7127e07ec9918d81b9f698f8e78c5d

Signed-off-by: Zhenyu Pan <panzhenyu1@huawei.com>
Change-Id: If89611c6211b2026d5f0510de9732c1ffb469fbe
This commit is contained in:
Zhenyu Pan 2023-11-05 12:08:49 +08:00
parent 8c46634316
commit 4b731e210f
3 changed files with 11 additions and 10 deletions

View File

@ -1020,8 +1020,8 @@ GateRef CircuitBuilder::GetHashcodeFromString(GateRef glue, GateRef value)
Branch(Int32Equal(*hashcode, Int32(0)), &noRawHashcode, &exit);
Bind(&noRawHashcode);
{
hashcode =
CallNGCRuntime(glue, RTSTUB_ID(ComputeHashcode), Gate::InvalidGateRef, { value }, Circuit::NullGate());
hashcode = GetInt32OfTInt(
CallRuntime(glue, RTSTUB_ID(ComputeHashcode), Gate::InvalidGateRef, { value }, Circuit::NullGate()));
Store(VariableType::INT32(), glue, value, IntPtr(EcmaString::MIX_HASHCODE_OFFSET), *hashcode);
Jump(&exit);
}

View File

@ -158,6 +158,14 @@ DEF_RUNTIME_STUBS(GetHash32)
return JSTaggedValue(static_cast<uint64_t>(result)).GetRawData();
}
DEF_RUNTIME_STUBS(ComputeHashcode)
{
JSTaggedType ecmaString = GetTArg(argv, argc, 0); // 0: means the zeroth parameter
auto string = reinterpret_cast<EcmaString *>(ecmaString);
uint32_t result = EcmaStringAccessor(string).ComputeHashcode();
return JSTaggedValue(static_cast<uint64_t>(result)).GetRawData();
}
void RuntimeStubs::PrintHeapReginInfo(uintptr_t argGlue)
{
auto thread = JSThread::GlueToJSThread(argGlue);
@ -2715,12 +2723,6 @@ void RuntimeStubs::EndCallTimer(uintptr_t argGlue, JSTaggedType func)
callTimer->StopCount(method);
}
uint32_t RuntimeStubs::ComputeHashcode(JSTaggedType ecmaString)
{
auto string = reinterpret_cast<EcmaString *>(ecmaString);
return EcmaStringAccessor(string).ComputeHashcode();
}
int32_t RuntimeStubs::StringGetStart(bool isUtf8, EcmaString *srcString, int32_t length, int32_t startIndex)
{
DISALLOW_GARBAGE_COLLECTION;

View File

@ -127,7 +127,6 @@ using FastCallAotEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, co
V(StartCallTimer) \
V(EndCallTimer) \
V(BigIntSameValueZero) \
V(ComputeHashcode) \
V(JSHClassFindProtoTransitions) \
V(NumberHelperStringToDouble) \
V(LocaleCompareNoGc) \
@ -142,6 +141,7 @@ using FastCallAotEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, co
V(CallGetPrototype) \
V(ThrowTypeError) \
V(GetHash32) \
V(ComputeHashcode) \
V(GetTaggedArrayPtrTest) \
V(NewInternalString) \
V(NewTaggedArray) \
@ -425,7 +425,6 @@ public:
static JSTaggedValue RuntimeArraySort(JSThread *thread, JSHandle<JSTaggedValue> thisHandle);
static JSTaggedValue CallBoundFunction(EcmaRuntimeCallInfo *info);
static uint32_t ComputeHashcode(JSTaggedType ecmaString);
static int32_t StringGetStart(bool isUtf8, EcmaString *srcString, int32_t length, int32_t startIndex);
static int32_t StringGetEnd(bool isUtf8, EcmaString *srcString, int32_t start, int32_t length, int32_t startIndex);