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

Improve DUMP_READ_OBJECT output #382

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

chqrlie
Copy link
Collaborator

@chqrlie chqrlie commented Apr 15, 2024

  • improve JS_DumpString: use L prefix for wide strings
  • dump variable kind and flags for locals and closures
  • disassemble byte code in DUMP_READ_OBJECT
  • pass start_pos to dump_byte_code and dump_single_byte_code
  • write constant pool before function bytecode (bump version to 11)
  • update generated code

- improve `JS_DumpString`: use `L` prefix for wide strings
- dump variable kind and flags for locals and closures
- disassemble byte code in DUMP_READ_OBJECT
- pass start_pos to `dump_byte_code` and `dump_single_byte_code`
- write constant pool before function bytecode (bump version to 11)
- update generated code
@chqrlie chqrlie changed the title Improve DUMP_READ_OBJECT Improve DUMP_READ_OBJECT output Apr 15, 2024
Copy link
Contributor

@saghul saghul left a comment

Choose a reason for hiding this comment

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

LGTM but I'll admit I'm out of my depth here.

case OP_FMT_label_u16:
addr = get_u32(tab + pos);
has_addr1:
if (pass == 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason not tuse if elseif here?

Copy link
Collaborator Author

@chqrlie chqrlie Apr 15, 2024

Choose a reason for hiding this comment

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

No reason indeed, will modify.
Actually, it looks ugly with else if and worse with a switch statement. The current code is more compact and performance is not an issue.

quickjs.c Show resolved Hide resolved
@chqrlie chqrlie merged commit 5797f2a into quickjs-ng:master Apr 16, 2024
47 checks passed
@chqrlie chqrlie deleted the improve-dump-read-object branch April 16, 2024 13:08
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