Skip to content

Replace MRB_NO_DIRECT_THREADING with MRB_USE_VM_SWITCH_DISPATCH#5902

Merged
matz merged 1 commit into
mruby:masterfrom
dearblue:threadedcode
Mar 18, 2023
Merged

Replace MRB_NO_DIRECT_THREADING with MRB_USE_VM_SWITCH_DISPATCH#5902
matz merged 1 commit into
mruby:masterfrom
dearblue:threadedcode

Conversation

@dearblue

@dearblue dearblue commented Jan 5, 2023

Copy link
Copy Markdown
Contributor

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

matz commented Jan 6, 2023

Copy link
Copy Markdown
Member

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

@dearblue

dearblue commented Jan 6, 2023

Copy link
Copy Markdown
Contributor Author

🐈‍⬛ 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

dearblue commented Jan 6, 2023

Copy link
Copy Markdown
Contributor Author

I fixed the conflicts and rebased.

@matz

matz commented Jan 7, 2023

Copy link
Copy Markdown
Member

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

dearblue commented Jan 7, 2023

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

How about MRB_USE_SWITCH_THREADING?
Or is MRB_USE_VM_SWITCH_DISPATCH more understandable?

@matz

matz commented Mar 18, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

2 participants