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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions Zend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,14 @@ Executor's code is generated by PHP script zend_vm_gen.php it uses
definitions. It is included from `zend_compile.h`. The second one is an executor
code itself. It is included from `zend_execute.c`.

`zend_vm_gen.php` can produce different kind of executors. You can select
different opcode threading model using `--with-vm-kind=CALL|SWITCH|GOTO`. You
can disable opcode specialization using `--without-specializer`. You can include
or exclude old executor together with specialized one using
`--without-old-executor`. At last you can debug executor using original
`zend_vm_def.h` or generated file `zend_vm_execute.h`. Debugging with original
file requires `--with-lines` option. By default ZE2 uses the following command
to generate executor:
`zend_vm_gen.php` can produce different kind of executors. You can select a
different opcode threading model using `--with-vm-kind=CALL|SWITCH|GOTO|HYBRID`.
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.


```bash
php zend_vm_gen.php --with-vm-kind=CALL
# Default VM kind is HYBRID
php zend_vm_gen.php --with-vm-kind=HYBRID
```