Skip to content

[Zend] Update README.md with new Zend VM executors #8008

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

Closed
wants to merge 2 commits into from
Closed

[Zend] Update README.md with new Zend VM executors #8008

wants to merge 2 commits into from

Conversation

stkeke
Copy link
Contributor

@stkeke stkeke commented Jan 29, 2022

As a new learner to PHP Zend VM, the first place I can find information
is this README.md. Unfortunately, it has not included the latest Zend VM
kind and code generation script.

With code reading and trail-and-error experiments, I found a few updates
that might be helpful to new learners.

ChangeLog:

  1. Add HYBRID threading model
  2. Remove --without-old-executor option and description
  3. ZE2 --> ZE3 (Since PHP 7)
  4. Change default VM kind from CALL to HYBRID

Signed-off-by: Su, Tao [email protected]

As a new learner to PHP Zend VM, the first place I can find information
is this README.md. Unfortunately, it has not included the latest Zend VM
kind and code generation script.

With code reading and trail-and-error experiments, I found a few updates
that might be helpful to new learners.

ChangeLog:
1) Add HYBRID threading model
2) Remove --without-old-executor option and description
3) ZE2 --> ZE3 (Since PHP 7)
4) Change default VM kind from CALL to HYBRID

Signed-off-by: Su, Tao <[email protected]>
@stkeke
Copy link
Contributor Author

stkeke commented Jan 29, 2022

This is the change result preview
image

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

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

I know these are wrong in the original text but since we're already touching it we might as well fix it.

@stkeke
Copy link
Contributor Author

stkeke commented Jan 30, 2022

@iluuu1994 Thanks for the review and comments which are all applied in the 2nd commit.

@iluuu1994 iluuu1994 closed this in 22688c7 Jan 30, 2022
@iluuu1994
Copy link
Member

Thanks @stkeke!

You can disable opcode specialization using `--without-specializer`.
At last you can debug the executor using the original `zend_vm_def.h` or the generated
`zend_vm_execute.h` file. Debugging with the original file requires the `--with-lines` option.
By default ZE3 (since PHP 7) uses the following command to generate executor:
Copy link
Member

Choose a reason for hiding this comment

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

As of PHP 8.0.0, it is ZE4. Might be better to omit the version, and just say "Zend Engine".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cmb69 I can make a new patch to update README.md as your comment.
However, in the zend.h, I found another macro #define ZEND_ENGINE_3 defined immediately following ZEND_VERSION "4.2.0-dev", should we also update it to ZEND_ENGINE_4? (A rough search in source code shows no reference to this macro definition. )
Zend Engine 3 git commit upgraded both ZEND_VERSION and ZEND_ENGINE_3.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New README update PR is here: #8057

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we can replace ZEND_ENGINE_3, because it is likely used by some extensions. Updating to ZEND_ENGINE_4 makes sense for PHP 9, if there are sufficient API changes (PHP 7 and PHP 8 didn't differ that much regarding ZE).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it. Thanks @cmb69 for the clarification.

@stkeke stkeke deleted the zend_readme branch February 8, 2022 10:03
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.

3 participants