diff --git a/ecmascript/deoptimizer/deoptimizer.cpp b/ecmascript/deoptimizer/deoptimizer.cpp index 47fd4373c4e90d415ebdcce0af11944071b66d9c..86714bc5ca19ced6f94c51d2c56f3f4e3660bae3 100644 --- a/ecmascript/deoptimizer/deoptimizer.cpp +++ b/ecmascript/deoptimizer/deoptimizer.cpp @@ -346,7 +346,9 @@ JSTaggedType Deoptimizier::ConstructAsmInterpretFrame(kungfu::DeoptType type) method->SetDeoptType(type); method->SetDeoptThreshold(--deoptThreshold); } else { - method->ClearAOTFlags(); + method->SetAotCodeBit(false); + method->SetDeoptType(kungfu::DeoptType::NOTCHECK); + method->SetCodeEntryOrLiteral(reinterpret_cast(nullptr)); } FrameWriter frameWriter(this); diff --git a/ecmascript/method.h b/ecmascript/method.h index 7263559b064fc8d825b1589ad8b506ae8eb90c43..a1be38ab24eab2c0899a837075ff441c54361945 100644 --- a/ecmascript/method.h +++ b/ecmascript/method.h @@ -369,13 +369,6 @@ public: SetCodeEntryOrLiteral(codeEntry); } - void ClearAOTFlags() - { - SetAotCodeBit(false); - SetDeoptType(kungfu::DeoptType::NOTCHECK); - SetCodeEntryOrLiteral(reinterpret_cast(nullptr)); - } - static constexpr size_t Size() { return sizeof(Method); diff --git a/ecmascript/stubs/runtime_stubs.cpp b/ecmascript/stubs/runtime_stubs.cpp index 57ea21f5a0201a965711fa0ed4584fa0aa5319ff..bb04ee69402fa803cad1ad0a09319fcc73e7456d 100644 --- a/ecmascript/stubs/runtime_stubs.cpp +++ b/ecmascript/stubs/runtime_stubs.cpp @@ -2152,12 +2152,7 @@ void RuntimeStubs::SaveFrameToContext(JSThread *thread, JSHandleSet(thread, i, value); } context->SetRegsArray(thread, regsArray.GetTaggedValue()); - JSTaggedValue function = frameHandler.GetFunction(); - Method *method = JSFunction::Cast(function.GetTaggedObject())->GetCallTarget(); - if (method->IsAotWithCallField()) { - method->ClearAOTFlags(); - } - context->SetMethod(thread, function); + context->SetMethod(thread, frameHandler.GetFunction()); context->SetThis(thread, frameHandler.GetThis()); BytecodeInstruction ins(frameHandler.GetPc()); diff --git a/test/deopttest/BUILD.gn b/test/deopttest/BUILD.gn index df0d1d43d94faa88e791c763de95f24fb31398f4..41fe60524494da844eef87bddc9066369788da5e 100644 --- a/test/deopttest/BUILD.gn +++ b/test/deopttest/BUILD.gn @@ -15,7 +15,6 @@ group("ark_deopt_test") { testonly = true test_list = [ "arithmetic", - "async_deopt", "comparison", "dec", "div", diff --git a/test/deopttest/async_deopt/BUILD.gn b/test/deopttest/async_deopt/BUILD.gn deleted file mode 100644 index 386301d29e19b41e3917686fb7c8a52b9a2a68d8..0000000000000000000000000000000000000000 --- a/test/deopttest/async_deopt/BUILD.gn +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2023 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. - -import("//arkcompiler/ets_runtime/test/test_helper.gni") - -host_aot_test_action("async_deopt") { - deps = [] -} diff --git a/test/deopttest/async_deopt/async_deopt.ts b/test/deopttest/async_deopt/async_deopt.ts deleted file mode 100644 index 5d9f5e2b50f45a18222596498972343730455841..0000000000000000000000000000000000000000 --- a/test/deopttest/async_deopt/async_deopt.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -// @ts-nocheck -declare function print(arg:any):string; -class A { - n: number = 2 -} - -class B { - m:number = 3 -} - -async function foo() { - A.prototype.o = 1 - let a = new A() - let r = await a.n // deopt before suspendgenerator - print(r) -} - -async function bar() { - B.prototype.o = 1 - let b = new B() - let r = await 1 - let c = b.m // deopt after suspendgenerator - print(c) - print(r) -} - -foo() -print('-----------------') -bar() diff --git a/test/deopttest/async_deopt/expect_output.txt b/test/deopttest/async_deopt/expect_output.txt deleted file mode 100644 index 4052352e72440c74b661d257430732c5fd188bee..0000000000000000000000000000000000000000 --- a/test/deopttest/async_deopt/expect_output.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2023 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. - ------------------ -2 -3 -1