Commit Graph

233 Commits

Author SHA1 Message Date
g00416891
9f8cbcc303 Move ConstantPool from JSFunction to JSMethod
Signed-off-by: g00416891 <guobingbing3@huawei.com>
Change-Id: I40dda1e44a831be6682f7fdacac21337af1bcd2d
2022-08-17 18:58:42 +08:00
lijincheng
9eb8d73589 AOT bugfix for Octane-benchmark
1.bugfix for phi builder in loop
2.add ut case for loop with variable exchange
3.optmize for dfs in scheduler

issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5LY7F
Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-08-13 14:54:15 +08:00
xujie
4d513493aa TSAOT Test262 Bugfix
1. Fix OPTIMIZED_JS_FUNCTION_ARGS_CONFIG_FRAME callsite sp computing
bug.
2. Fix Generator bug by saving args reg.

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I83c3ab95251088023e093b2572a95e981fd41fe1
2022-08-10 18:43:13 +08:00
lijincheng
bf4d3baf0e Test262 bugfix
1.fix asyncfunctionreject return undefine
2.fix phi nodes of resumegenerator(restoreRegister) missing, and load undefined newtarget error in asm

issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5KYMZ
Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-08-10 09:58:58 +08:00
wanyanglan
43d07c1165 Fix test262 related to yiled
Modify the procedure of subgraph replacement HIR so that it can
enter the correct branch and execute the corresponding statement.

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: Ibdcfc9d0b1aac3cc591e0a4c81fd8d48052b8d20
2022-08-09 17:34:10 +08:00
openharmony_ci
50f5ed60a1
!1970 Decouple the method of collecting MethodPc in the Compiler from the PandaFileTranslator class
Merge pull request !1970 from weng-xi/dev_remove_translator
2022-08-05 07:14:47 +00:00
weng-xi
2684cb552c Decouple the method of collecting MethodPc in the Compiler from the PandaFileTranslator class.
Optimize redundant traversal in BytecodeToCircuit method.

Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5K7IG
Signed-off-by: weng-xi <wengxi1@huawei.com>
Change-Id: I1ef49606d24ad252aa5b4e246b0c2eba20a37800
2022-08-05 13:56:17 +08:00
Zhenyu Pan
52600d83d3 Enable ASM interpreter compiling and running on Android
related issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5KPPG

Signed-off-by: Zhenyu Pan <panzhenyu1@huawei.com>
Change-Id: I0c50a4554148a86676b88ca41e9c6560546c5d28
2022-08-04 15:37:10 +08:00
openharmony_ci
74af592f52
!1933 Added New Code Of Asyncgenrator
Merge pull request !1933 from 毕虎/master
2022-08-02 11:52:32 +00:00
毕虎
85a9ed147c Merge branch 'master' of gitee.com:openharmony/arkcompiler_ets_runtime into master 2022-08-02 16:22:46 +08:00
bi-hu
f45e51d61b Added New Code Of Asyncgenrator
Signed-off-by: bi-hu <bihu@huawei.com>
https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5JIGT
2022-08-02 15:42:50 +08:00
lijincheng
a86e3b389f Test262 bugfix
1.Fix supercall and supercallspread error
2.Fix ThrowIfSuperNotCorrectCall and DefineClassWithBuffer error
3.Fix JSCALL call constructor
4.Fix rest args with 0 args
5.Fix inreducible try catch
issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5IHKJ

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-08-02 15:24:50 +08:00
Yuyicen
5af3a36245 Optimize calculating dominator tree in bc2circuit builder
Optimize calculating dominator tree in bc2circuit builder and fix a bug.

Signed-off-by: Yuyicen <1790899756@qq.com>
Change-Id: I80b432ecf7099f3a50706d4971ff362f5c226ea4
2022-08-01 18:45:00 +08:00
wanyanglan
71f7c5df2b TSAot test262 bugfix part 2
1、Solve the IR error problem generated by Aot. Aot uses subgraphs to
replace HIR considering whether the current use node is value input,
if it is value input, replace value.
2、fix LDSUPERBYNAME_PREF_ID32_V8 and STSUPERBYNAME_PREF_ID32_V8
Instruction CallRuntime bug by aot jsFunc.

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I87c4000a0b7fb2abe41b217364c5ace3d1129c1e
2022-07-30 10:24:43 +08:00
huoqingyi
fad22b9b59 Refactor parsing tstypes
Description:
Currently the type system stores the typeId inside tsTypes,
where typeId is obtained directly from abc-file.
This causes many redundant operations and complicates the process.
In order to make the code more concise and to support
the builtin types and types from multiple files,
we need to make some changes on parsing tsTypes.
1. add the class TSTypeParser and hide the detail of the conversion from the typeId in abc-files to GlobalTSTypeRef in it
2. store GlobalTSTypeRef in tsTypes instead of storing typeId obtained directly from abc-files
3. remove typeKind from the raw data of GlobalTSTypeRef and modify the way to get the typeKind of a GlobalTSTypeRef to get from its tsType
4. uniform some naming and modify some interfaces to adapt the above changes
5. rename TSLoader to TSManager

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

