Commit Graph

35 Commits

Author SHA1 Message Date
songzhengchao 69ac5a27a9 Implement Prologue refactor and Add mulitple Optimized Frame In LLVM 12.0.1
1 refactor prologue reserve dynamic slots which is setted by LLVM IR
2 callsiteSp is calculated by current function's callee saved registers size
3 and Add mulitple Optimized Frame:
OPTIMIZED_JS_FUNCTION_FRAME:argv[n-1],..., argv[0], argc, ...., returnaddr, Fp, type. this frame need to visit args and stackmap.
OPTIMIZED_ASM_FRAME: jscall/jsentry construct frame which is implemented by assemble, this frame is only link to previou frame, it don't need to visit args and stackmap

4 stackmap support parse const pool and llvm patch add deopt interface LLVMBuildCall3

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5AJ9U
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ie6a0067169805cc6043ea94936dd578489b56c7b
2022-06-03 15:51:19 +08:00
luochuhao 7522f51989 Add multi-abc-file support in stub compiler and aot compiler and related adaptation.
Use methodId of func in pandafile as index for each aot func in llvmModule.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I598P5
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I9646d6a80c8138744ebbd617837550b4661f27d3
2022-05-29 16:59:27 +08:00
wupengyong b05717f366 reason:fix aarch64 align
description:add regular data
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I596LD?from=project-issue

Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: Ifd866150c327522b712f10d66772ddfdf17fe19e
2022-05-27 10:28:37 +08:00
sunzhe23 b492ef605f Fix some asm interpreter bug
description:
1 add align up for rodata section, incase movdqa crash
2 set gc leaf function attribute for no gc all
3 fix mega ic run slowpath bug for asm interpreter
4 remove trampoline unused code

issue: #I58VFA

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-05-24 19:36:38 +08:00
sunzhe23 e0bd313831 Support inline new for new lexical env
description:
1 implements new lexical by inline new
2 add rodata for aot code

issue: I57XRY

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-05-19 15:07:16 +08:00
wanyanglan 290f0d3844 Replace x64 call.S with x64 assembler
Replace JSFunctionEntry, OptimizedCallOptimized, CallNativeTrampoline,
OptimizedCallRuntime, JSCall, JSCallWithArgV assembly functions with
x86 assembler

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I55O8Y

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I1970a5bfd032530ad791b5c91b96d35f7be9ac14
2022-05-06 14:10:27 +08:00
luochuhao 86fda0792b Modify option source of stub compiler.
Using options in js runtime option list and delete stub compiler option.

Add path check for stub compiler generation phase.

Load stub file before loading of aot file.

Add runtime option for optimization level configuration.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I557Q2
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Ifbaa7a2dc4333310c62f1f8e230eefb7a2136ca5
2022-04-29 14:40:18 +08:00
ding 3a8bdd9f3b Fix genFp in BytecodeHandler Stub codegen
During modify compiler log, passing wrong genFp parameter in bc stub
codegen.

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I80008d07c807565e93d799b7e95d4e8e5d86c7c4
2022-04-16 16:14:13 +08:00
ding d8f0399789 Control whether to print compiler logs through JSRuntime Options
Add option log-compiled-methods to print the compiler(both stub and aot) in units of methods.

Add class CompilerLog.

Refactor some compiler logs.

Unie the log invoked way(COMPILER_LOG or COMPILER_OPTIONAL_LOG).

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I43ce61d0ba9d453713ab3e6349d07f6d9cde3e5e
2022-04-14 16:14:34 +08:00
sunzhe23 44d2430c3c Add x64 assembler
1 Implements x64 assembler
2 Add Asm code generator framework
3 Generating AsmInterCallRuntime with the x64 assembler

issue: #I52Ak6

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-13 22:01:24 -07:00
zhangyukun 9139ca09c7 Add dispatch of call of x64 and construct frame with rsp in .S
1. use stub to dispatch fast,slow and native paths
2. use rsp to construct frame of x64
https://gitee.com/openharmony/ark_js_runtime/issues/I51G9L?from=project-issue
Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Ib80540df5dbe531f155e5dd9fce556a207171494

Change-Id: I31e6705dd5555a0c2a9070a7ce73b26f77caef80
2022-04-07 14:32:38 +08:00
luochuhao bef0e1d1fd Adaptation for aot framework helloworld test.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4ZL8V
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I32bf175d4aea43dab2d408ea0347a14a4b5903cb
2022-04-02 15:29:44 +08:00
wengchangcheng 4f169b31a5 add -Werror -Wextra gn flag for 'compiler'
1. ignore llvm warning
2. fix warning of compiler module

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4ZHER

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I09774e431743a26ea366ed28e3276ff027ae0d31
2022-03-25 15:31:59 +08:00
luochuhao 8c6f8ef20d Implement aot file generated step for aot compiler
Implement llvmIRGeneration Pass in aot compiler pipeline.

Rename and reconstruct LLVMStubModule and LLVMModuleAssembler class. Move aot code infos
related to describe current (code size, begin addr, entry offset of each func etc.)  AOT
snippet and corresponding serialization/deserialization func to NEW class called AotCodeInfo.
Move functions related to file reading/writing to NEW class called AotFileManager.

Add new call opcode in circuit IR to differentiate call into common stubs and call into
runtime interfaces without GC.

