72 Commits

Author SHA1 Message Date
getingke d314d02335 fixed for proxy bug
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I6bd8842e81a7cce061190fff86345b98bb5b660e
2022-07-06 09:53:50 +08:00
g00416891 f11810349e New EcmaRuntimeCallInfo in stack pointer
Signed-off-by: g00416891 <guobingbing3@huawei.com>
Change-Id: I466a4107e6e073ffecea12e6986c112731d2d3bf
2022-07-05 14:54:43 +08:00
zhangyukun8 c041e23892 CpuProfiler adapt assembly-interpreter
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
2022-07-04 09:43:35 +08:00
xujie 690ca22d2a Support Lexenv In TSAOT
1. Support lexical env when running tsaot
2. fix getunmappedargs and copyrestargs bugs

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: Ia78ea4d89654d6924c0dee6f491cdf1e4fe718ee
2022-06-30 14:01:26 +08:00
ding c80c97bdfa Resolve Compatibility Issues between TSAOT and ECMA spec
1.Add typelowering framework.
2.Add newobjdynrange in typelowering which brings static TS type
  info to runtime phase.
3.Serialize and deserialize hclass table with snapshot, fix minor bugs
  in snapshot by the way.
4.Add IsFormTSTypeBit in HClass to distinguish hclasses which come from
  compile phase.
5.Fix compatibility issues in property operations api and some builints
  api.
6.Add 3 compatibility issues test cases.

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

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I98626e6eea01f4455ec818ba0ad872b3be98b729
2022-06-28 14:43:16 +08:00
ZhenyuPan 186ca3976d Fix compiling issue when compile SDK on MacOS
related issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5DRV5

Signed-off-by: ZhenyuPan <panzhenyu1@huawei.com>
Change-Id: I16ec64a1549305976d048a7c86f3eba2b140d8e8
2022-06-23 17:24:30 +08:00
lijincheng 9e3b4029bd Bugfixs for Copyrestargs, CallIRangeDyn, GetUnmappedArgs and ThrowIfNotObject
1.For callee func with variable-length arguments,Aot only receive the first one in variable-length arguments.
  So Change to get all args from OptimizedJsFunctionFrame in JsCall
2.Add path to get all args from OptimizedJsFunctionFrame to GetUnmappedArgs.
3.Fix ThrowIfNotObject error found in aottest case getiterator.ts
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I57L70

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-06-18 11:44:38 +08:00
openharmony_ci e54d519650 !1564 add stub for TypedArray
Merge pull request !1564 from xliu/string_optimize
2022-06-14 13:53:47 +00:00
xliu ecc409f326 add stub for TypedArray
Description
  1.add GetPrpertyByIndex stub for TypedArray.
  2.add GetPrpertyByName stub for TypedArray.
  3.add SetPrpertyByIndex stub for TypedArray.
  4.add SetPrpertyByName stub for TypedArray.
Issue:
  #I5BPJM:add stub for typedarray

Signed-off-by: xliu <liuxin259@huawei.com>
Change-Id: Ic76834e5224e4b03fa96e167a61c7c0c0c36940c
2022-06-14 20:59:43 +08:00
lichenshuai 581dc52613 Fix SingleStepDebugging Bug
Correct the offset of SingleStepDebugging. Return sp in JumpToCInterpreter instead of pc.

Issue: #I5BIJG

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: I1dcfab10b8244a874838434df8c1ea8935d71d84
2022-06-14 11:02:41 +08:00
sunzhe23 10ebc065d8 Support stackless callnew for asm interpreter
description:
1 use JSCallDispatch implments call new
2 refactor js common call

issue: I5AKJU

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-06-08 13:28:04 +08:00
wengchangcheng 9ea13c48f9 Descriptor: debugger refactor [ part-1 ]
details:
1. delete unused method
2. modify file dir
3. add event channel for every domain
4. implement domain function in agent and delete js_backend
5. modify dispatchTable to static
6. modify debugger_api
7. modify js_debugger and add debugger_executor
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I58LOO

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I7747bf3ad66e9a180d6179e45be5bcaf4161b29b
2022-06-01 23:00:13 +08:00
sunzhe23 372df16bd4 Refactor JSCall Dispatcher and implments asm getter/setter
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>
2022-05-30 16:14:30 +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
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
zhangyukun 9f15b59632 Fix 262 of rsp on x64
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
2022-05-23 18:42:48 +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
ding 36a1c21412 Fix aot newobjdynrange, Add relevant testcase, Some aot Refactor
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
2022-05-17 15:49:53 +08:00
zhangyukun ae2a7e5d9b exception handler supports rsp frame
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
2022-05-12 20:44:21 +08:00
lichenshuai 7b9a1aa1f7 Add new stackless stub
Add new stackless stub to syncronize asm interpreter with C interpreter.

Issue: #I54DXV

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ie6bef96e4ecd692d5a32a13eaa719859424c4b24
2022-05-11 09:09:09 +08:00
openharmony_ci 9075e30fa6 !1220 Link and update JSfunction and constpool info in aot execution phase.
Merge pull request !1220 from luochuhao/method
2022-05-09 08:16:50 +00:00
luochuhao 657e887afd Link and update JSfunction and constpool info in aot execution phase.
Remove unnecessary jsruntime option setting in CreateEcmaVMWithScope.

Tweak llvm lib path in ecmascript/compiler/tests/BUILD.gn.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I563DZ
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I740db8d7dd6d406adda05333edfff50bbc505cc6
2022-05-09 15:31:18 +08:00
openharmony_ci d46fd76e3a !1222 refactor asm Interpreted frame
Merge pull request !1222 from 孙哲/master
2022-05-09 06:34:37 +00:00
sunzhe23 c874c75894 Refactor asm interpreted frame
description:
1 remove macro ECMASCRIPT_COMPILE_ASM_INTERPRETER
2 add asm native frame type

