mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 16:13:49 +00:00
!4440 Bugfix: stp/ltp need 16 align
Merge pull request !4440 from linxiang8/master
This commit is contained in:
commit
b7074c1846
@ -747,13 +747,12 @@ void OptimizedCall::CallRuntimeWithArgv(ExtendedAssembler *assembler)
|
||||
Register sp(SP);
|
||||
// 2 : 2 means pair
|
||||
__ Stp(argc, argv, MemoryOperand(sp, -FRAME_SLOT_SIZE * 2, AddrMode::PREINDEX));
|
||||
__ Str(runtimeId, MemoryOperand(sp, -FRAME_SLOT_SIZE, AddrMode::PREINDEX));
|
||||
__ PushFpAndLr();
|
||||
__ Stp(Register(X30), runtimeId, MemoryOperand(sp, -FRAME_SLOT_SIZE * 2, AddrMode::PREINDEX));
|
||||
Register fp(X29);
|
||||
// construct leave frame
|
||||
Register frameType(X9);
|
||||
__ Mov(frameType, Immediate(static_cast<int64_t>(FrameType::LEAVE_FRAME_WITH_ARGV)));
|
||||
__ Str(frameType, MemoryOperand(sp, -FRAME_SLOT_SIZE, AddrMode::PREINDEX));
|
||||
__ Stp(frameType, Register(X29), MemoryOperand(sp, -FRAME_SLOT_SIZE * 2, AddrMode::PREINDEX));
|
||||
__ Add(Register(FP), sp, Immediate(FRAME_SLOT_SIZE));
|
||||
__ Str(fp, MemoryOperand(glue, JSThread::GlueData::GetLeaveFrameOffset(false)));
|
||||
|
||||
@ -766,9 +765,9 @@ void OptimizedCall::CallRuntimeWithArgv(ExtendedAssembler *assembler)
|
||||
__ Mov(X1, argc);
|
||||
__ Mov(X2, argv);
|
||||
__ Blr(rtfunc);
|
||||
__ Add(sp, sp, Immediate(FRAME_SLOT_SIZE));
|
||||
__ RestoreFpAndLr();
|
||||
__ Add(sp, sp, Immediate(3 * FRAME_SLOT_SIZE)); // 3 : 3 means pair
|
||||
__ Ldp(Register(Zero), Register(X29), MemoryOperand(sp, ExtendedAssembler::PAIR_SLOT_SIZE, POSTINDEX));
|
||||
__ Ldp(Register(X30), Register(Zero), MemoryOperand(sp, ExtendedAssembler::PAIR_SLOT_SIZE, POSTINDEX));
|
||||
__ Add(sp, sp, Immediate(2 * FRAME_SLOT_SIZE)); // 2 : 2 means pair
|
||||
__ Ret();
|
||||
}
|
||||
|
||||
|
@ -148,6 +148,7 @@ group("ark_aot_ts_test") {
|
||||
"not",
|
||||
"numberspeculativeretype",
|
||||
"optimization",
|
||||
"optimized_call",
|
||||
"or",
|
||||
"poplexenv",
|
||||
"proxy",
|
||||
|
19
test/aottest/optimized_call/BUILD.gn
Normal file
19
test/aottest/optimized_call/BUILD.gn
Normal file
@ -0,0 +1,19 @@
|
||||
# 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("optimized_call") {
|
||||
deps = []
|
||||
userDefinedMethodsInModule = true
|
||||
}
|
14
test/aottest/optimized_call/expect_output.txt
Normal file
14
test/aottest/optimized_call/expect_output.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# 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
|
28
test/aottest/optimized_call/optimized_call.ts
Normal file
28
test/aottest/optimized_call/optimized_call.ts
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
declare function print(arg:any):void;
|
||||
|
||||
function sum(a:number, b:number, c:number) {
|
||||
return a + b + c;
|
||||
}
|
||||
|
||||
const object = {
|
||||
apply: function(a:number, b:number, c:number) {
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
const proxy = new Proxy(sum, object);
|
||||
print(proxy(1, 2, 3));
|
Loading…
Reference in New Issue
Block a user