Commit Graph

76 Commits

Author SHA1 Message Date
lichenshuai fcda5bb413 Add AsmInterpreterFrame
Add AsmInterpreterFrame for ASM.

Issue: #I4YF9X

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: I4efc781a9fca90de4a0aed5b6a91a8122cfa16ab
2022-03-30 10:51:05 +08:00
yingguofeng@huawei.com 2b48dab678 EmptyArray、EmptyTaggedQueue、EmptyLayoutInfo Move to GloblaEnvConstant.
When New class,It depends on EmptyLayoutInfo.So it must new EmptyLayoutInfo first.

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

Change-Id: I654ec61e7f3dc1ab55539dd64acba24489983107
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-03-25 11:05:13 +08:00
wengchangcheng 4804cd80d3 add Wextra and Werror in gn args
1. add -Wextra and -Werror to check code format error
2. modify all compiler error

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

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: If5fdd1980494269b4c06bf1bb38a8eba7952adea
2022-03-24 21:45:19 +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
DaiH 3e5c4da8c3 Change file folder "platform" to "tastpool"
Signed-off-by: DaiH <daihuina1@huawei.com>

1. Change file folder "platform" to "tastpool"
2. Change class "platform" to "tastpool"

https: //gitee.com/openharmony/ark_js_runtime/issues/I4Z7EU
Change-Id: Ife3f2a9e52a02e5046e3ccd936f1993aa225e908
2022-03-23 15:43:38 +08:00
openharmony_ci 2eeb9e88b3 !762 share constpool, and fix some codestyle
Merge pull request !762 from changcheng/fix_codestyle
2022-03-21 15:01:23 +00:00
wengchangcheng fbf3c4a035 share constpool, and modify some code refactor
1. cache constpool in ecma vm
2. use JSPandaFile instead of panda_file::File
3. make GenerateProgram as a static function
4. add a singleton of JSPandaFileManager::GetInstance()

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

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: Ic7ccd66764c3a020e575d4046e1792475d45be6b
2022-03-21 21:46:25 +08:00
xujie 479b7c3785 Clean Code For CodeHub Issues #96-#123 And #250-#264
According to the problems pointed out by the issuer and the
specifications compiled by Huawei, modify the non-compliant
parts of jsruntime.

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: Iceb771dfd9f3aa9017205068fc50ab1a63aae08b
2022-03-21 17:09:19 +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
wanyanglan fd4c928922 Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.

For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-15 11:02:40 +08:00
sunzhe23 57fe644984 refactor runtime trampoline id
Description:
add runtime_trace for runtime trampoline
mov runtime_trampolines.cpp info cmascript/trampoline/
rename FAST_STUB_ID as RUNTIME_CALL_ID

issue: #I4XBC9

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-11 02:17:24 -08:00
y00576111 a1796a573e EcmaScript Standard Module Implementation
Delete the existing module implementation and
re implement the module function according to the ECMA 2018 specification

issue: #I4NZQT [https://gitee.com/openharmony/ark_ts2abc/issues/I4NZQT]

Signed-off-by: y00576111 <yaojian16@huawei.com>
Change-Id: I8d381db7f8bf2f3d6b2a5c21cbc3cbab1aef0b9b
2022-03-10 19:10:42 +08:00
lengchangjing 48e2da7c31 Merge branch 'master' of https://gitee.com/leng-changjing/ark_js_runtime_option 2022-03-07 22:39:05 +08:00
lengchangjing eb86719436 Merge remote-tracking branch 'mother/master' 2022-03-07 20:55:58 +08:00
lengchangjing 99c0c94b20 Merge remote-tracking branch 'mother/master' 2022-03-07 20:52:59 +08:00
xiongluo cb55b5b6cd fix gc bug
Signed-off-by: xiongluo <xiongluo@huawei.com>
2022-03-06 17:58:44 -10:00
lengchangjing d8988764bc Merge remote-tracking branch 'mother/master' 2022-03-07 10:56:22 +08:00
openharmony_ci dfbff80e63 !687 fix jspandafile of framework file and aot info
Merge pull request !687 from changcheng/refactor_pandafile_and_nativepointer
2022-03-06 15:57:41 +00:00
lengchangjing fb1cf3cd96 Merge remote-tracking branch 'mother/master' 2022-03-04 21:26:36 +08:00
lengchangjing e2c971a8f9 change Class Ecma_VM's member options_ for multiple use
Description
  add a member of type JSRuntimeOptions
