Commit Graph

80 Commits

Author SHA1 Message Date
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
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
luochuhao
aa2ef1d5b5 Implement aot file generated step for aot compiler
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
2022-03-24 15:44:26 +08:00
songzhengchao
540852959e Fix compiler stub error
GateRef Store(VariableType type, GateRef glue, GateRef base, GateRef offset, GateRef value);
modify to
oid Store(VariableType type, GateRef glue, GateRef base, GateRef offset, GateRef value)

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: If6a396a6b34ce7d3cc14fd2ea43f0e2aa6d9b8a8
2022-03-22 17:06:56 +08:00
openharmony_ci
18f21ff183
!815 Fix code review from issue
Merge pull request !815 from songzhengchao/reviewcode0321
2022-03-22 08:36:13 +00:00
songzhengchao
ab198cc13d Fix code review from issue
bool variable shoule assign value;
code delete reduant ";" and " ";
class construct function signal parameter shoule add explicit;
function declare return void when caller don't need return value;
and etc

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4YXYH?from=project-issue
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I59e26d49f94e98a4cced7a5852df3029a5544d47
2022-03-22 14:25:18 +08:00
openharmony_ci
60f850978d
!835 Clean Code For CodeHub Issues
Merge pull request !835 from wanyanglan/master
2022-03-22 04:42:20 +00: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
sunzhe23
edea2b49db Add Instruction asr to implement shr2dyn bytecode handler
Description:
1 Shr2Dyn should use llvm asr
2 Rewrite shr/shl/ashr/or/xor/and slow path stubs

Issues: I4YVHA

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-21 05:38:04 -07:00
zhangyukun
3fe8526362 Refactor bytecode dispatch of bytecode in asm interpreter
1. add HandleOverflow in unused positions of bcHandlers
2. add bytecode helper at the end of bcHandlers
3. Refactor Dispatch
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4YIQG?from=project-issue

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Id51d1f2cc3c86f8fa1a59f6e79024bef406f7a21
2022-03-21 16:16:51 +08:00
sunzhe23
e05044b20e Fix some binary option handlers bug for c-interpreter and asm-interpreter
Description:
1 Fix and/or/xor CastToUint32 bug
2 Fix asm interpreter shr overflow bug

Issues: I4YPC6

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-20 20:03:59 -07:00
luochuhao
905d0496dc Refactor ID definition and callSignature initialization mechanism of stubs
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
2022-03-18 22:01:52 +08:00
openharmony_ci
f1af474f0e
!748 Add Call Stub
Merge pull request !748 from 李晨帅/master
2022-03-16 04:57:48 +00:00
lichenshuai
e6b8f48f69 Add Call Stub
Change several structures for call stub.

Related issue: #I4XK12

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ie7389ff96c619451304a3f0d352b271310c4b73e
2022-03-15 17:36:58 +08:00
openharmony_ci
9333cafe69
!751 fix FastMul performance issues
Merge pull request !751 from 孙哲/master
2022-03-14 12:45:46 +00:00
openharmony_ci
3cb6939652
!703 modify transitions to weak reference
Merge pull request !703 from dingding/waek_transitions
2022-03-14 12:11:31 +00:00
sunzhe23
22a2321ee1 Fix FastMul performance issues
Description:
FastMul convert Int into Double, and lead to the result
call the double constructor of JSTaggedValue

Solution:
add Int Case for FastMul

Issue: #I4XK3U

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-13 22:00:52 -07:00
ding
197e0a317c modify transitions to weak reference
1.modify transitions to weak reference and delete parent field in JSHClass.
2.add targeted test case to intercept the issue.
3.fix weak ref in parallel gc
4.fix TaggedCastToWeakReferentUnChecked() in stub