Tests:
tstype test, aot test, typeinfer test

Change-Id: Ic5e5edaf40ca5d6c260676111acdee6d4b86472a
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-07-26 16:49:44 +08:00
lijincheng
1365fe05de Bugfix for Aot Error Found In Test262
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>
2022-07-22 14:52:21 +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
wanyanglan
3441bbd0c4 TSAOT test262 bugfix
1. Modify the number of control streams and data streams at the same time.
2. handle phi generated from multiple control flow in the same source block
In the try catch block, add the phi node of the virtual register to resolve
the IR value input that is not reasonable due to the exception problem.

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I98f25a0641338d778e1b53b18db47a171ad003cb
2022-07-20 10:16:19 +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
openharmony_ci
84ea189f55
!1738 Get types from abc file by instruction orders and set them to Circuit IR
Merge pull request !1738 from huoqingyi/filltypes
2022-07-18 03:51:54 +00:00
huoqingyi
94271ddc1c Get types from abc file by instruction orders and set them to Circuit IR
Description:
To adapt changes of type system in abc file
1.In TSLoader, change the key of the type map from virtual registers to instruction orders and get the whole table instead of getting one type at one time.
2.In BytecodeCircuitBuilder, extract the prosess of setting gate types into a separate module and get gate types from type table by instruction orders.

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

Signed-off-by: huoqingyi <huoqingyi@huawei.com>
Change-Id: Ia4683ddd7513e866a9abce5d98aed5c482946c96
2022-07-15 13:10:42 +08:00
changjiaxing
f6447cdd61 Add tonumeric instruction
issue:Issuehttps://gitee.com/openharmony/ark_js_runtime/issues/I5F9F6?from=project-issue

Signed-off-by: changjiaxing <changjiaxing1@huawei.com>
2022-07-13 11:43:26 +08: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
xujie
92d366b8fc 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
lijincheng
7e4908ef8d 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
4dcd25b667
!1573 Fix AOT segfault issue
Merge pull request !1573 from Mingliang Zeng/master
2022-06-13 12:27:47 +00:00
Mingliang Zeng
3f11d34df7 https://gitee.com/openharmony/ark_js_runtime/issues/I5BUML
Fix AOT segfault issue

Two problems are identified and solved:

1. JS Bytecode to Circuit IR module:
A new bug was introduced from the recent refactoring. The sub-procedure NewPhi should create a new selector gate on the Circuit IR immediately (before calling the function RenameVariable), otherwise, the sub-procedure NewPhi (on the same basic block) could be called again after some recursions while nothing on that basic block is changed, leading to infinite recursion and stack overflow. The bug can be triggered when the CFG of the program to compile has a cycle and meet certain non-trivial conditions.

2. Circuit IR to LLVM IR module:
The signature of a stub function may have parameters with GC-related types (like JS_ANY) but the passed arguments can have not-GC-related types (like JS_NUMBER). The corresponding LLVM types of the passed arguments will be incompatible with the function signature in this case, so bit casts and address space casts should be used to convert the function arguments to match the types of parameters in the function signature.

Signed-off-by: Mingliang Zeng <zengmingliang1@huawei.com>
2022-06-13 15:09:51 +08:00
huoqingyi
6a99d6002d Add Type Infer Test Case
Description:
1.Add type infer test cases for bitwise_op, callfunctions, ldobjbyvalue and logic_op

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

Signed-off-by: huoqingyi <huoqingyi@huawei.com>
Change-Id: I486f6f91a32e1c7caa2446b12b8e6b33db8d47fe
2022-06-13 09:38:51 +08:00
xujie
81a69cf09f TSAOT Exception Handler
1. Throw JS exception in tsaot
2. Print bcoffset when occur JS exception

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I046d76c092a399354ddcdedd859f0c1e622387c2
2022-06-11 16:36: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
ding
b67b4eeeb1 AOT compiler supports file without type info
Add judement in DecodeTSTypes and GetGateType, to support compiling js
files in AOT.

Add pf_ as a member of BytecodeCircuitBuilder.

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

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: Ia16039e0ba455c6618fec3691c3089067a508373
2022-06-07 14:21:04 +08:00
ding
f72fd3ae62 Refactor TS Types
1.Re-write union type mechanism, store gt in components.
2.Refactor module tabale, now builtins type table and global infer table set in fixed index of 0 and 1.
3.Integrate some interfaces and logic.

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: Ie709705798b21206f1f272fc5cacafb3781ed940
2022-05-31 20:08:49 +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
openharmony_ci
3a175dbeed
!1196 type infer
Merge pull request !1196 from hongtao/refctTypeInfer
2022-05-25 14:32:31 +00:00
taohong
454c3b6328 refactor type infer
Signed-off-by: taohong <hongtao11@huawei.com>
Change-Id: I7805340a5b85a552a5da3d397e502838e9d8a3d9
2022-05-25 17:39:41 +08:00
hjzhangcm
36781b6343 fix codex warning
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
Change-Id: I35a91de086b443e976116a6dd5955da244a8d144
2022-05-25 09:09:14 +08:00
openharmony_ci
ce151ee143
!1370 fix codex warning file
Merge pull request !1370 from hjzhangcm/master
2022-05-22 01:12:24 +00:00
wupengyong
faf92259ac reason:performance optimization
description:optimize taggedvalue encode
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I55ZVP?from=project-issue

Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: I747a60f5ea7348d3b0cfc041a3b010c52b1517c0
2022-05-21 09:33:44 +08:00
hjzhangcm
5b5e1717d8 fix codex warning
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-05-20 18:57:39 +08:00
ding
574d8ca344 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
huoqingyi
e97d5baba6 add loop_begin blocks to bytecode_circuit_builder
Change-Id: I214016bf617f16a1cac4157612d595852c0d88a7
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-05-16 22:57:05 +08:00
xujie
71f548e7f4 Code Rectification of Aot Lowering
1. The unified callruntime parameter type is tagged.
2. Remove the glue parameter contained in callruntime.
3. Add Ldbigint support in bytecode circuitbuilder.

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: If6fb9047dcb6f109e7c2e379415a968d438cb3ff
2022-05-06 17:24:11 +08:00
lifansheng
1b578eb240 issue:I55TH8
modify JSTaggedValue which disconnect TaggedValue inheritance

Signed-off-by: lifansheng <lifansheng1@huawei.com>
Change-Id: I13b990baf5284e58e83ab6b14847df076f42bed8
2022-05-05 16:54:26 +08:00
lijincheng
c1d735e9ac Aot Test Case and Fix bugs in Lowering
1.Add aot test case: CreateEmptyArray and CreateEmptyObject and add them to Aot UT-Test.
2.fix "thisobj and input args" bug of callIThisRangeDyn.
3.Update LowerLdGlobalVar and LowerLdObjByName in lowering.
4.fix "callruntime" bug in lowering of LowerStObjByIndex.

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-04-28 14:15:11 +08:00
openharmony_ci
7cbbb8a243
!1093 Delete useless code dependencies.
Merge pull request !1093 from yingguofeng/mmap
2022-04-24 16:26:56 +00:00
yingguofeng@huawei.com
5037c8aac6 Delete useless code dependencies
To reduce 'libark_ jsruntime.so' ROM size, delete useless code dependencies.

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

Profit: libark_jsruntime.so size reduce from 3455(kb) to 2001(kb)

Change-Id: Ie7430fca6f539c9baff1f4aae7942da6fc9ef135
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-04-24 18:02:32 +08:00
songzhengchao
1fec05e99b Bytecode_circuit_builder SUB2DYN_PREF_V8 bug fix
1 add ts_sub test
2 modify int to taggedvalue

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Idc51011528bd34c29faf0ffbb36cd225b2b91302
2022-04-24 15:14:09 +08:00
xiongluo
727b20b57e refactor jsMethod
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>
2022-04-20 23:17:00 -10:00
zhaozhibo
4c106a7632 Merge branch 'master' of gitee.com:openharmony/ark_js_runtime into master 2022-04-17 07:24:50 +00:00
zhaozhibo
c239b44d80 fix codeDex warning(3)
Signed-off-by: zhaozhibo <zhaozhibo3@huawei.com>
2022-04-17 15:23:43 +08:00
xujie
b771b6a5cb Add Slowpath Aot Lowering
Aot lowering for AsyncFunctionEnter, TypeOfDyn, ResumeGenerator,
GetResumeMode, DefineNCFuncDyn, DefineMethod

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I5b32726d41580bcb0d7baa9bed6b3941fef23384
2022-04-16 17:35:30 +08:00
luochuhao
6e3cb63a98 Add lowering of define function dyn.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I52KRX
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I3a798b2c4be13bf12eb77806d5a32dc5e83a7416
2022-04-16 14:48:10 +08:00
Hailiang Hu
71258032ce AOT Slowpath Refactor
Rename C_VALUE to NJS_VALUE, simplify using of RTSTUB_ID in
GetValueFromConstStringTable, rename LowerHirToMir to
ReplaceHirToSubCfg.

