Skip to content

Conversation

@Ch3nYuY
Copy link

@Ch3nYuY Ch3nYuY commented Sep 13, 2022

No description provided.

Comment on lines 387 to 390
offset1_i32 = jit_cc_new_reg_I32(cc);
offset1 = jit_cc_new_reg_I64(cc);
GEN_INSN(SHL, offset1_i32, func_idx, NEW_CONST(I32, 2));
GEN_INSN(I32TOI64, offset1, offset1_i32);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also handle the 32-bit case like above:

if (UINTPTR_MAX == UINT64_MAX) {
    offset1_i32 = jit_cc_new_reg_I32(cc);
    offset1 = jit_cc_new_reg_I64(cc);
    GEN_INSN(SHL, offset1_i32, func_idx, NEW_CONST(I32, 2));
    GEN_INSN(I32TOI64, offset1, offset1_i32);
}
else {
    offset1 = jit_cc_new_reg_I32(cc);
    GEN_INSN(SHL, offset1, func_idx, NEW_CONST(I32, 2));
}

Comment on lines 429 to 430
GEN_INSN(BLTU, cc->cmp_reg, jit_basic_block_label(block_import),
jit_basic_block_label(block_nonimport));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should format the coding style, the CI coding guideline check reported failure.
Please install clang-format-12 to format the source file, refer to: https://github.com/bytecodealliance/wasm-micro-runtime/actions/runs/3089321530/jobs/4997498173#step:3:35

Comment on lines 452 to 455
// if (!jit_emit_callnative(cc, jit_call_indirect, native_ret, arg_regs, 6)) {
// return false;
// }

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused code

Comment on lines 475 to 487
// import_func_ptrs_reg = get_import_func_ptrs_reg(jit_frame);
// func_import = jit_cc_new_reg_I32(cc);
// JitReg func_import_offset = jit_cc_new_reg_I32(cc);
// JitReg func_import_offset_i64 = jit_cc_new_reg_I64(cc);
// // TODO: I32/2 or I64/3, switch
// GEN_INSN(SHL, func_import_offset, func_idx, NEW_CONST(I32, 3));
// GEN_INSN(I32TOI64, func_import_offset_i64, func_import_offset);
// GEN_INSN(LDPTR, func_import, import_func_ptrs_reg, func_import_offset_i64);
// if (!jit_emit_callnative(cc, jit_invoke_native, native_ret, arg_regs,
// 6)) {
// goto fail;
// }

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused code

GEN_INSN(LDPTR, jitted_code, fast_jit_func_ptrs_reg, jitted_code_offset);
}

JitReg res = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put the variable definition at the beginning of function.

GEN_INSN(CALLBC, res, 0, jitted_code);
/* Store res into current frame, so that post_return in
block func_return can get the value */
uint32 n = cc->jit_frame->sp - cc->jit_frame->lp;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@Ch3nYuY
Copy link
Author

Ch3nYuY commented Sep 27, 2022

fix bug in block import

@wenyongh
Copy link
Collaborator

LGTM

@wenyongh wenyongh merged commit a497f90 into bytecodealliance:dev/fast_jit Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants