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

Separate the built-in intrinsic feature implementations into different C files and then amalgamate them back together #216

Closed
stevefan1999-personal opened this issue Jan 12, 2024 · 1 comment

Comments

@stevefan1999-personal
Copy link

The source code for quickjs.c is currently at 55K lines, and it is expected the grow. We should consider splitting the intrinsic implementations into its own C files, and then we can #include them back again.

For example, we can split the atomic intrinsic support into intrinsic/atomics.c and then #include "intrinsic/atomics.c" back again in the quickjs.c file. 

This way, hacking the actual QJS engine source code itself would be cleaner and easier. We can do more by formally splitting the intrinsic code into its own translation unit (that means into its own object file), but I think that is not going to be easy at the moment.

@bellard
Copy link
Owner

bellard commented Jan 13, 2024

It is possible that the buitins will be moved to a separate translation unit someday in order to speed up the compilation. However, I see no advantage in splitting with several #include. Having large source files is not a problem for me.

@bellard bellard closed this as completed Jan 13, 2024
chenzd123456 pushed a commit to Micro-Application-Runtime/quickjs that referenced this issue Feb 5, 2024
This JS_ReadObject() flag no longer works for bytecode. The IC opcodes
are patched during execution.

Fixes: quickjs-ng/quickjs#206
Refs: quickjs-ng/quickjs#120
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