1.Handle the situation which constant gate is at the end of current block
2.Handle import/export in Multiple files for TSAOT
3.Handle try-catch-finally
4.Handle conditionJump with only one successor
5.Handle try block without instructions which can throw exception
6.Handle LoopBack Verify Error
7.Add UT case for try-catch-finally
8.Handle getModule Error in Aot compile
9.Handle block endwith Constant gate
10.Bugfix for NewObj returnValue Error when need to throw Exception
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5F6JT
Signed-off-by: lijincheng <lijincheng13@huawei.com>
desc: enable asm interpreter defaultly and fix ut bug
solu:
1.enable asm interpreter defaultly only in x64 or arm 64 and not win and mac
2.fix asm debugger because not check degugger mode
3.aot generate .m need disable asm-interpreter option
4.modify ut test
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5FMBF
Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I40cc54c12375eaac50f143de76e16422f5887571
Find bytecodes that leads to the difference between rsp frame and sp frame, then disable their SingleStepDebugging.
Issue: #I5EYDX
Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: I0731046f0b424817a6e463ee385d4203b0fe6244
1. Optimize the enumerableownpropertynames interface by adding cache;
2. Remove the number to string conversion of array iterator;
3. Share hclass of iterator result;
4. Share the return result of closeiterator;
5. Fix EnumerableOwnNames bugs.
6. Fix Array IteratorNext bugs.
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5G288
Signed-off-by: xliu <liuxin259@huawei.com>
Change-Id: Ie03278f0afed3cf7eb967dd92eac13c2fc0eeb4e
Context is not saved when processing SUSPENDGENERATOR and RESUMEGENERASTOR
instructions, and contextual execution cannot be restored.
1、Add SAVE_REGISTER HIR for saving context
2、RESTORE_REGISTER HIR for restoring context
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5B2QO
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I16b73390c6f7ae7c295f0aa1a9c9df538c2a4fec
details:
1. use hilog in ohos device
2. use panda logger in host
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5FR5J
Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I6f5de00751154bdb6aac3101515961a3a4432e80
1. lookup traces when a frame has not been constructed totally
2. update rbp before exit current frame
3. update leaveFrame_ before callngcruntime
4. fix bigint
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5ELOP?from=project-issue
Signed-off-by: zhangyukun8 <zhangyukun8@huawei.com>
Change-Id: I85bedde971436df9775d49fefd84b7375a65f564
Frame Handler directly operate frame(set
callsitesp/returnAddr/getPrevFrame,etc) which is hard to maintain.
Frames are operated by FrameIterator.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5CKVR?from=project-issue
Change-Id: Iba1c44c1ab1afec8b5bea0111f4e986b47cc8bc4
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
modify newobjDynrange to remove the flag "IsBuiltinsConstructor"
Signed-off-by: lifansheng <lifansheng1@huawei.com>
Change-Id: Ic94b8ba77a0ebaf121f2942238435a9da5917287
Correct the offset of SingleStepDebugging. Return sp in JumpToCInterpreter instead of pc.
Issue: #I5BIJG
Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: I1dcfab10b8244a874838434df8c1ea8935d71d84
The background of the problems is as follows:
1 Current iterator current Frame, visit previous Frame stackmap, it's hard to understand.
2 refactor llvm_stackmap_parser
3 refactor frameHandler, we should provider iterator to visit frame.
The solution of the problems is as follows:
1 FrameHandler Ietrator only visit current Frame stackmap
2 In the future, multiple vm may be existed such as multiple worker.while llvm_stackmap_parser is singleton which is not good, each vm should have one stackmap.
3. refactor frame add FrameIterator to visit frame
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5BSW4
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I65988624ef42a28788a5268d898e37ebf752c901
1. fix getthis on x64
2. adapt optimization of newobjdynrange on arm64
3. add bridge frame to support GC of setter and getter
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5BNC7?from=project-issue
Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I09c5fc89b2486d0b9988d9bef0af65f77dc2f684
In the future, multiple vm may be existed such as multiple worker.each
vm should have one stackmap, while llvm_stackmap_parser is singleton
which is not good.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5BSW4
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I7501c656f27a2fd34225928079f23a196e7f0bbf
------------------------------------------
1. Support CommonJS's module export function
2. Related test cases
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5590V
Signed-off-by: DaiH <daihuina1@huawei.com>
Change-Id: I18968f6a6b971fbe833d91ef98813964cc8292c9
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
Description
1.To ensure the high performance of container classes, List and LinkedList is provided in ark.
2.modify Copyright 2021->2022.
3.fix containers.
Related issue
#I58XA9:Add Containers List And LinkedList.
Signed-off-by: chenqi <chenqi151@huawei.com>
Rsp is used in future work, therefore .S file should be deleted.
Issue: #I5AGW3
Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ib1fb140d40d259bc4519fbf547857e5f80e9ee0c
description:
1 Refactor Call Dispatcher, and Regactor common call
2 use circuit IR implments getter/setter
issue: I59POB
Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
Add case when ECMASCRIPT_ENABLE_ASM_INTERPRETER_RSP_STACK is true and asm-interpreter is false.
Issue: #I59UEB
Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ib0eb125dfdc7e0cdc34109fe810efd48861d443c
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
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>
Description
To ensure the high performance of container classes, vector is
provided in ark.
Related issue
#I4XCD9:add container vector
Signed-off-by: shisan_forwork <chengjunxiong@huawei.com>
1. skip builtin frame and asm interpreter entry frame when upframe
2. skip push args when argc is 0
3. check thread exception, rather not ret value
4. deal with fp when entry Execute
5. deal with call class Constructor
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I58I4H?from=project-issue
Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I874f1437d5d21a8cf50a8d9ca73d7a92007f1bab
LeaveFrame is set in the frame chain when GeneratorReEnterInterpreter().
Issue: #I58L31
Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Iefe795fa255419eced137fb67da877924854f04a
Some TDD tests in ark_asm_test (e.g. asyncAsmAction) will fail in debug mode. This needs to be fixed.
Issue: #I58ESB
Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Iaf533876f8e69eef9695306bb295065eeb17bfba
1.Fix aot newobjdynrange by call JSFunction::Construct.
2.Add native new test case(new non-native constructor depends on
`defineclass`).
3.Add StackAssertScope in debug mode.
4.Delete retired `call` code in runtime_stubs.
5.Refactor GetArg from macros to inline function in RuntimeStubs.
Signed-off-by: ding <dingding5@huawei.com>
Change-Id: Ic89b98af11f2e2fc97aaeba1704d27a95d2c0c7b
The TDD asyncAsmAction will fail when run. It needs to be fixed.
Issue: #I57UY6
Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ie80755f9bc13d4fe1dd83d413ac71323c753b7f7
1.add lastFp_ into GlueData to restore rsp in exception handler
2.add AsmInterpreterEntryFrame to exit Execute when use rsp
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5733D?from=project-issue
Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Ia3c9301f3854b7d9cfb46dabbae82186b86348a3
1.Fix Andq error due to sign-extended of imm32
2.Enable asmInter option should be loaded before init stack
3.separate leave frame with interpreter frame
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I56IZ4?from=project-issue
Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I7bb4b5de71aab7dc8c6b657c70f97d738ebe1c2e
1. add fp to support discontinuous frame gc and resume rsp
2. assemble execute and impl entry frame with rsp
3. use assembler to refactor .s
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I52BQE?from=project-issue
Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I6966672dc065d63144fe7fa145ab76571189d540
The failure was due to SuperCall and FrameHandler modification at same
time. Need extra adapation.
Signed-off-by: ding <dingding5@huawei.com>
Change-Id: Id86614a694aa871f8a6ed43531b5b69059c453ba
Stackless refactor `supercall`, speed up it in some fast situation by
reducing re-enter interpreter.
Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I86154b5feeeac41c01699fa0797689e5c7d00e35
Extend fast-new with callType has NewTarget, to speed up calendar application.
Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I716c6992cf98e2835b1906c61d872ae3496d6db1
desc: move interpreter helper stubs from common stub to bc stub, beacuse these stubs' signatures are the same and need not construct frame pointer like bc stub.
solu:
1. delete old helper stub define in common stub, and add new helper stub define in bc stub.
2. add new targetKind in CallSignature to distinguish helper and normal stub in loading stub.
3. delete argc in stub define.
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I556K1
Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I46224e4568b45794aa1bac97682afc41696d5faa
1. make bytecodeArraySize, hotnessCounter, methodId, slotSize into one field methodField.
2. change the interpreter_stub to fit the hotness counter in jsmethod.
3. fix the fail problem of mem controller test.
4. Adjust the timeout value of uinittest
Signed-off-by: xiongluo <xiongluo@huawei.com>
desc: add asmInter debugger to support ide debug.
solu:
1.add bc debugger stub entry;
2.check is or not debug mode in runInternal and switch release to debug or debug to release.
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I53Z4V
Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I3f61bed8b4e17c43d22b5e6f103fe897cd8b41c1
description:
Add SaveCurrentFrame for interpreter handler call stub and
get get callsite sp when gc run
issue: I54IMV
Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
Description
Update the value of ACC to the value returned by reject
Issue:
#I54KKQ:Fix Asyncfunction Reject
Signed-off-by: xliu <liuxin259@huawei.com>
Change-Id: Ie4916e08091d31002f581d5f0c4e80d11fb2cbe6
Record idx in const pool of aot function in llvmmodule and aotcodeinfo.
Tweak code in circuit builder for slowpath lowering scenario where
constpool is null.
New JSFunction object for main function in AOT file and new JSFunction object
for each defined function in lowerDefineFuncDyn.
Fix bug in call.S after JSMethod refactor.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I545X0
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Ie6448f8740caddf79c3b9ed3385ba5739c7eb76b
1. Move necessary fileds in jsMethod
2. Make jsMethod inherit aligned struct
3. Change some function names for easy reading
Signed-off-by: xiongluo <xiongluo@huawei.com>
Set leave frame to nullptr before Execute() and restore it after that to avoid endless loop.
Issue: #I53HAD
Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ib9504519c33932d4e0c7b0ad4a5a599a5564cbe0
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>