Commit Graph

123 Commits

Author SHA1 Message Date
wuzhefeng
6002abbef1 Implement debug information framework (Part-3)
To faciliate aot debuggging, we need to provide the ability of code
commenting, so we will add api of adding debug-information to our gate
compilation framework and pass the information to LLVM-IR. At last, the
generated machine code can be associated with specific code comments.

Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I6VRHQ

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I6a1eef5588231f3aa31cc6b2efea9667d0eda929
2023-04-26 14:19:53 +08:00
g00416891
fa5b47c71a Explicit only works on single-argument constructor
Signed-off-by: g00416891 <guobingbing3@huawei.com>
Change-Id: Ia9bfc1e905962127d2afea6adb21704d4f0cd6d0
2023-01-03 11:06:16 +08:00
sunzhe23
238bd07b97 Refactor StubBuilder
Add stub.h to initialize circuit, a stub build can be created for multiple times

issue: #I5INN2

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-07-25 11:14:41 +08:00
sunzhe23
1783bf0e05 Refactor compiler Stub (part-2)
rename Stub to StubBuilder

issue: #I5IDQB

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-07-22 10:48:37 +08:00
sunzhe23
0a8a6a35ab Refactor compiler Stub (part-1)
add InitializeArguments for arguments initialize
use marco create common stub class

issue: #I5I0ET

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-07-21 09:51:36 +08:00
wuzhefeng
9e575f3a0a Refactor class Circuit's Public Interfaces (part-2)
To make the architecture more clear, any operations of Gates should be
performed via GateAccessor rather than inovking the low-level interfaces
of class Circuit. Therefore, most of these low level interfaces will be
decorated with private, which are only allowed to access by the closed
friend classes Verify and GateAccessor.

Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5HYU4

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Ied02743ee88b71d287bcfd1013487781e7adba6e
2022-07-20 02:29:42 -07:00
zhangyukun8
abf89ef083 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
wupengyong
c7cfbf050e reason:fix IntBuildTaggedWithNoGC
description:use SExtInt32ToInt64
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5EITG?from=project-issue

Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: I8374ffd008013bcfb9ed3d0b4030b7a0c9327720
2022-06-28 16:16:35 +08:00
openharmony_ci
90ebfae1d8
!1587 modify newobjDynrange to remove the flag "IsBuiltinsConstructor"
Merge pull request !1587 from fanshengli/newObj
2022-06-16 04:08:06 +00:00
openharmony_ci
c6890e11bd
!1595 fix SetPropertyByValueWithOwn handler
Merge pull request !1595 from wpy111/master
2022-06-16 02:57:01 +00:00
wupengyong
c5b6265496 reason:fix SetPropertyByValueWithOwn handler
description:add InterpreterSetPropertyByValueWithOwn GHCcall
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5CACE?from=project-issue

Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: Ifdf8695f3318a67ddb3d2d10e859b5f55c2486a8
2022-06-16 10:15:29 +08:00
lifansheng
0226887986 issue:I5C5EG
modify newobjDynrange to remove the flag "IsBuiltinsConstructor"

Signed-off-by: lifansheng <lifansheng1@huawei.com>
Change-Id: Ic94b8ba77a0ebaf121f2942238435a9da5917287
2022-06-15 14:54:18 +08:00
openharmony_ci
a24e0b3669
!1564 add stub for TypedArray
Merge pull request !1564 from xliu/string_optimize
2022-06-14 13:53:47 +00:00
xliu
831018e66d 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
luochuhao
172f5642c7 Modify enable logic of certain runtime options.
Change condtion for File execution branch to whether file is AOT compiled or not.

Fix bug of setting bc debug handler entry while loading stub file.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5BBFH
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I5b6d47a1587631849f6c1e746473cb14b1d727a8
2022-06-13 12:15:03 +08:00
sunzhe23
275a438f1f Support new this object call inline new
description:
add NewJSObject stub for fast new JSObject

issue: #I5BPKF

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-06-10 15:35:16 +08:00
ding
29b794f539 Refactor GateType
1.Change the implementation of gateType from enum to class.
2.Add some base type opeartions between GateType and GlobalTSTypeRef to simplify the code.
3.Delete class GateTypeCoder
4.Extract GlobalTSTypeRef as an independent file.

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

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I3d80595ebccc9ac942af9b9bcc67c0974bb9b712
2022-06-09 17:32:43 +08:00
sunzhe23
0959b86c63 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
sunzhe23
bf194f4c07 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
openharmony_ci
bf4c21cb25
!1395 Add Container Vector
Merge pull request !1395 from shisan_forwork/push_vector
2022-05-23 14:57:23 +00:00
shisan_forwork
63d3929b97 Add Container Vector
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>
2022-05-23 20:40:25 +08:00
zhangyukun
c82c88f515 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
openharmony_ci
7ad9f41154
!1341 support inline new for asm interpreter
Merge pull request !1341 from 孙哲/master
2022-05-19 09:49:11 +00:00
sunzhe23
54d7e20b98 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
getingke
5d5fcd7573 Merge branch 'master' of gitee.com:openharmony/ark_js_runtime into gtk_0506
Change-Id: I69fa38585bca16d85dc119ff8e8c305caa994630
Signed-off-by: getingke <getingke@huawei.com>
2022-05-16 17:15:35 +08:00
wuzhefeng
4e77e8f104 Refactor Compilation Framework Part-3
There are many similar "call" in the CircuitBuilder and most of them can
be merged or removed. Merge the similar ones and remove the redundant
ones to improve the maintainability and readability.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Ie575580a5d4d3eae67eff49efd8df126d96db48f
2022-05-14 20:21:38 -07:00
getingke
4fdc49bb63 fixed for assembler aarch64 support
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: Idf8e19e43a6ee1bf94a175781d32f139ba657cf6
2022-05-13 18:13:31 +08:00
openharmony_ci
db3cff6ca1
!1135 Add new stackless stub
Merge pull request !1135 from 李晨帅/master
2022-05-11 02:44:45 +00:00
lichenshuai
6a889927d9 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
wuzhefeng
a7d984b48d Refactor Compilaton Framework Part-1
Because the Stubs and CircuitBuilder share many common components like
Labels, Environment, and Variables, this PR remove the ones inside Stub
and replace them with CiircuitBuilder's.

