Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] node-qjsc 编译的bytecode在Android端运行失败: TypeError: bytecode function expected #17

Open
huaf22 opened this issue Sep 26, 2022 · 1 comment

Comments

@huaf22
Copy link

huaf22 commented Sep 26, 2022

尝试在Android上内置最新版本的 quickJS, 并且参考qjsc_20210327.cc 实现了对应的 JNI 方法, 通过 node-qjsc 编译出来的 bytecode 在Android 上执行一直报错 bytecode function expected,这个错误位置是 quickjs.c 的 JS_EvalFunctionInternal 方法
image

但如果调用自己实现的 DumpByteCode JNI 方法,生成的 bytecode 可以执行成功,是因为不同环境编译出来的 bytecode 不能通用吗?对比了 node-qjsc 和 Android JNI 生成的两个文件, node-qjsc 编译出来的是 01 开头,Android JNI 编译出来的是 02 开头:
iShot_2022-09-25_21 23 23

@andycall
Copy link
Member

node-qjsc's BigInt are turned off, it will cause the bytecode are not compact with BigInt turn on.

Maybe it's the main reason of your issue.

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

No branches or pull requests

2 participants