Commit Graph

42 Commits

Author SHA1 Message Date
openharmony_ci b5b2e9aef9 !1216 fix codex warning
Merge pull request !1216 from hjzhangcm/master
2022-05-06 11:28:26 +00:00
hjzhangcm a760638caa fix codex warning
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-05-06 17:52:55 +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
openharmony_ci ff44193d07 !1171 Modify option source of stub compiler
Merge pull request !1171 from luochuhao/modifyoption
2022-04-30 00:57:37 +00: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
songzhengchao 9dd88414c1 BC Lowering test
bc: LDFUNCTION_PREF、STSUPERBYVALUE_PREF_V8_V8、LDSUPERBYVALUE_PREF_V8_V8、STCONSTTOGLOBALRECORD_PREF_ID32、STGLOBALVAR_PREF_ID32、DIV2DYN_PREF_V8
MOD2DYN_PREF_V8
EQDYN_PREF_V8
NOTEQDYN_PREF_V8
LESSDYN_PREF_V8
LESSEQDYN_PREF_V8
GREATERDYN_PREF_V8
GREATEREQDYN_PREF_V8
MUL2DYN_PREF_V8
SUB2DYN_PREF_V8
add bc lowering test

isssue:https://gitee.com/openharmony/ark_js_runtime/issues/I553HC?from=project-issue

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ibf7a1be6212e12ac81db2c30a0f687d92dee3b6f
2022-04-29 09:25:12 +08:00
yingguofeng@huawei.com 6c5808fc28 Delete useless code dependencies
To reduce 'libark_ jsruntime.so' ROM size, delete useless code dependencies.

https://gitee.com/openharmony/ark_js_runtime/issues/I541H4?from=project-issue

Profit: libark_jsruntime.so size reduce from 3455(kb) to 2001(kb)

Change-Id: Ie7430fca6f539c9baff1f4aae7942da6fc9ef135
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-04-24 18:02:32 +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
luochuhao 08b2c27a2a Add lowering of define function dyn.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I52KRX
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I3a798b2c4be13bf12eb77806d5a32dc5e83a7416
2022-04-16 14:48:10 +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
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
songzhengchao ede3113e23 Implement CallingConv to compatible with Fast-Stub/ASM-INT/AOT
1 Current ASM-INT(GHCC)/Fast-Stub(WebKit_jscc) set different FrameType to distinguish with CallingConv.It's more friendly to add callingConv flag in CallSignature class.
2 Fast-Stub/Aot CallingConv is WebKit_jscc while LLVM Backend don't support it on arm32. we'll add padding paramets to JS-Relative paramter is placed on stack.

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4ZYPN?from=project-issue

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I93df6c1d605692941b1aa362ad4e07a202d76241
2022-03-29 11:51:39 +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
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
wanghuan 68ab7992a7 feature:add asm handle disable range by option
description:add an option to control asm interpreter stub handle disable range in debug mode

reason:add an option to control asm interpreter stub handle disable range in debug mode

issue:https://gitee.com/open_harmony/dashboard?issue_id=I4XAXX

Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: Ie573a11be453f036cefb9d2eb000b84bb5007e6b
2022-03-16 14:32:47 +08:00
songzhengchao 9b6965c724 delete patchpointid replace with return address
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I1a92f226571273e9ecdd713a378ad977a2f4667f
2022-03-08 17:28:21 +08:00
getingke 0f19e0fff6 fixed for arm32 js frame rewrite patch id
issue:[Add JSFunction EntryFrame & LeaveFrame for arm32](https://gitee.com/openharmony/ark_js_runtime/issues/I4WRJP?from=project-issue)
Signed-off-by: getingke <getingke@huawei.com>

Change-Id: Icb8cf8d03b0321150ad1c066e001f398dc4bc78a
2022-03-08 11:08:10 +08:00
zhangyukun ad7195057a Sync code from c_asm_interpreter to master
Use Stub to impl handlers of bytecodes and use tail call to impl
dispatch of handlers of bytecodes

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I7afabdc40ddfa11345aa1029059514aa4f55b9f8
2022-02-22 17:01:18 +08:00
getingke a8d17968e1 fixed for compile error
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: Ia0a640d5dceb07faf18e8b383fde76fd272948f3
2022-02-21 17:13:33 +08:00
getingke 37a71fde93 fixed for rewrite patch id for runtime call
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: Ie4a76fb481a548d356450b79c55ed5d3c28b86b0
2022-02-21 15:32:29 +08:00
songzhengchao 955daf9a4c fixed for arm64 test mod.abc fastpath ok
rodate relate bug will to be fixed

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I32836bfa7a5ac501a80c995f51291a07511c981d
2022-02-18 12:35:59 +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 d5b0bbb5a0 code review: function rename and namespace
Change-Id: I40e81947ba3b51bb5e2dc1103a985889ca78dada
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2022-01-01 11:20:10 +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 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
luochuhao fee30ae738 Using standard iostream to replace fprintf.
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Ia17873679821b60f1d7693d5729254187cadefec
2021-11-12 11:48:44 +08:00
songzhengchao 0c38b6b94d code review
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2021-10-30 22:18:09 +08:00
songzhengchao baa25ddebe code review
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2021-10-30 17:09:06 +08:00
songzhengchao 31969332ab code review
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2021-10-30 14:59:00 +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
songzhengchao c4c4d68a4f code review
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2021-10-28 15:06:25 +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