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

Replace MRB_NO_DIRECT_THREADING with MRB_USE_VM_SWITCH_DISPATCH #5902

Merged
merged 1 commit into from Mar 18, 2023

Conversation

dearblue
Copy link
Contributor

@dearblue dearblue commented Jan 5, 2023

The correct technique now is "Token Threading".
However, the new name was chosen because it was felt that if a different technique was added in the future, there would be no need to replace it.

@dearblue dearblue requested a review from matz as a code owner January 5, 2023 12:58
@matz
Copy link
Member

matz commented Jan 6, 2023

I am not sure how proposed wording is better. Could you explain?

@dearblue
Copy link
Contributor Author

dearblue commented Jan 6, 2023

🐈‍⬛ My only source of information is https://ja.wikipedia.org/wiki/スレッデッドコード, which may be suspect.

  • The current implementation is based on "Token threading".
  • "Direct threading" is not "Token threading".
  • "Token threading" is not "Direct threading".
  • "Threaded code" includes "Token threading", "Direct threading", "Huffman threading" and etc..

@dearblue
Copy link
Contributor Author

dearblue commented Jan 6, 2023

I fixed the conflicts and rebased.

@matz
Copy link
Member

matz commented Jan 7, 2023

I understand the wording (and I am sure it's valid, since Prof. Ertl mentioned). But since we see “switch threading” in the reference, so if used precisely, the term threaded code itself is meaningless. Let me think about it for a while.

@dearblue
Copy link
Contributor Author

dearblue commented Jan 7, 2023

Oh, "Switch threading".
Hmmm, I'll leave this PR open for now, but switch to draft.

@dearblue dearblue marked this pull request as draft January 7, 2023 12:13
@dearblue
Copy link
Contributor Author

How about MRB_USE_SWITCH_THREADING?
Or is MRB_USE_VM_SWITCH_DISPATCH more understandable?

@matz
Copy link
Member

matz commented Mar 18, 2023

I prefer the term "switch dispatch" to "switch threading", for not using direct goto.

The correct technique now is "Token Threading".
However, the new name was chosen because it was felt that if a different technique was added in the future, there would be no need to replace it.
@dearblue
Copy link
Contributor Author

Thanks for your comment.
Replaced with MRB_USE_VM_SWITCH_DISPATCH.

And DIRECT_THREADED has been merged into MRB_USE_VM_SWITCH_DISPATCH.
So, please note that #ifdef and #ifndef have been replaced by the reverse.

@dearblue dearblue changed the title Replace MRB_NO_DIRECT_THREADING with MRB_NO_THREADED_CODE Replace MRB_NO_DIRECT_THREADING with MRB_USE_VM_SWITCH_DISPATCH Mar 18, 2023
@dearblue dearblue marked this pull request as ready for review March 18, 2023 09:10
@matz matz merged commit 1c765dc into mruby:master Mar 18, 2023
@dearblue dearblue deleted the threadedcode branch April 9, 2023 12:20
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.

None yet

2 participants