Change-Id: I118d293a04390fba6c21179a0a8ac7993dae5e96
Signed-off-by: ding <dingding5@huawei.com>
2022-03-14 11:02:43 +08:00
wuzhefeng
ab93e17d09 Refactor JSThread layout and introduce macro for debugging
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
2022-03-10 00:25:35 -08:00
openharmony_ci
1e538180ef
!697 Add JS Function Entry frame & LeaveFrame for arm32
Merge pull request !697 from getingke/arm32_js_frame
2022-03-10 05:13:13 +00:00
lijincheng
629d8548f9 compile bugfix
add new file circuit_builder-inl for extracting methods from stub
fix code check
Signed-off-by: lijincheng <lijincheng13@huawei.com>

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-03-09 10:57:44 +08:00
sunzhe23
56d8ac665d Related issue: #I4WXHG
Modifications:
1 rewrite Add/Stub2Dyn
2 bytecode Inc/Dec use .rodata store a float 1.0 and crashed on amd64.
  close double label for Inc/Dec on amd64

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-08 05:16:27 -08:00
getingke
9edfc82a48 fixed for revert enable_stub_aot flags
issue:[Add JSFunction EntryFrame & LeaveFrame for arm32](https://gitee.com/openharmony/ark_js_runtime/issues/I4WRJP?from=project-issue)
Signed-off-by: getingke <getingke@huawei.com>

Change-Id: I737b5905e8741a0d6f459f1a54e2f69d765901dd
Signed-off-by: getingke <getingke@huawei.com>
2022-03-08 20:52:04 +08:00
sunzhe23
c2a41bbddd Related issue: #I4WNBB
Modifications:
Add overflow handling for DoubleToInt

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-07 03:35:48 -08:00
wanghuan
c82b5e1003 add rest stub handle
Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I4588693b1dd362cb1e8ca6c18892c10cee77d73e
2022-03-04 10:17:52 +08:00
sunzhe23
1f2bd00aad Merge branch 'master' of https://gitee.com/openharmony/ark_js_runtime
Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-02 23:56:46 -08:00
sunzhe23
4737a4f59e Related issue: #I4W0C0
Modifications:
* Fix write barrier stub bug
* Adapt HandleNewLexEnvWithNameDynPrefImm16Imm16 for asm interpreter

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-02 01:52:51 -08:00
wupengyong
699c5a0f62 fix ptr cast to taggedvalue
Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: If7ee291d9b705277d815ddf19973622f7ff78ca0
2022-03-02 11:12:53 +08:00
Mingliang Zeng
f433c7efed Related issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4VSUH
Modifications:

* Rename StubMachineType to VariableType
* Remove the information about signed/unsigned
* VariableType is a class that bundled MachineType and GateType (not an enumerator anymore)

Signed-off-by: Mingliang Zeng <zengmingliang1@huawei.com>
2022-03-01 18:54:11 +08:00
wupengyong
05a33528c5 modify call runtime
Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: Iae4050f3e61ba9e76cfedcdff00748c7d78d6ecd
2022-02-26 09:43:43 +08:00
sunzhe23
cc073e1c59 issue:#I4UX5L
Reason: fix FastStub SetPropertyByName crash bug

 Description: SetLayoutToHClass set the wrong machine type, and cause a crash.

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-02-22 22:57:50 -08:00
zhangyukun
3b881fa018 Sync code from c_asm_interpreter to master
Use Stub to impl handlers of bytecodes and use tail call to impl
dispatch of handlers of bytecodes

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I7afabdc40ddfa11345aa1029059514aa4f55b9f8
2022-02-22 17:01:18 +08:00
openharmony_ci
cf3ee3ab96
!577 Add JS Function Entry frame & LeaveFrame
Merge pull request !577 from getingke/js_function_entry_frame
2022-02-21 12:44:08 +00:00
getingke
88429808d5 fixed for revert test code
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I725d9f53d3666b74b9430857e3ac0c8c33b3892c
2022-02-19 13:32:14 +08:00
getingke
deab3fbbbc fixed for gc test
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I358802cfacd4c592abe6fedbb571194b4d85d5d4
2022-02-19 09:54:46 +08:00
getingke
76734dd503 fixed for x86 test double mod ok
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I347316cfbbdc8e2ca15b222e1149a41712b35fca
2022-02-18 14:03:24 +08:00
liuganlin
3f93f046c1 Add container ArrayList
Description
  To ensure the high performance of container classes, ArrayList is provided in ark.
Related issue
  #I4T65T:Add Container ArrayList

Signed-off-by: liuganlin <liuganlin@huawei.com>
2022-02-18 10:37:31 +08:00
luochuhao
068021ac66 Add new Gate opcode: relocatable data and related llvm IR translation.
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4T3DT?from=project-issue
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I06b0a8d9da52f3197b50fcd9807f7f194502437d
2022-02-16 11:02:52 +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
songzhengchao
3069773a49 implement word and uint/int mixed usage
current stub Word*** function sometime handle unsigned int or signed
int, we refactor name it uint** or int** whichi is more clear

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ieb6e201d18c59fdd3fa7130b70389c54d619e3b2
2022-02-09 16:02:32 +08:00
songzhengchao
0e74edbe82 implement fastpath writebarrier and region class init markingbitmap on
construct function and refactor stub call runtime offset which's relative with
arch framework

current stub call runtime writebarrier, writebarrier stub is conveient
to optimized by llvm pass

region class markingbitmap should be not nullptr, it's good way to
inilized on construct class other than lazy inilized

current stub get member offset of runtime class, need to modify multiple
places which is not coveient to maintance. stub call offset by GetOldToxxxOffset and
CheckLayout which is checked by compile phase

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4SC94
Change-Id: Iec087f07ca27ef95b20ff65ea8bb9408b5887d9c
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2022-02-07 17:23:21 +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
792f51bbf7 refactoring circuit ir
The current circuit ir is translated to llvm ir according to the type of opcode,
and depends on different platforms. circuit ir, as an intermediate state from MIR
to LLVM IR, only performs the conversion role and should not depend on different
platforms for different conversion operations.

The uniqueness of the opcode is removed, and the opcode is combined with a valuecode,
which indicates the uniqueness of each MIR.

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4RP3H
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I2804e7ba9be58fcc4acf3d95a417224b7984018a
2022-01-26 11:33:05 +08:00
wuzhefeng
4ee0455c00 Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Ic990c5f11caeb3075033719a13e759baaf6dfefb
2022-01-13 00:26:00 -08:00