From 68924c7f82d378ec0134403af86b7ddd4c57a060 Mon Sep 17 00:00:00 2001 From: wupengyong Date: Mon, 14 Nov 2022 11:47:55 +0800 Subject: [PATCH] reason:delete unused function description:delete unused function issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I60ZJX?from=project-issue Signed-off-by: wupengyong Change-Id: Ib3abed8378795a848850d4a1136f471a39fcbfa0 --- ecmascript/stubs/runtime_stubs.cpp | 196 ----------------------------- ecmascript/stubs/runtime_stubs.h | 19 --- 2 files changed, 215 deletions(-) diff --git a/ecmascript/stubs/runtime_stubs.cpp b/ecmascript/stubs/runtime_stubs.cpp index fdd6d18424..16e5cadf2e 100644 --- a/ecmascript/stubs/runtime_stubs.cpp +++ b/ecmascript/stubs/runtime_stubs.cpp @@ -121,12 +121,6 @@ DEF_RUNTIME_STUBS(CallInternalSetter) return JSTaggedValue::Undefined().GetRawData(); } -DEF_RUNTIME_STUBS(DebugBreak) -{ - RUNTIME_STUBS_HEADER(DebugBreak); - return JSTaggedValue::Undefined().GetRawData(); -} - DEF_RUNTIME_STUBS(Dump) { RUNTIME_STUBS_HEADER(Dump); @@ -465,30 +459,6 @@ DEF_RUNTIME_STUBS(InstanceOf) return RuntimeInstanceof(thread, obj, target).GetRawData(); } -DEF_RUNTIME_STUBS(FastStrictNotEqual) -{ - RUNTIME_STUBS_HEADER(FastStrictNotEqual); - JSTaggedValue left = GetArg(argv, argc, 0); // 0: means the zeroth parameter - JSTaggedValue right = GetArg(argv, argc, 1); // 1: means the first parameter - bool result = FastRuntimeStub::FastStrictEqual(left, right); - if (result) { - return JSTaggedValue::False().GetRawData(); - } - return JSTaggedValue::True().GetRawData(); -} - -DEF_RUNTIME_STUBS(FastStrictEqual) -{ - RUNTIME_STUBS_HEADER(FastStrictEqual); - JSTaggedValue left = GetArg(argv, argc, 0); // 0: means the zeroth parameter - JSTaggedValue right = GetArg(argv, argc, 1); // 1: means the first parameter - bool result = FastRuntimeStub::FastStrictEqual(left, right); - if (result) { - return JSTaggedValue::True().GetRawData(); - } - return JSTaggedValue::False().GetRawData(); -} - DEF_RUNTIME_STUBS(CreateGeneratorObj) { RUNTIME_STUBS_HEADER(CreateGeneratorObj); @@ -775,16 +745,6 @@ DEF_RUNTIME_STUBS(LdObjByIndex) return RuntimeLdObjByIndex(thread, obj, idx.GetInt(), callGetter.IsTrue(), receiver).GetRawData(); } -DEF_RUNTIME_STUBS(LdObjByValue) -{ - RUNTIME_STUBS_HEADER(LdObjByValue); - JSHandle obj = GetHArg(argv, argc, 0); // 0: means the zeroth parameter - JSHandle propKey = GetHArg(argv, argc, 1); // 1: means the first parameter - JSTaggedValue callGetter = GetArg(argv, argc, 2); // 2: means the second parameter - JSTaggedValue receiver = GetArg(argv, argc, 3); // 3: means the third parameter - return RuntimeLdObjByValue(thread, obj, propKey, callGetter.IsTrue(), receiver).GetRawData(); -} - DEF_RUNTIME_STUBS(StObjByIndex) { RUNTIME_STUBS_HEADER(StObjByIndex); @@ -886,25 +846,6 @@ DEF_RUNTIME_STUBS(Or2) return JSTaggedValue(res).GetRawData(); } -DEF_RUNTIME_STUBS(ResolveClass) -{ - RUNTIME_STUBS_HEADER(ResolveClass); - JSHandle ctor = GetHArg(argv, argc, 0); // 0: means the zeroth parameter - JSHandle literal = GetHArg(argv, argc, 1); // 1: means the first parameter - JSHandle base = GetHArg(argv, argc, 2); // 2: means the second parameter - JSHandle lexenv = GetHArg(argv, argc, 3); // 3: means the third parameter - return RuntimeResolveClass(thread, ctor, literal, base, lexenv).GetRawData(); -} - -DEF_RUNTIME_STUBS(CloneClassFromTemplate) -{ - RUNTIME_STUBS_HEADER(CloneClassFromTemplate); - JSHandle ctor = GetHArg(argv, argc, 0); // 0: means the zeroth parameter - JSHandle base = GetHArg(argv, argc, 1); // 1: means the first parameter - JSHandle lexenv = GetHArg(argv, argc, 2); // 2: means the second parameter - return RuntimeCloneClassFromTemplate(thread, ctor, base, lexenv).GetRawData(); -} - DEF_RUNTIME_STUBS(CreateClassWithBuffer) { RUNTIME_STUBS_HEADER(CreateClassWithBuffer); @@ -1113,14 +1054,6 @@ DEF_RUNTIME_STUBS(GetModuleNamespace) return RuntimeGetModuleNamespace(thread, localName).GetRawData(); } -DEF_RUNTIME_STUBS(GetModuleNamespaceOnJSFunc) -{ - RUNTIME_STUBS_HEADER(GetModuleNamespaceOnJSFunc); - JSTaggedValue localName = GetArg(argv, argc, 0); - JSTaggedValue jsFunc = GetArg(argv, argc, 1); - return RuntimeGetModuleNamespace(thread, localName, jsFunc).GetRawData(); -} - DEF_RUNTIME_STUBS(StModuleVarByIndex) { RUNTIME_STUBS_HEADER(StModuleVar); @@ -1149,16 +1082,6 @@ DEF_RUNTIME_STUBS(StModuleVar) return JSTaggedValue::Hole().GetRawData(); } -DEF_RUNTIME_STUBS(StModuleVarOnJSFunc) -{ - RUNTIME_STUBS_HEADER(StModuleVarOnJSFunc); - JSTaggedValue key = GetArg(argv, argc, 0); - JSTaggedValue value = GetArg(argv, argc, 1); - JSTaggedValue jsFunc = GetArg(argv, argc, 2); - RuntimeStModuleVar(thread, key, value, jsFunc); - return JSTaggedValue::Hole().GetRawData(); -} - DEF_RUNTIME_STUBS(LdLocalModuleVarByIndex) { RUNTIME_STUBS_HEADER(LdLocalModuleVarByIndex); @@ -1198,16 +1121,6 @@ DEF_RUNTIME_STUBS(LdModuleVar) return RuntimeLdModuleVar(thread, key, innerFlag).GetRawData(); } -DEF_RUNTIME_STUBS(LdModuleVarOnJSFunc) -{ - RUNTIME_STUBS_HEADER(LdModuleVarOnJSFunc); - JSTaggedValue key = GetArg(argv, argc, 0); - JSTaggedValue taggedFlag = GetArg(argv, argc, 1); - JSTaggedValue jsFunc = GetArg(argv, argc, 2); - bool innerFlag = taggedFlag.GetInt() != 0; - return RuntimeLdModuleVar(thread, key, innerFlag, jsFunc).GetRawData(); -} - DEF_RUNTIME_STUBS(GetPropIterator) { RUNTIME_STUBS_HEADER(GetPropIterator); @@ -1290,33 +1203,6 @@ DEF_RUNTIME_STUBS(ThrowTypeError) THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error.GetTaggedValue(), JSTaggedValue::Hole().GetRawData()); } -DEF_RUNTIME_STUBS(LdGlobalRecord) -{ - RUNTIME_STUBS_HEADER(LdGlobalRecord); - JSTaggedValue key = GetArg(argv, argc, 0); // 0: means the zeroth parameter - return RuntimeLdGlobalRecord(thread, key).GetRawData(); -} - -DEF_RUNTIME_STUBS(GetGlobalOwnProperty) -{ - RUNTIME_STUBS_HEADER(GetGlobalOwnProperty); - JSTaggedValue key = GetArg(argv, argc, 0); // 0: means the zeroth parameter - EcmaVM *ecmaVm = thread->GetEcmaVM(); - JSHandle globalEnv = ecmaVm->GetGlobalEnv(); - JSTaggedValue globalObj = globalEnv->GetGlobalObject(); - return FastRuntimeStub::GetGlobalOwnProperty(thread, globalObj, key).GetRawData(); -} - -DEF_RUNTIME_STUBS(TryLdGlobalByName) -{ - RUNTIME_STUBS_HEADER(TryLdGlobalByName); - JSHandle prop = GetHArg(argv, argc, 0); // 0: means the zeroth parameter - EcmaVM *ecmaVm = thread->GetEcmaVM(); - JSHandle globalEnv = ecmaVm->GetGlobalEnv(); - JSHandle globalObj(thread, globalEnv->GetGlobalObject()); - return RuntimeTryLdGlobalByName(thread, globalObj, prop).GetRawData(); // After checking not on global obj. -} - DEF_RUNTIME_STUBS(LoadMiss) { RUNTIME_STUBS_HEADER(LoadMiss); @@ -1357,14 +1243,6 @@ DEF_RUNTIME_STUBS(ThrowReferenceError) return RuntimeThrowReferenceError(thread, prop, " is not defined").GetRawData(); } -DEF_RUNTIME_STUBS(LdGlobalVar) -{ - RUNTIME_STUBS_HEADER(LdGlobalVar); - JSHandle global = GetHArg(argv, argc, 0); // 0: means the zeroth parameter - JSHandle prop = GetHArg(argv, argc, 1); // 1: means the first parameter - return RuntimeLdGlobalVarFromProto(thread, global, prop).GetRawData(); // After checked global itself. -} - DEF_RUNTIME_STUBS(LdGlobalICVar) { RUNTIME_STUBS_HEADER(LdGlobalICVar); @@ -1646,13 +1524,6 @@ DEF_RUNTIME_STUBS(CreateObjectWithBuffer) return RuntimeCreateObjectWithBuffer(thread, factory, argObj).GetRawData(); } -DEF_RUNTIME_STUBS(NewLexicalEnv) -{ - RUNTIME_STUBS_HEADER(NewLexicalEnv); - JSTaggedValue numVars = GetArg(argv, argc, 0); // 0: means the zeroth parameter - return RuntimeNewLexicalEnv(thread, static_cast(numVars.GetInt())).GetRawData(); -} - DEF_RUNTIME_STUBS(NewThisObject) { RUNTIME_STUBS_HEADER(NewThisObject); @@ -1832,26 +1703,6 @@ DEF_RUNTIME_STUBS(ThrowDerivedMustReturnException) return JSTaggedValue::Exception().GetRawData(); } -DEF_RUNTIME_STUBS(CallNative) -{ - RUNTIME_STUBS_HEADER(CallNative); - auto sp = const_cast(thread->GetCurrentInterpretedFrame()); - auto state = reinterpret_cast(sp) - 1; - // leave frame prev is prevSp now, change it to current sp - auto leaveFrame = const_cast(thread->GetLastLeaveFrame()); - OptimizedLeaveFrame *frame = OptimizedLeaveFrame::GetFrameFromSp(leaveFrame); - auto cachedFpValue = frame->callsiteFp; - frame->callsiteFp = reinterpret_cast(sp); - - Method *method = ECMAObject::Cast(state->function.GetTaggedObject())->GetCallTarget(); - EcmaRuntimeCallInfo *ecmaRuntimeCallInfo = reinterpret_cast(sp); - JSTaggedValue retValue = reinterpret_cast( - const_cast(method->GetNativePointer()))(ecmaRuntimeCallInfo); - frame->callsiteFp = cachedFpValue; - RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Exception().GetRawData()); - return retValue.GetRawData(); -} - DEF_RUNTIME_STUBS(LdBigInt) { RUNTIME_STUBS_HEADER(LdBigInt); @@ -1891,12 +1742,6 @@ DEF_RUNTIME_STUBS(OptGetUnmapedArgs) return RuntimeOptGetUnmapedArgs(thread, actualNumArgs.GetInt()).GetRawData(); } -DEF_RUNTIME_STUBS(OptGetLexicalEnv) -{ - RUNTIME_STUBS_HEADER(OptGetLexicalEnv); - return RuntimeOptGetLexEnv(thread).GetRawData(); -} - DEF_RUNTIME_STUBS(OptNewLexicalEnv) { RUNTIME_STUBS_HEADER(OptNewLexicalEnv); @@ -1968,37 +1813,6 @@ DEF_RUNTIME_STUBS(DebugAOTPrint) return JSTaggedValue::Undefined().GetRawData(); } -DEF_RUNTIME_STUBS(OptLdLexVar) -{ - RUNTIME_STUBS_HEADER(OptLdLexVar); - JSTaggedValue level = GetArg(argv, argc, 0); // 0: means the zeroth parameter - JSTaggedValue slot = GetArg(argv, argc, 1); // 1: means the first parameter - JSTaggedValue env = RuntimeOptGetLexEnv(thread); - for (int32_t i = 0; i < level.GetInt(); i++) { - JSTaggedValue taggedParentEnv = LexicalEnv::Cast(env.GetTaggedObject())->GetParentEnv(); - ASSERT(!taggedParentEnv.IsUndefined()); - env = taggedParentEnv; - } - return LexicalEnv::Cast(env.GetTaggedObject())->GetProperties(slot.GetInt()).GetRawData(); -} - -DEF_RUNTIME_STUBS(OptStLexVar) -{ - RUNTIME_STUBS_HEADER(OptStLexVar); - JSTaggedValue level = GetArg(argv, argc, 0); // 0: means the zeroth parameter - JSTaggedValue slot = GetArg(argv, argc, 1); // 1: means the first parameter - JSTaggedValue value = GetArg(argv, argc, 2); // 2: means the second parameter - JSTaggedValue env = RuntimeOptGetLexEnv(thread); - - for (int32_t i = 0; i < level.GetInt(); i++) { - JSTaggedValue taggedParentEnv = LexicalEnv::Cast(env.GetTaggedObject())->GetParentEnv(); - ASSERT(!taggedParentEnv.IsUndefined()); - env = taggedParentEnv; - } - LexicalEnv::Cast(env.GetTaggedObject())->SetProperties(thread, slot.GetInt(), value); - return JSTaggedValue::VALUE_HOLE; -} - DEF_RUNTIME_STUBS(JSObjectGetMethod) { RUNTIME_STUBS_HEADER(JSObjectGetMethod); @@ -2047,16 +1861,6 @@ DEF_RUNTIME_STUBS(StPatchVar) return RuntimeStPatchVar(thread, idx.GetInt(), value).GetRawData(); } -DEF_RUNTIME_STUBS(LdObjByName) -{ - RUNTIME_STUBS_HEADER(LdObjByName); - JSTaggedValue receiver = GetArg(argv, argc, 0); // 0: means the zeroth parameter - JSTaggedValue propKey = GetArg(argv, argc, 1); // 1: means the first parameter - bool callGetter = GetArg(argv, argc, 2).IsTrue(); - JSTaggedValue undefined = GetArg(argv, argc, 3); - return RuntimeLdObjByName(thread, receiver, propKey, callGetter, undefined).GetRawData(); -} - DEF_RUNTIME_STUBS(ContainerRBTreeForEach) { RUNTIME_STUBS_HEADER(ContainerRBTreeForEach); diff --git a/ecmascript/stubs/runtime_stubs.h b/ecmascript/stubs/runtime_stubs.h index 40e25269e0..7ca099a84a 100644 --- a/ecmascript/stubs/runtime_stubs.h +++ b/ecmascript/stubs/runtime_stubs.h @@ -111,7 +111,6 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(CallInternalSetter) \ V(CallGetPrototype) \ V(ThrowTypeError) \ - V(DebugBreak) \ V(Dump) \ V(GetHash32) \ V(ComputeHashcode) \ @@ -150,8 +149,6 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(Exp) \ V(IsIn) \ V(InstanceOf) \ - V(FastStrictEqual) \ - V(FastStrictNotEqual) \ V(CreateGeneratorObj) \ V(ThrowConstAssignment) \ V(GetTemplateObject) \ @@ -177,11 +174,8 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(LdSuperByValue) \ V(StSuperByValue) \ V(LdObjByIndex) \ - V(LdObjByValue) \ V(StObjByIndex) \ V(StOwnByIndex) \ - V(ResolveClass) \ - V(CloneClassFromTemplate) \ V(CreateClassWithBuffer) \ V(CreateClassWithIHClass) \ V(SetClassConstructorLength) \ @@ -191,17 +185,14 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(GetModuleNamespaceByIndex) \ V(GetModuleNamespaceByIndexOnJSFunc) \ V(GetModuleNamespace) \ - V(GetModuleNamespaceOnJSFunc) \ V(StModuleVarByIndex) \ V(StModuleVarByIndexOnJSFunc) \ V(StModuleVar) \ - V(StModuleVarOnJSFunc) \ V(LdLocalModuleVarByIndex) \ V(LdExternalModuleVarByIndex) \ V(LdLocalModuleVarByIndexOnJSFunc) \ V(LdExternalModuleVarByIndexOnJSFunc) \ V(LdModuleVar) \ - V(LdModuleVarOnJSFunc) \ V(Throw) \ V(GetPropIterator) \ V(AsyncFunctionEnter) \ @@ -210,16 +201,12 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(ThrowPatternNonCoercible) \ V(ThrowDeleteSuperProperty) \ V(Eq) \ - V(LdGlobalRecord) \ - V(GetGlobalOwnProperty) \ - V(TryLdGlobalByName) \ V(TryLdGlobalICByName) \ V(LoadMiss) \ V(StoreMiss) \ V(TryUpdateGlobalRecord) \ V(ThrowReferenceError) \ V(StGlobalVar) \ - V(LdGlobalVar) \ V(LdGlobalICVar) \ V(ToNumber) \ V(ToBoolean) \ @@ -240,7 +227,6 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(CopyRestArgs) \ V(CreateArrayWithBuffer) \ V(CreateObjectWithBuffer) \ - V(NewLexicalEnv) \ V(NewThisObject) \ V(NewObjRange) \ V(DefineFunc) \ @@ -255,7 +241,6 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(ThrowNonConstructorException) \ V(ThrowStackOverflowException) \ V(ThrowDerivedMustReturnException) \ - V(CallNative) \ V(CallSpread) \ V(DefineGetterSetterByValue) \ V(SuperCall) \ @@ -270,7 +255,6 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(OptGetUnmapedArgs) \ V(OptCopyRestArgs) \ V(NotifyBytecodePcChanged) \ - V(OptGetLexicalEnv) \ V(OptNewLexicalEnv) \ V(OptNewLexicalEnvWithName) \ V(OptSuspendGenerator) \ @@ -278,8 +262,6 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(GetTypeArrayPropertyByIndex) \ V(SetTypeArrayPropertyByIndex) \ V(OptPopLexicalEnv) \ - V(OptLdLexVar) \ - V(OptStLexVar) \ V(JSObjectGetMethod) \ V(DebugAOTPrint) \ V(GetMethodFromCache) \ @@ -292,7 +274,6 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, con V(StringEqual) \ V(LdPatchVar) \ V(StPatchVar) \ - V(LdObjByName) \ V(DeoptHandler) \ V(ContainerRBTreeForEach) -- Gitee