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
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
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
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
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>
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>
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
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>
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
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
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
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
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
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
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
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