Issue: #I5311R

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Ib9b8ea04b090c21569e1bffa2b63dd0ebf843ef1
2022-04-16 10:40:07 +08:00
lijincheng
64351bae86 Bugfix in Aot
1.Fix bugs found in AOT Running Debug
2.Change GetObjectFromConstPool to " callRuntime LoadValueFromConstantStringTable "
   in lowering for getting correct string in constpool when in-value-gate in irbuilder is "StringId"

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-04-15 14:31:41 +08:00
ding
b018a9b0f2 Control whether to print compiler logs through JSRuntime Options
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
2022-04-14 16:14:34 +08:00
zhaozhibo
34649fc073 Merge branch 'master' of gitee.com:openharmony/ark_js_runtime into master 2022-04-14 02:57:27 +00:00
zhaozhibo
cc222126ad fix codeDex warning.
Signed-off-by: zhaozhibo <zhaozhibo3@huawei.com>
2022-04-14 10:56:51 +08:00
getingke
9e0df14c60 Lowering these call opcode of bytecode:
CALLARG0DYN_PREF_V8
CALLARG1DYN_PREF_V8_V8
CALLARGS2DYN_PREF_V8_V8_V8
CALLARGS3DYN_PREF_V8_V8_V8_V8
CALLITHISRANGEDYN_PREF_IMM16_V8
CALLIRANGEDYN_PREF_IMM16_V8

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

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

Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I6be3f130b211ca7c51a557f9ace4bd20d46c4d04
2022-04-13 19:25:06 +08:00
openharmony_ci
5ae76f28fa
!964 Add Slowpath Lowering
Merge pull request !964 from huoqingyi/slowlowering
2022-04-13 06:35:46 +00:00
huoqingyi
64010a57c9 Add Aot SlowpathLowering
Change-Id: Ie2399770c5e2d3b38b40a4b50d4ff57d23d6d1b4
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-04-12 21:38:05 +08:00
openharmony_ci
d3b388c723
!973 fix codeDex warning
Merge pull request !973 from zhaozhibo/master
2022-04-12 08:41:37 +00:00
zhaozhibo
f9eb8d2051 fix code warning for codeDex
Signed-off-by: zhaozhibo <zhaozhibo3@huawei.com>
2022-04-12 14:27:50 +08:00
wanyanglan
ed204b8f70 Aot Lowering
lowering LDSUPERBYVALUE_PREF_V8_V8, STSUPERBYVALUE_PREF_V8_V8,
TRYSTGLOBALBYNAME_PREF_ID32, STCONSTTOGLOBALRECORD_PREF_ID32,
LDFUNCTION_PREF

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I3bff9dda0bd4455fdf9348f47586f1097287c0e2
2022-04-11 09:14:11 +08:00
Hailiang Hu
1dc39ca357 Add AOT Slowpath Lowering
Lowering for NEWLEXENVDYN, NEWLEXENVWITHNAMEDYN, POPLEXENVDYN.

