Commit Graph

105 Commits

Author SHA1 Message Date
sunzhe23 7eb24e8b94 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
zhangyukun 26dbd673ff Fix rsp frame on arm64
1. fix callnative entry
2. adapt newobjdynrange

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

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Icf7d0a385d77f76cf8f76a0ecb448728881df067
2022-06-09 19:57:33 +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
lichenshuai a724508c73 Delete RSP macro and .S file
Rsp is used in future work, therefore .S file should be deleted.

Issue: #I5AGW3

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ib1fb140d40d259bc4519fbf547857e5f80e9ee0c
2022-06-02 10:32:46 +08:00
sunzhe23 33efa29adb Solve some issues for asm interpreter
description:
1 fix arm align up bug
2 Add array length fastPath for asm Interpreter
3 Fix call slowpath with arg0 bug for x64

issues: #I5ABQO

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-06-01 11:41:26 +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
openharmony_ci 0b5e0e6aa6 !1395 Add Container Vector
Merge pull request !1395 from shisan_forwork/push_vector
2022-05-23 14:57:23 +00:00
shisan_forwork 5adb25b225 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 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
hjzhangcm c47eac9550 fix codeCheck warning
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
Change-Id: Ie8ccede04ab2a7771439657fd8166b39c9dd0e4e
2022-05-12 09:50:21 +08:00
wuzhefeng f091b49f2c 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 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
zhaozhibo e0ad13d0c4 fix codex warning
Signed-off-by: zhaozhibo <zhaozhibo3@huawei.com>
2022-04-25 14:33:01 +08:00
yingguofeng@huawei.com 6c5808fc28 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
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
songzhengchao ecf5fd6eb0 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 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
songzhengchao 56477d35de bug fix compile bc/common stub vm setup load stub
rename glue type POINTER TO NATIVE_POINTER

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ic50466ef1afd931268a649227458642f933b2360
2022-04-16 17:20:27 +08:00
Hailiang Hu c089b204e8 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
openharmony_ci 7c000a7499 !973 fix codeDex warning
Merge pull request !973 from zhaozhibo/master
2022-04-12 08:41:37 +00:00
zhaozhibo aaf776aab5 fix code warning for codeDex
Signed-off-by: zhaozhibo <zhaozhibo3@huawei.com>
2022-04-12 14:27:50 +08:00
openharmony_ci 9af9aac86b !958 JSFunctionCall Trampoline
Merge pull request !958 from getingke/js_function_call_stub_formal
2022-04-11 14:03:09 +00:00
getingke fd1719432b 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 9213c20372 !953 fix setpropertyby*** stub error
Merge pull request !953 from wanghuan2022/master
2022-04-11 07:13:22 +00:00
wanghuan 541d798d35 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
sunzhe23 edd58632f4 Implement FastToBoolean for asm interpreter
Issue: #I51BQ5

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-06 02:32:09 -07:00
wanghuan 6bb11e334c 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 1e2aa2a487 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 3b08d469f4 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
sunzhe23 041327f5d0 Add runtime trace for runtime stubs
1 add RUNTIME_TRACE for runtime stubs
2 fix ICStoreElement var handlers bug

Issue: #I4ZPSH

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-26 02:45:25 -07:00
wengchangcheng 4f169b31a5 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 8c6f8ef20d 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
lijincheng 867175f50a fix compile error
Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-03-23 10:54:09 +08:00
openharmony_ci 51acac9124 !839 Modify for static check of handle issue
Merge pull request !839 from Allen/issue
2022-03-22 12:36:13 +00:00
openharmony_ci 9614384797 !815 Fix code review from issue
Merge pull request !815 from songzhengchao/reviewcode0321
2022-03-22 08:36:13 +00:00
Hailiang Hu c99ea2b07d Modify for static check of handle issue
The same variable name in function, switch lack of default statement.

Issue: I4YXXP

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Ia8b1fd6406bbc0f280482180a925d36ec358976f
2022-03-22 14:27:29 +08:00
songzhengchao 718b37beb0 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
sunzhe23 d74cdafe87 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
luochuhao c705ce054b 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
zhaozhibo 16bf84e370 Merge branch 'master' of gitee.com:openharmony/ark_js_runtime into master 2022-03-17 02:07:56 +00:00
ding f2a1852439 Fix FindTransitions Null to Undefined
When not find in transitions, should return Undefined in stub like
runtime.

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I2cb3013742f9c5b2d42a4820100a9b61d04a09b6
2022-03-15 22:00:02 +08:00
openharmony_ci 976cf3b3f7 !751 fix FastMul performance issues
Merge pull request !751 from 孙哲/master
2022-03-14 12:45:46 +00:00
openharmony_ci 5f0c650259 !703 modify transitions to weak reference
Merge pull request !703 from dingding/waek_transitions
2022-03-14 12:11:31 +00:00
zhaozhibo 116b8f85cb Fix internal issue list problem
Signed-off-by: zhaozhibo <zhaozhibo3@huawei.com>
2022-03-14 15:19:45 +08:00
sunzhe23 a44d68473a 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 e0b8620c6c 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
songzhengchao 44816cc3bc writebarrier marking fast path and Frame Refactor
1 writebarrier marking fast path
2 The design of Frame is unfriendly for low-level operations like ASM-interpreter and Compiler IR.

1 writebarrier marking flag is get by jsthread.threadStateBitField_
2 Refactor the Frame design by introducing Aligned struct

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I8fae1af0ce3c898909f088f8963f08c2f48dba8e
2022-03-12 18:11:38 +08:00
sunzhe23 57fe644984 refactor runtime trampoline id
Description:
add runtime_trace for runtime trampoline
mov runtime_trampolines.cpp info cmascript/trampoline/
rename FAST_STUB_ID as RUNTIME_CALL_ID

issue: #I4XBC9

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-11 02:17:24 -08:00
wuzhefeng 566eaabd96 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