2 rename glue type POINTER TO NATIVE_POINTER
3 when function need call another js function, it will lowering to call "JSCall" trampoline function
JSCall trampoline function will check calltarget function, then correct the arguments, finally jump
the native or optimized code address of the target function.
JSCall(glue, argc, calltarget, ....)
then proxy call(glue, argc, callTarget, argv[])
if proxy->GetHandler is function
tail call JSCall(glue, argc, callTarget, argv); // consider performance
else
//Call(trap, handler, «target, thisArgument, argArray»)
call CreateArrayFromList(glue, argc, argv[]) ---> arrHandle // maybe trigger GC, construct OptimizedWithArgvLeaveFrame, visitor argv[0]..argv[argc-1]
call JSCall(glue, argc, method, argv[])
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I52T6B?from=project-issue
Change-Id: I650ff10b35bc085ec81e7734ce35501ee23fbb62
when function need call another js function, it will lowering to call "JSCall" trampoline function
JSCall trampoline function will check calltarget function, then correct the arguments, finally jump
the native or optimized code address of the target function.
JSCall(glue, argc, calltarget, ....)
then proxy call(glue, argc, callTarget, argv[])
if proxy->GetHandler is function
tail call JSCall(glue, argc, callTarget, argv); // consider performance
else
//Call(trap, handler, «target, thisArgument, argArray»)
call CreateArrayFromList(glue, argc, argv[]) ---> arrHandle // maybe trigger GC, construct OptimizedWithArgvLeaveFrame, visitor argv[0]..argv[argc-1]
call JSCall(glue, argc, method, argv[])
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I52T6B?from=project-issue
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I994aae1eb9cbf51982348ae6e203c24c326f617e
Description
To ensure the high performance of container classes, Plainarray is
provided in ark.
Related issue
#I4XXYA:Add Container Plainarray
Signed-off-by: zhangjixing <zhangjixing4@huawei.com>
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
desc: shr should be unsigned right shift, and ashr should be signed right shift. But they are reversed. So modify them.
solu:
1. reverse shr and ashr handle
2. delete unused frameHandle
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5292O
Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: Ia329da8bf0ceaa80560601614b592bb448595a29
Add handle scope to avoid the large number of root nodes.
Remove unnecessary handles in the critical path.
Adjust the parameters in gc to avoid multiple consecutive Old GCs.
Signed-off-by: xiongluo <xiongluo@huawei.com>
Description
1. There are many kinds of interfaces to construct ecmastring from objectfactory
in the virtual machine, and the name is not clear, so it is complex to use;
2. Some of the unchecked interfaces are prone to errors during use. If there is
no compression where compression is required, unpredictable errors will occur.
Issue:
#I4ZL7X: ObjectFactory New Ecmastring Rectification
Signed-off-by: xliu <liuxin259@huawei.com>
Change-Id: I856f4e2e1df62823d928d738fa35affa97dbd3ed
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
Description
To ensure the high performance of container classes, Deque and Stack
is provided in ark.
Related issue
#I4X8GV:Add Container Deque And Stack
Signed-off-by: zhangjixing <zhangjixing4@huawei.com>
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
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
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
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
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
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
Change several structures for call stub.
Related issue: #I4XK12
Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ie7389ff96c619451304a3f0d352b271310c4b73e
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
This PR refactors the design of JSThread by introducing aligned struct,
which is more friendly for ASM-Interpreter and Compiler IRs. Meanwhile,
to facilitate debugging, a macro enable_bytrace is introduced to control
the lib dependencies of ark-js-runtime.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4X0TG
Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I56835deec5d372d7c827ded26544a87766f29002
Description
To ensure the high performance of container classes, Queue is provided in ark.
Related issue
#I4TKAU:Add Container Queue
Signed-off-by: chenqi <chenqi151@huawei.com>
Description:
a Use two Bridge function, "InvokeJSFunctionEntry" and "CallRuntimeTrampoline" to Adapter the calling convention of Aot JSFunction & Runtime Stub, then Construct the Entry Frame in "InvokeJSFunctionEntry", Leave Frame in "CallRuntimeTrampoline"
b modify LLVM Calling Conversion, prologue push callee-saved gpr registers --> callee-saved fp/simd/SVE regs --> prev_fp, prev_lr .finally update x29 pointer to prev_fp
issue:https://gitee.com/openharmony/ark_js_runtime/pulls/630
Change-Id: I1df498f411e03c9887c4cad97bf82371c0b5f01a
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
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>
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
add set thread current sp when leave aot frame
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I18813879c9512a91f7f38ae07b211190d2e6daed
Description
To ensure the high performance of container classes, ArrayList is provided in ark.
Related issue
#I4T65T:Add Container ArrayList
Signed-off-by: liuganlin <liuganlin@huawei.com>
Description
fix bugs of TryLdGlobalByName and LookupPropertyInlinedProps
Add test cases for global aeecssor.
Related issue
#I4TZT1: fix TryLdGlobalByName and LookupPropertyInlinedProps
Signed-off-by: xliu <liuxin259@huawei.com>
Change-Id: If4b78a136ed2299a1ae1848d8c248f5265996905