Issue:https://e.gitee.com/open_harmony/dashboard?issue=I55P3C

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I5bc3672a371f7f2e749741e699b80fd466905dc8
2022-05-10 07:33:11 -07:00
zhangyukun
35db7bf019 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
songzhengchao
1eec1ab8fc Refactor Logical shift operation
the logical shift does't care signed/unsigned.sometime using UINTxx/Intxx, which is very confusing.

logical operation don't distinguish with int/uint and remove Archxx function

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Idaf71b46227917d2cb08c35118e71c2a66b79fd3
2022-04-21 20:08:23 +08:00
sunzhe23
9c3e2e6aed 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
songzhengchao
fe2aebc9af 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
4036b0598e Merge remote-tracking branch 'szc/proxy0413'
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I2a370b8803299c88109cbeb0f799acbdda53c2e9
2022-04-16 10:59:11 +08:00
Hailiang Hu
5fc2309893 AOT Refactor for CircuitBuilder and Slowpath
1. Remove low level CircuitBuilder, make flat of this interface.
2. Move some interface of LabelManager to CircuitBuilder, and rename to Environment.
3. Refactor some interface of MergeMirCircuit, LowerHirToCall,
   LowerHirToConditionCall and so on.

Issue: #I52VPJ

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Ib8f20e7137c8006a0735cefea9fe243513744652
2022-04-15 21:01:01 +08:00
songzhengchao
2eb673cbff 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
openharmony_ci
c92e6a6e19
!958 JSFunctionCall Trampoline
Merge pull request !958 from getingke/js_function_call_stub_formal
2022-04-11 14:03:09 +00:00
getingke
937a6af1a6 JSFunction call have 4 scenariso:
1.JSFunction
	call native code when method is native
	jump to compiled code for aot JSFunction
	call asm interpreter entry for BC method
2. JSBoundFunction
	Bind Arguments for Bound target function, then recursive call this trampoline function.
3. JSProxy
	Call proxy's target jsfunction.
4. NonCallable
	Throw typerror exception.

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

Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I85917e3cf1ffec0cc1e39de5fc20bd606947c968
2022-04-11 15:49:51 +08:00
openharmony_ci
9cf26d50f2
!953 fix setpropertyby*** stub error
Merge pull request !953 from wanghuan2022/master
2022-04-11 07:13:22 +00:00
wanghuan
82101c46a6 fix setpropertyby*** stub error
desc: fix setpropertyby*** stub error

solu:
1.add useown stub and not useown stub in common stub
2.Unit useown stub and not useown by using bool value in stub

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

Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I7a0f68d065cb5b27f60db91af8a87216c47a1f6f
2022-04-09 18:30:26 +08:00
openharmony_ci
094210fccf
!863 use rsp to construct frame of asm interpreter(x64)
Merge pull request !863 from zhangyukun8/master
2022-04-07 10:09:56 +00:00
zhangyukun
8c65a79097 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
lijincheng
24abde2d62 Aot Lowering
1.lower GETNEXTPROPNAME_PREF_V8, COPYDATAPROPERTIES_PREF_V8_V8, CREATEOBJECTWITHEXCLUDEDKEYS_PREF_IMM16_V8_V8
      CREATEREGEXPWITHLITERAL_PREF_ID32_IMM8, STOWNBYVALUE_PREF_V8_V8, STOWNBYINDEX_PREF_V8_IMM32, STOWNBYNAME_PREF_ID32_V8
      DEFINEGENERATORFUNC_PREF_ID16_IMM16_V8, DEFINEASYNCFUNC_PREF_ID16_IMM16_V8, COPYMODULE_PREF_V8

2.move CompilationConfig to CircuitBuilder. Enable aot's ability to identify platform differences.

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-04-07 10:30:33 +08:00
sunzhe23
43ffb0cf16 Implement FastToBoolean for asm interpreter
Issue: #I51BQ5

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-06 02:32:09 -07:00
wanghuan
0569976345 fix FastTypeOf error in bigint
des: fix FastTypeOf error in bigint

solution:
1. add big int type judgment.
2. change variable name to be reasonable.

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

Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I7f3284ea6d98b006c2df80585f7c946a0a4c1790
2022-04-06 15:38:33 +08:00
wuzhefeng
a462347fb8 Refactor Code
Because there are some redundant/unused/improper functions, this PR
remove them and improve the readability.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Ifa08f33a2819f3113234fdbf3ee2bb0e976d4071
2022-03-31 16:16:31 -07:00
sunzhe23
ea8452b7a0 Refactor CallStub/CallNoGCRuntime
Delete the call signature paramter of the function

Issue: #I50DB3

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-30 00:33:18 -07:00
openharmony_ci
71a68a22c5
!898 fix getresumemode stub handle error
Merge pull request !898 from wanghuan2022/master
2022-03-26 09:23:55 +00:00
wanghuan
71db7bbec9 fix getresumemode stub handle error
description: fix getresumemode stub handle error

solution:
1.load offset error, should be GetIntptr;
2.get value from bitfield error because of lack of lsr;
3.set acc value error, should be build tagged.

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

Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I96a35d134d5441f040cbf42d4e8ab2be208f166f
2022-03-26 12:04:56 +08:00