issue: I569XH

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-05-08 20:40:24 -07:00
openharmony_ci e2da76d85b !1229 Fix Aot Ldfunction Case Bug
Merge pull request !1229 from 许杰/ldfunction_bugfix
2022-05-07 09:40:58 +00:00
xujie 9d0a24d52c Fix Aot Ldfunction Case Bug
1. Set CodeEntry for generator func.
2. Delete Interpreter Frame setup step for LowerDefineGeneratorFunc

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I5f12075d170c35c7f69d601d6f46502b4e653f1b
2022-05-07 16:45:20 +08:00
zhangyukun 25daaf26ef constuct entry frame of execute with rsp
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
2022-05-07 14:13:50 +08:00
lijincheng e328dded9f Add Aot Lowering CopyRestArgs
1.Add aot lowering for bytecode: COPYRESTARGS_PREF_IMM16
2.Add test case fot bytecode: COPYRESTARGS_PREF_IMM16

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-05-06 20:57:28 +08:00
xujie acfb4fba5b Fix Some Aot bugs About Env And GC
1.ify the way to get/set lexicalenv for Aot.
2.oved first interpreter entry frame

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I5fce320bba016d3f0ea71df4668b1e0121bd857f
2022-05-06 11:33:04 +08:00
guobingbing 129ebdbf25 refactor class FrameHandler
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I9f3ff0c04d34a31a34f21da637689eb61d4166f1
2022-05-04 10:36:44 +08:00
openharmony_ci 4002b645a0 !1140 bc lowering add case
Merge pull request !1140 from songzhengchao/code0426
2022-04-29 05:20:26 +00: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
openharmony_ci 913facca1b !1157 optimize asm interpreter performance
Merge pull request !1157 from zhangyukun8/optimize
2022-04-28 12:05:15 +00:00
zhangyukun 5632b517c9 optimize asm interpreter performance
Description:
1. add runtime stat scope to get the data of time-consuming-points
2. use stub to impl these runtime time-consuming-points
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I552ZB?from=project-issue

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I242b3ef8b4235d952aa32fda0d3d5b8ed2f8f776
2022-04-28 18:43:32 +08:00
sunzhe23 86a4019e1e BugFix for callNative's leave frame
description:
callNative build the wrong leave frame, witch will case gc crashed

issue: I55401

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-27 20:04:19 -07:00
openharmony_ci 87a2cee24e !1085 add asmInter Debugger
Merge pull request !1085 from wanghuan2022/master
2022-04-26 08:06:13 +00:00
wanghuan 4d249dcb87 add asmInter Debugger
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
2022-04-25 21:38:27 +08:00
luochuhao 90a5373327 First run of an TSAOT-define function Demo.
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
2022-04-25 12:00:12 +08:00
yingguofeng@huawei.com aeb8531377 Bitmap Refactor
Refactor the markbitmap used to mark objects and the rememberset used to record cross generational references

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

Change-Id: Icc4ac21219b5b7514b77291e436f79cf286515b2
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-04-22 10:28:36 +08:00
openharmony_ci 03a9443f03 !1036 Runtime architecture adjustment
Merge pull request !1036 from xliu/modif_runtime_core
2022-04-21 09:13:49 +00:00
openharmony_ci 7894dc6983 !1068 Refactor redundant code
Merge pull request !1068 from Gargoyle.h/wzfmaster-dev
2022-04-21 08:08:52 +00:00
lifansheng a725676a6c Runtime architecture adjustment
Description
  Cut out most of the initialization logic in Runtime::Create and disconnect the
  inheritance relationship of most classes such as JSThread.
Issue:
  #I53418: Runtime architecture adjustment

Signed-off-by: lifansheng <lifansheng1@huawei.com>
Change-Id: Ib9c1a40354f77d32e515e23334e7f4b4a4fa3259
2022-04-21 14:37:31 +08:00
sunzhe23 57ee6a7312 Optimize some runtime stub for asm interpreter
1 Set FindElementWithCache and Float as no GC runtime
2 Add SavePC for RuntimeCall if needed

issue: #I53PT7

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-20 03:10:30 -07:00
wuzhefeng a895d42213 [Refactor] refactor the code
There are some redundant code, such as runtime_api.h/cpp, which only
contains a method. Therefore, we can merge it to corresponding class and
remove these two files.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Ie4ae7c23fbedf15b53e8856d7455aa7c37afd1b3
2022-04-20 01:17:00 -07:00
getingke 39229d79c0 fixed for arm64 jscall
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I491578561614ced95073ee4b6975f8a917bebc6d
Signed-off-by: getingke <getingke@huawei.com>
2022-04-18 15:49:20 +08:00
songzhengchao 71dd7f53b9 refactor llvm_ir_builder.cpp call
bug fix OptimizedWithArgvLeaveFrameHandler::Iterate bug

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I52T6B?from=project-issue
Signed-off-by: songzhengchao <surpassgoodchao@qq.com>
2022-04-17 22:32:54 +08:00
songzhengchao e73e75786f Merge remote-tracking branch 'szc/proxy0413'
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I2a370b8803299c88109cbeb0f799acbdda53c2e9
2022-04-16 10:59:11 +08:00
guobingbing c01691c0bb entry frame adapter asm
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: Ied740af77e0f770e01f948c86b5f13d4877672ad
2022-04-15 18:23:40 +08:00
songzhengchao fb35927a32 Implement Proxy Lowering on x86
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
2022-04-15 16:39:42 +08:00
zhaozhibo 71f2d7e0eb Merge branch 'master' of gitee.com:openharmony/ark_js_runtime into master 2022-04-14 02:57:27 +00:00