Related issue
  #I4W0M1:change Class Ecma_VM's member options_ for multiple use

Signed-off-by: lengchangjing <lengchangjing@huawei.com>
2022-03-04 21:01:43 +08:00
wengchangcheng 65ce5ee62d fix jspandafile of framework file and aot info
1. delete unused logic of framework pandafile
2. refactor native pointer callback
3. fix bug of generate aot info

https://gitee.com/openharmony/ark_js_runtime/issues/I4VSSL

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I3ba318a0bc2c0e95afff6473ff106bc8b5c9dfe4
2022-03-04 15:29:27 +08:00
scw 326b0140c9 move dfx feature to dfx dir
ISSUE:https://gitee.com/openharmony/ark_js_runtime/issues/I4SXXS

Signed-off-by: scw <suchongwei@huawei.com>
Change-Id: Ie5ae6a70f5b561b7578702db591affb26a0057d9
2022-03-04 10:52:47 +08:00
wengchangcheng 7c7b0e5097 fix actor bug
modify actor for app start

issue:https://gitee.com/openharmony/js_worker_module/issues/I4SMW8

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: Iad48f3173a963c4290701a708f41832359c88b02
2022-03-02 15:33:19 +08:00
y00576111 9eeef5be33 js pandafile refactor, support actor function
When the worker thread is started
the part shared by the virtual machine is not recreated
only the part that cannot be shared is created

issue:https://gitee.com/openharmony/js_worker_module/issues/I4SMW8

Signed-off-by: y00576111 <yaojian16@huawei.com>
Change-Id: I3c01588bb8449bd9cd8b410cfd13ff55205f41c1
2022-03-02 15:33:19 +08:00
panzhenyu1 17258d9872 Adapt for windows platform
related issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4VDA4
Change-Id: I4560cf0ec4c05ccd855debb51b6d0190b4f1ccfa
Signed-off-by: panzhenyu1 <panzhenyu1@huawei.com>
2022-03-02 11:22:58 +08:00
openharmony_ci 70b2803369 !605 Optimize call
Merge pull request !605 from 李晨帅/master
2022-02-26 09:47:54 +00:00
lichenshuai 4b3fbfa5c5 Optimize call
Currently, in the TSBenchmark of call, ark is still not as good as v8. So it needs to be optimized.

The way to set call frame is mainly optimized. After the optimization, fast path is executed when actual args is equal
to declared args. Call type, numVregs, numArgs, native flag are all stored in one field for further stub.

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
2022-02-26 11:53:40 +08:00
openharmony_ci 1394ded6c3 !496 Add runtime TS type system
Merge pull request !496 from DaiHN/merge_ts1
2022-02-22 12:51:44 +00: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
lifansheng b39418de15 issue:#I4P7EY
Reason: To support AOT compilation, add ts type system to provide some
    interfaces and struct to wrap ts type and help type infer

    Description: create the global class TSLoader to expose the external
    interfaces, create the TSType and it's derived class, TSClassType,
    TSClassInstanceType, TSImportType and so on to wrap ts type in runtime.

    Add TDD unitest.

Signed-off-by: lifansheng <lifansheng1@huawei.com>
2022-02-22 16:50:20 +08:00
dingwen 87e9f4ff3c Modify RegionFactory and Chunk
Description:Divide RegionFactory into HeapRegionAllocator and
NativeAreaAllocator,use ChunkVector replace some unreasonable CVector.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4TRB8

Signed-off-by: dingwen <dingwen6@huawei.com>
2022-02-21 15:22:01 +08:00
xiongluo 82b0916295 GC name is unclear and confused. class_ in object factory are redundant.
Modify gc name and delete class_ in object factory.

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

