Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions Zend/zend_constants.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@
*/
const ZEND_DEBUG_BUILD = UNKNOWN;

/**
* @var string
* @cvalue zend_vm_kind_name[ZEND_VM_KIND]
*/
const ZEND_VM_KIND = UNKNOWN;

/* Special constants true/false/null. */

/**
Expand Down
3 changes: 2 additions & 1 deletion Zend/zend_constants_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions Zend/zend_vm_gen.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
ZEND_VM_KIND_SWITCH => "ZEND_VM_KIND_SWITCH",
ZEND_VM_KIND_GOTO => "ZEND_VM_KIND_GOTO",
ZEND_VM_KIND_HYBRID => "ZEND_VM_KIND_HYBRID",
ZEND_VM_KIND_TAILCALL => "ZEND_VM_KIND_TAILCALL",
);

$op_types = array(
Expand Down Expand Up @@ -1465,7 +1466,7 @@ function gen_labels($f, $spec, $kind, $prolog, &$specs, $switch_labels = array()
switch ($kind) {
case ZEND_VM_KIND_CALL:
case ZEND_VM_KIND_TAILCALL:
out($f,$prolog."ZEND_NULL${variant}_HANDLER,\n");
out($f,$prolog."ZEND_NULL{$variant}_HANDLER,\n");
break;
case ZEND_VM_KIND_SWITCH:
out($f,$prolog."-1,\n");
Expand Down Expand Up @@ -1512,7 +1513,7 @@ function gen_labels($f, $spec, $kind, $prolog, &$specs, $switch_labels = array()
switch ($kind) {
case ZEND_VM_KIND_CALL:
case ZEND_VM_KIND_TAILCALL:
out($f,$prolog."ZEND_NULL${variant}_HANDLER,\n");
out($f,$prolog."ZEND_NULL{$variant}_HANDLER,\n");
break;
case ZEND_VM_KIND_SWITCH:
out($f,$prolog."-1,\n");
Expand Down Expand Up @@ -2473,6 +2474,18 @@ function gen_vm_opcodes_header(
$str .= "#define ZEND_VM_KIND_GOTO\t" . ZEND_VM_KIND_GOTO . "\n";
$str .= "#define ZEND_VM_KIND_HYBRID\t" . ZEND_VM_KIND_HYBRID . "\n";
$str .= "#define ZEND_VM_KIND_TAILCALL\t" . ZEND_VM_KIND_TAILCALL . "\n";
$str .= <<<ENDNAMES
static const char *const zend_vm_kind_name[] = {
NULL,
"ZEND_VM_KIND_CALL",
"ZEND_VM_KIND_SWITCH",
"ZEND_VM_KIND_GOTO",
"ZEND_VM_KIND_HYBRID",
"ZEND_VM_KIND_TAILCALL",
};

ENDNAMES;
$str .= "#define ZEND_VM_KIND_AS_STRING\tzend_vm_kind_name[ZEND_VM_KIND]\n";
$str .= "#if 0\n";
if ($GLOBALS["vm_kind_name"][ZEND_VM_KIND] === "ZEND_VM_KIND_HYBRID") {
$str .= "/* HYBRID requires support for computed GOTO and global register variables*/\n";
Expand Down
8 changes: 8 additions & 0 deletions Zend/zend_vm_opcodes.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading