Commit Graph

78 Commits

Author SHA1 Message Date
sunzhe23
15fd0405a1 Remove incorrectly used Gate GetBitField
issues:I64BL4

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-12-09 11:23:41 +08:00
jing_han
1c5cfede22 Modifying Code Alarms
Signed-off-by: jing_han <hanjing35@huawei.com>
issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I65AFF
2022-12-08 15:38:28 +08:00
jing_han
43a881d0d5 Modifying Code Alarms
Signed-off-by: jing_han <hanjing35@huawei.com>
issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I64YJ7
2022-12-07 10:52:48 +08:00
jing_han
da126491f0 Modifying Code Alarms
Signed-off-by: jing_han <hanjing35@huawei.com>
issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I64MJ0
2022-12-05 15:27:03 +08:00
sunzhe23
5000217ed2 Refactor Gate verify
add root verify, delete Gate GetProperties
issues:I645J7

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-12-01 16:55:19 +08:00
sunzhe23
812f607fbc Support Gate MetaData
replace gate GetProperties with gate meta data.

issues: I63J2D

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-11-30 17:52:21 +08:00
ding
d37f6d4596 AOT and ASM-Interpreter share builtins stub with call and new
1.Support new Builtins Constructor in Builtins Stub framework.
2.Support invoking Builtins Stub both ASM interpreter and AOT.
3.Add BooleanCosntructor implementation in Builtins Stub.
4.Add new log component: builtins
5.Add corresponding test case which can trace builtins execution path.
6.Add iterate stack map handler when entering by assembler.

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

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: Ie3a485a0383464ecc0b42be0a21baf50bb35bc21
2022-11-28 19:15:55 +08:00
openharmony_ci
172b46e7ab
!2786 AOT Builtin Math Function Lowering
Merge pull request !2786 from songzhengchao/builtinsqrt
2022-11-10 11:54:20 +00:00
sunzhe23
74cb27a6bd Fix some code check problem for gate accessor
issues:I60G9S

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-11-10 17:58:04 +08:00
songzhengchao
769df90e1f AOT Builtin Math Function Lowering
1 On current AOT Builtin Math is called by c++ runtime trampoline, which is not an efficient solution.
thus we call target math function directly.
2 CallNGCRuntime save bc offset When Aot call cc fucntion

issue:https://gitee.com/open_harmony/dashboard?issue_id=I5Z281

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I3768bfaf46b15749e37e1eb290e8fb1a3d75ea88
2022-11-10 16:37:28 +08:00
ding
88177465d7 Add New and SuperCall in TSTypeLowering
1.Add New and SuperCall in TSTypeLowering
2.Add CallConstructor and Allocate in TypeLowering
3.Fix GenerateStaticHClass bug
4.Add corresponding type test case

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

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I64f273f7f3b7f26ec9b8506a433b156465487cd2
2022-11-08 15:50:46 +08:00
sunzhe23
d5529e74ed Remove jsgateToBytecode map,use gate bitfield repace it
and resolve BytecodeCircuitBuilder code check issue

issues: I5Z53Q

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-11-03 11:26:59 +08:00
K0u1hw
44f6e0f38d description: lower load/store obj by index/name
detais: lower load/store obj by index/name
        lower neg
	fix enable-type-lowering
issues: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5XF00
Signed-off-by: K0u1hw <wangchunyang15@huawei.com>

Change-Id: Id32d209268cdd89e486306be8785fcbc9749fbf4
2022-10-28 19:37:14 +08:00
xujie
7217aeafdb Optimize aot to obtain lexical env
Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5Y44T
Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I41a54b4258ed53efb6dfa894bfeb180819235d2c
2022-10-27 21:19:29 +08:00
getingke
6fd036f520 fixed for optimized ICMP, FCMP, ZEXT, SEXT, TRUNC gate
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I6c89abff92c3bb3ac555091fb1bca57521f88217
2022-10-26 17:25:56 +08:00
xujie
6e37921151 Add typed not
Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I17c6b136e9af71a90bb667bf832b75fc8f25e8f7
2022-10-20 16:56:38 +08:00
openharmony_ci
ebc8437b0a
!2640 Dynamic Relocate Undefined function
Merge pull request !2640 from songzhengchao/dyrelocate2
2022-10-18 07:42:55 +00:00
getingke
a7aba16a61 fixed for review comment by wuzhefeng
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I202285a7a77ab3bf3c4da832c05788ab119b29a6
2022-10-18 11:23:23 +08:00
songzhengchao
f88307a5ae Dynamic Relocate Undefined function
In the Deoptimize Scenario, LLVM backend will lower llvm llvm.experimental.deoptimize IR to assembly __llvm_deoptimize.
runtime to implement __llvm_deoptimize.

issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5VX5M

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I516a99b9d4bf1ccb36d00736a694844663db5760
2022-10-18 09:38:49 +08:00
sunzhe23
5c51bf4087 Refactor build deopt frame state
use dfs order build frame state

issue: I5VVZQ
Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-10-17 10:33:41 +08:00
Gargoyle.h
ff92bd132a
!2567 guard eliminating pass
Merge pull request !2567 from ChunyangWang/guard_eliminating_pass
2022-10-10 06:04:48 +00:00
K0u1hw
6a8308983f description: guard eliminating pass
details: add guard eliminating pass
         delete guard when add/sub/mul two typetrusted gate
issues: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5UQBE

Signed-off-by: K0u1hw <wangchunyang15@huawei.com>
Change-Id: I6c7b7a181769928d251d1e3cb1173adb447e0054
2022-10-10 11:31:38 +08:00
songzhengchao
c4a5418079 lower guard and sample deopt case for x86-64 ok
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I8afbd9b0dd7f6ba04d75a85a6df1a058eb990b71
2022-10-10 09:35:48 +08:00
K0u1hw
1310688ce2 description: lower number/int/double add/sub/mul with constant check
details: lower number/int/double add/sub/mul with constant check
issues: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5UJ3E

Signed-off-by: K0u1hw <wangchunyang15@huawei.com>
Change-Id: Ic03042ae4d3e6ad2d475b147c8f6eaa4b5a74f48
2022-10-08 21:01:03 +08:00
wuzhefeng
2078d36e98 Support Deoptimization (part-3)
Improve the implementation of Gate's properties via static variables.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I3e097f9f9d2a23ee87bbbb2da900f4f750c71bb8
2022-10-07 23:09:22 -07:00
wuzhefeng
6f56ef0364 Support Deoptimization (part-2)
Refactor the log system of circuit IR framework and facilitate debugging.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Id6090d9713d0e4cdfa8169594466b318e3138374
2022-10-07 18:39:28 -07:00
wuzhefeng
c3bc9a67eb Support Deoptimization (part-1)
Refactor the log system of circuit IR framework and facilitate
debugging.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I0d78bece63d21d89f6d441ae1ef2a0670cf37c65
2022-10-01 20:00:46 -07:00
xujie
b941e5f5b4 deopt graph generator
Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I3e57e6f43ff19d50fae722c5b08d45e1aaf194ac
2022-09-30 18:56:37 -07:00
wuzhefeng
c2390da886 Refactor Compilation Logs
The log during aot compilation is chaos and should be refactored,
besides, the information of call targets inside *.ll files should be add
to facilliate debug process.

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

Change-Id: I828016e73fa20c33dc2f783d6ba577dc2ef52d5e

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I053ea8d92f8821d8d6d2ee767c5ca60b1802fcf1
2022-09-30 17:46:08 -07:00
getingke
45202e4d21 Add some middle level ir for optimize newobj or create literal heapobj
issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5RVFC?from=project-issue

Signed-off-by: getingke <getingke@huawei.com>
Change-Id: Ic2b1b748598d3b508ef0ab7178474b5ca0537a7c
2022-09-22 12:20:29 +08:00
xujie
09641d1d36 Extend Typelowering Opcode
1. Add binary and unary opcode for typelowering.

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I5c442f076a660440719fcd591bd8bb711ba784c9
2022-09-13 20:37:33 +08:00
wuzhangda
fd0ebe26e2 extended multilevel type lowering for circuit
Signed-off-by: wuzhangda <wuzhangda@huawei.com>
Change-Id: Ic8d8448a759ddc5939f275f62b08b3f1c4e97e94
2022-09-13 11:00:53 +08:00
openharmony_ci
fa76708745
!2260 extend circuit ir to make lowering multi-level
Merge pull request !2260 from ChunyangWang/extend_circuit_ir_to_make_lowering_multi_level
2022-09-05 11:40:05 +00:00
wangchunyang
1ead43d6d5 description: extend circuit ir to make lowering multi-level
details: add three kinds of circuit gate
	 TYPED_BINARY_OP: represent binary operator of two value of specific type which encoded in bitfield, with a constant valueIn which indicates the opcode of binary operator.
	 TYPED_CHECK: check whether a gate is the specific type which encoded in bitfield.
	 TYPED_CONVERT: convert GateType of a gate from one specific type to another, which encoded in bitfield.
issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5PAKT

Signed-off-by: K0u1hw <wangchunyang15@huawei.com>
Change-Id: I6706698181e61f89f31d462e8768b8bd5234df2b
2022-09-05 17:21:58 +08:00
wuzhefeng
b3e17b9138 Refactor Redundant Code
There are some redundant codes that should be removed.

Tesing: pass CI/test262

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>

Change-Id: I666622b396870fa074d788009a99495233a061a3
2022-09-03 06:43:41 -07:00
wupengyong
ddc1a37202 reason:add builtins substring ir
description:add builtins substring ir
issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5N5SN?from=project-issue

Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: Ic05fd3fd4492fd3060bb066ca560d537d1e623cc
2022-08-25 09:13:25 +08:00
wupengyong
eef2380567 reason:add buitins stub
description:add buitins stub
issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5HCIM?from=project-issue

Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: I4673f7f1443a8a9f6a3c01985f219e50ddb024fa
2022-08-04 17:27:44 +08:00
wuzhefeng
f763600d68 Refactor class Circuit's Public Interfaces (part-1)
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/I5HNQ4

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>

Change-Id: I184b5473ae179aedce83de59cd8f5a662b719d43
2022-07-18 18:58:11 -07:00
g00416891
25697095cd Fix CodeCheck
Signed-off-by: g00416891 <guobingbing3@huawei.com>
Change-Id: I02148bbd203868f0bda0f8de899ad625651824d8
2022-07-11 09:50:28 +08:00
wanyanglan
68acce4ba9 Add two HIRs RESTORE_REGISTER, SAVE_REGISTER to support generator command
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
2022-07-09 16:22:55 +08:00
wengchangcheng
6e5a7e8362 Descriptor: ark hilog refactor
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
2022-07-06 22:55:49 +08:00
huoqingyi
9cf6e63579 Fix bugs in ts aot
Description:
1.Fix the bug that Circuit IR args gates do not match the function args of the abc file.
2.Add class ArgumentAccessor to handle args gates of Circuit IR.
3.Modify to set the AOT function entry when constpool is being parsed.
4.For functions sharing the same instructions, add a map to collect duplicate infomation. The key of the map is the current method and the value is the first method with the same nstructions to be translated.

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

Change-Id: I08e48444eb22c4fc2841e1cdae44b90286de84ac
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-07-04 16:19:11 +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
openharmony_ci
77314ed185
!1459 Circuit IR optimizer frameworks
Merge pull request !1459 from Mingliang Zeng/master
2022-05-31 07:29:39 +00:00
Mingliang Zeng
611c662e25 https://gitee.com/openharmony/ark_js_runtime/issues/I59TAQ
Circuit IR optimizer frameworks:
1. Lattice equations system solver framework
2. Subgraph rewrite framework

Signed-off-by: Mingliang Zeng <zengmingliang1@huawei.com>
Change-Id: I05e97c8b34be46d5689798ec24423228c8e14bee
2022-05-31 10:54:59 +08:00
huoqingyi
2e87df8ec6 add type infer for more bytecodes
Change-Id: I2f25d587bd8309199480add290105b8f08dd04a3
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-05-30 21:06:45 +08:00
taohong
454c3b6328 refactor type infer
Signed-off-by: taohong <hongtao11@huawei.com>
Change-Id: I7805340a5b85a552a5da3d397e502838e9d8a3d9
2022-05-25 17:39:41 +08:00
wanghuan
3418f48a99 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
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
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