mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
bugfix:bug in FastSuperAllocateThis,where newTarget should callruntime
issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I9PAFO Signed-off-by: hecunmao <hecunmao@huawei.com> Change-Id: Ief8218f84ea263398698583e0ee8751205678ac2
This commit is contained in:
parent
87c787bb4e
commit
9cc38e96c0
@ -1336,7 +1336,10 @@ GateRef NewObjectStubBuilder::FastSuperAllocateThis(GateRef glue, GateRef superC
|
||||
Label checkJSObject(env);
|
||||
Label callRuntime(env);
|
||||
Label newObject(env);
|
||||
|
||||
Label isFunction(env);
|
||||
|
||||
BRANCH(IsJSFunction(newTarget), &isFunction, &callRuntime);
|
||||
Bind(&isFunction);
|
||||
DEFVARIABLE(thisObj, VariableType::JS_ANY(), Undefined());
|
||||
DEFVARIABLE(protoOrHclass, VariableType::JS_ANY(), Undefined());
|
||||
protoOrHclass = Load(VariableType::JS_ANY(), newTarget,
|
||||
|
@ -383,6 +383,7 @@ group("ark_asm_test") {
|
||||
if (!is_debug) {
|
||||
release_test_list = [
|
||||
"asmstackoverflow",
|
||||
"supercallRelease",
|
||||
"multiconstpoolclass",
|
||||
"multiconstpoolconstructor",
|
||||
"multiconstpoolfunc",
|
||||
@ -548,6 +549,7 @@ group("ark_asm_single_step_test") {
|
||||
if (!is_debug) {
|
||||
release_test_list = [
|
||||
"asmstackoverflow",
|
||||
"supercallRelease",
|
||||
"multiconstpoolclass",
|
||||
"multiconstpoolconstructor",
|
||||
"multiconstpoolfunc",
|
||||
|
18
test/moduletest/supercallRelease/BUILD.gn
Normal file
18
test/moduletest/supercallRelease/BUILD.gn
Normal file
@ -0,0 +1,18 @@
|
||||
# Copyright (c) 2024 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_moduletest_action("supercallRelease") {
|
||||
deps = []
|
||||
}
|
14
test/moduletest/supercallRelease/expect_output.txt
Normal file
14
test/moduletest/supercallRelease/expect_output.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# Copyright (c) 2024 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.
|
||||
|
||||
super call test success!
|
36
test/moduletest/supercallRelease/supercallRelease.js
Normal file
36
test/moduletest/supercallRelease/supercallRelease.js
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2024 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @tc.name:supercall
|
||||
* @tc.desc:test supercall
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
|
||||
function f() {
|
||||
function f1() {
|
||||
}
|
||||
class C4 extends f1 {
|
||||
}
|
||||
const v = new Proxy(C4, {});
|
||||
new v();
|
||||
f();
|
||||
}
|
||||
try {
|
||||
f();
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
print("super call test success!");
|
Loading…
Reference in New Issue
Block a user