Issue: I51VGS

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: I001c7bd23c03d2dbc0a1647a652c289204a8dc92
2022-04-09 19:35:17 +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
wanyanglan
e7342acada Aot Lowering
lower NEWOBJDYNRANGE_PREF_IMM16_V8, JEQZ_IMM8, JEQZ_IMM16, JNEZ_IMM8, JNEZ_IMM16

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: Ia8ebbb51f39cce5b3be69c1a39aa39a0cd74ad81
2022-04-06 17:29:14 +08:00
luochuhao
be4ecb415b Adaptation for aot framework helloworld test.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4ZL8V
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I32bf175d4aea43dab2d408ea0347a14a4b5903cb
2022-04-02 15:29:44 +08:00
wengchangcheng
e64122e200 add -Werror -Wextra gn flag for 'compiler'
1. ignore llvm warning
2. fix warning of compiler module

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

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I09774e431743a26ea366ed28e3276ff027ae0d31
2022-03-25 15:31:59 +08:00
wanyanglan
bb6022bffc Clean Code For CodeHub Issues
Modified file permissions, word spelling errors, and
programming specifications suggesting EXPECT_EQ instead
of EXPECT_TRUE

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I00eb9be48d481ce2bdaa4a621246ff6c405abecf
2022-03-22 11:34:13 +08:00
xujie
819a74cf9e Add AOT call lowering and refactor trampoline function
lowering HIR related to call, including CallArg0Dyn, CallArg1Dyn, CallArgs2Dyn, CallArgs3Dyn,
CallIThisRangeDyn, CallSpreadDyn,CallIRangeDyn. Currently only native call are supported.
Inline slowpath function in trampoline file.

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I4525f62c5b9307adb5cf323352695e4db98fae1b
2022-03-16 15:38:07 +08:00
wanyanglan
de938b04ac Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.

For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-15 11:02:40 +08:00
y00576111
6dc6688270 EcmaScript Standard Module Implementation
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
2022-03-10 19:10:42 +08:00
wanyanglan
3aa31632b4 circuit gate fill in the specific ts type
The type of the circuit gate of the current ts aot is JS_ANY, which does
not bring the data type of the ts itself. It is necessary to fill in the
type information of the ts with the gate to facilitate the type derivation.

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I5c72e3a918650840847fc965eafbb13b9475acd2
2022-03-07 19:54:28 +08:00
wanyanglan
edc86f3fd7 Aot lowering
lowering  LDLEXENVDYN_PREF, LDA_STR_ID32, STGLOBALVAR_PREF_ID32 and
TRYLDGLOBALBYNAME_PREF_ID32

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: Icd7538c2187257099e846761426f07a1996f77c5
2022-03-03 19:57:10 +08:00
xujie
78122e374d Implement frame of generic lowering(HIR To MIR)
Replace all JS_BYTECODE in HIR. In order to simplify the code
implementation, no type judgment is made on the input, and the
slowpath is directly implemented by calling the trampoline function
without affecting the original function. For complex function
implementation, directly encapsulate the entire interpreted code as
a trampoline function.

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: Icd24f7cebb496e4376170784ce1e2e2ef1a7ee71
2022-02-16 09:21:41 +08:00
wanyanglan
b11d945856 Refactoring HIR IF_EXCEPTION and bytecode ldai fdai instructions
The exception object is passed directly as a value inside the IR
will cause acc to generate many phi nodes (other vreg rarely generate
phi nodes when exceptions are handled). The current modification
is to add a GET_EXCEPTION directive (placed at the beginning of
the catch part) to indicate that the exception object is read after
an exception occurs, in this case lowering is simpler and does not
need to consider different value outputs, the logic is more concise
and the number of code instructions is reduced.
Replace ladi and fdai HIR with MIR: these two instructions to get
the immediate number, do not need to use HIR to handle, this will
increase the number of HIR instructions, simplify lowering.

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I751677e11b50976af4e2fc5a6cac4457fa9a44df
2022-02-11 16:24:43 +08:00
songzhengchao
2f9d60d2d6 implement machineType INT* FLOAT* rename to I* and F*
current machineType INT * FLOAT* confuse people to associate UINT*.
the INT* is simlar with LLVM IR too
we reanme  machineType INT* FLOAT* rename to I* and F*

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ie188e07039cd9f26aed436ce96618ea4143fccd6
2022-02-10 15:51:18 +08:00
wanyanglan
65d1f2de01 Redefine the layout of TypeCode to accommodate MIR, TS types
The current TypeCode is only used to represent the type of the MIR
and cannot represent the TS type data type. The type derivation
process needs to get the TS type information from the circuit ir.

Redefining the layout of TypeCode

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I53292db81712b84210114f9f92c44b6236c356af
2022-01-30 11:03:57 +08:00
wanyanglan
c3bfb80a04 independent running ts aot
ts aot should be a separate part that needs to generate the
corresponding file before executing xxx.abc and should not
depend on the execution of xxx.abc

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I4ed7d7ee5528dcb479e08486f332a48c16ea88d7
2022-01-26 15:22:50 +08:00
wanyanglan
d465caeab7 review comments revision
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4RP3H

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: Ic7edae930dc9e206c66cd453040c789f2a6b49d3
2022-01-26 11:33:05 +08:00