Signed-off-by: xiongluo <xiongluo@huawei.com>
2022-02-16 01:10:53 -10:00
yingguofeng@huawei.com 3ace067f87 GC performance optimization
1、Delete strategy no gc for start up
2、Adapter performance tools: runtime stat
3、Modify freeObjectKind to freeObjectSet

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

Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
Change-Id: I01643755057b6146d1f6b67032256e687873cd07
2022-02-15 14:24:21 +08:00
yingguofeng@huawei.com ef9b13734d Performance optimization for gc
1、Optimize GC parallel evacate strategy: evacuate to old space with FreeListAllocator.
2、Adjust strategy that whole region evacuate: Only support new fromspace to new tospace.
3、Adjust Semi space capacity growing/shrinking strategy and Adjust Semi space initialize size.

splay-benchmark:
blue zone: ark_js(2500), v8(2000)
ark-dev:  ark(1200), v8(1500)

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

Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
Change-Id: Ie9c6e94c47f531bf9c1ebf5bc7443dd1acb7d2ac
2022-02-15 14:23:43 +08:00
openharmony_ci 8589ba1d18 !553 shield workerxts TrimTask bug
Merge pull request !553 from 苏重威/master
2022-02-14 15:14:04 +00:00
scw b61922581c shield workerxts TrimTask bug
remove TrimNewSpaceLimitTask from EcmaVM Initialize

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

Signed-off-by: scw <suchongwei@huawei.com>
2022-02-14 19:22:47 +08:00
openharmony_ci 310ee5221f !490 support SuspendVM and output UncaughtException
Merge pull request !490 from 苏重威/master
2022-02-09 09:39:35 +00:00
scw 633e2ddbe8 support SuspendVM and output UncaughtException
Add VMNeedSuspension judge in CheckSafepoint and provide SuspendVM() ResumeVM() api in jsnapi to Suspend VM and Resume VM
Modify GetEcmaUncaughtException no longer clear exception and Add GetAndClearEcmaUncaughtException to get and clear exception

Issue I4SECM

Signed-off-by: scw <suchongwei@huawei.com>
2022-02-09 10:32:56 +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
linxiang 5820ca18a1 add ark trace
Signed-off-by: linxiang <linxiang8@huawei.com>
2022-01-20 19:11:24 +08:00
openharmony_ci c22e2930d1 !410 modify ACCESSOR for EcmaString and TaggedArray
Merge pull request !410 from changcheng/master
2022-01-17 10:34:20 +00:00
wengchangcheng 2bfd68c01a modify ACCESSOR for EcmaString and TaggedArray
Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I2995dc75ed34e8eb2bf249f2cced62ec9d91250e
2022-01-17 11:51:50 +08:00
jiangkai43 83811df4d5 Signed-off-by: jiangkai43 <jiangkai43@huawei.com>
modified heap file
2022-01-16 15:30:39 +08:00
jiangkai43 cda11eee19 Signed-off-by: jiangkai43 <jiangkai43@huawei.com>
add interface of heap
2022-01-16 14:33:58 +08:00
songzhengchao 2f03b1e898 Merge remote-tracking branch 'wzf/master'
Signed-off-by: songzhengchao <surpassgoodchao@qq.com>
Change-Id: I78f5da7fa16e75f70068508d04bd65c48afa798d
2022-01-15 16:18:18 +08:00
songzhengchao e45362e775 Merge branch 'master' of gitee.com:openharmony/ark_js_runtime
Signed-off-by: songzhengchao <wuzhefeng1@huawei.com>
Change-Id: I6e717b8532e6795174654ad50d633a41e85c4bcf
2022-01-14 22:46:13 -08:00
openharmony_ci 7c5726b5ec !284 Optimize GC trigger
Merge pull request !284 from xiongluo/gctrigger
2022-01-15 02:07:10 +00:00
openharmony_ci 8092816c94 !398 modify debugger events listener and support run debugger api test in device
Merge pull request !398 from changcheng/master
2022-01-14 08:39:53 +00:00