Adapt js runtime option for above changes.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4ZDY5
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: If0ab5927ad2551fe5567d1c7b18540fbcc38bc15
2022-03-24 15:44:26 +08:00
wanyanglan b6e56d3c3f Clean Code For CodeHub Issues
Modified file permissions, word spelling errors, and
programming specifications suggesting EXPECT_EQ instead
of EXPECT_TRUE

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4YXK3

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I00eb9be48d481ce2bdaa4a621246ff6c405abecf
2022-03-22 11:34:13 +08:00
wuzhefeng aa44e06513 Fix compilation errors
Because there are some macros that trigger compilation errors when
compiling stub-compiler and aot-compiler. The root cause is that several
classes declarations are missing from the associated macros. This PR
fixes the issues via adding the lost classes to the macros. Besides, we
also rename the FastStub to CommonStubs in order to make the stub-arch
more readable.

Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4YKBN

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I16263fef7deeadf8a9ce4e5252a6e9898a7742bc
2022-03-18 18:17:21 -07:00
luochuhao c705ce054b Refactor ID definition and callSignature initialization mechanism of stubs
Refactor ID definition and callSignature initialization mechanism of runtime stub,
optimizer stub and bytecode handler stub,
reduce amount and complexity of macro used in calling those stubs.

Add stubDes struct to classify stubs both in AOT file generation phase
and AOT file loading phase.

Fix some circular dependency problems in including header files.

Fix certain inline function declaration and definition format problems, which could lead to
compiling errors.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4VMLD?from=project-issue
Test: stubTest(unit test), richards with asm interpreter enabled
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Ibd5fcd963347b97f8dec227f3245d2064463b0b0
2022-03-18 22:01:52 +08:00
songzhengchao abbdbd5716 delete patchpointid replace with return address
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I1a92f226571273e9ecdd713a378ad977a2f4667f
2022-03-08 15:46:54 +08:00
luochuhao 3384df5edb Add new Gate opcode: relocatable data and related llvm IR translation.
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4T3DT?from=project-issue
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I06b0a8d9da52f3197b50fcd9807f7f194502437d
2022-02-16 11:02:52 +08:00
wanyanglan 01a613ecac independent running ts aot
ts aot should be a separate part that needs to generate the
corresponding file before executing xxx.abc and should not
depend on the execution of xxx.abc

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4RP3H

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I4ed7d7ee5528dcb479e08486f332a48c16ea88d7
2022-01-26 15:22:50 +08:00
luochuhao a5fb8b1717 a)Using more accurate instruction matching logic in RewritePatchPointIdOfStatePoint,
b)make sure rewriteStatepoint pass run first
c)delete useless code.
d)gc related bug fix.

Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Iaf32c0cbe3c343aa1cbf499f3237844598076336
2022-01-07 13:15:21 +08:00
songzhengchao e198f24ced 1 review code
2 visit gc ptr by patchpoint instead of pc
3 contruct frame for aot

Change-Id: I98d1f8e39803ef7e1ac6c2f88e08d3254c6ef6af
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2022-01-01 11:17:09 +08:00
getingke 0b2bf052ce fixed for code style check
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I4a644610efc9e0689207818f07667e68e345552c
2021-12-23 17:32:43 +08:00
getingke c108665b1c fixed for add CompilationConfig Class to support all arch
Change-Id: Ifd5cbb143350ecb9c496d8c7cbc3ee3745e74399
Signed-off-by: getingke <getingke@huawei.com>
2021-12-23 15:00:19 +08:00
zhangyukun a97747fe18 Description:sync from code from wgr_master to ohos
Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Ic66a9e649de8c0ce530483296fe323b8f50621fb
2021-12-21 09:36:03 +08:00
songzhengchao 8b166ee59f Merge remote-tracking branch 'open/master' into gc_x86_2
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2021-10-29 16:42:01 +08:00
getingke bc69122046 increase base class FrameHandler for iterator stack frame
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I5643f176c169a2d3a754b6ead66698a0a8e33351
2021-10-28 16:28:40 +08:00
songzhengchao c4c4d68a4f code review
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2021-10-28 15:06:25 +08:00
getingke 371ff7fced fixed for code static check
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I537a1ece719508c0a78b0481a62f34896bb65f5c
2021-10-27 16:23:48 +08:00
getingke 839ad28e6a fixed for code static check
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I82acce47c83c72a2a9b0c316c4e339d5127e02f7
2021-10-27 16:22:43 +08:00
getingke 27a544bf56 fixed for review comment by wuzhefeng
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: Ie4b779dd73db792c4d8315ad3a051fb9692d0623
2021-10-27 16:22:43 +08:00
Han00000000 e8389db479 fix js opt bugs for ASAN
Signed-off-by: Han00000000 <jianghan2@huawei.com>
Change-Id: Ia058688171c00c190c74dbbc133a10ff4d5e5edc
2021-10-14 17:30:41 +08:00
Han00000000 064135d18a fix stub_aot_opt running errors and add arm/arm64 target for js
optimizer

Signed-off-by: Han00000000 <jianghan2@huawei.com>
Change-Id: Idb10d3dffbf79a7f615ccb3f8a468cd35caf73a0
2021-10-12 14:43:18 +08:00
getingke 7ff677936c fixed for review comments by wuzhefeng
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I5debcfcc4450fc22e33549911d8c557b2a671a35
2021-09-24 11:47:27 +08:00
getingke 13e4e9f5a8 rebase with master
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: Ib764c465916b0d8b34f298d04e462b81001d359e
2021-09-23 11:26:42 +08:00