mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
zend_compiler, ...: use uint8_t
instead of zend_uchar
(#10621)
`zend_uchar` suggests that the value is an ASCII character, but here, it's about very small integers. This is misleading, so let's use a C99 integer instead. On all architectures currently supported by PHP, `zend_uchar` and `uint8_t` are identical. This change is only about code readability.
This commit is contained in:
parent
0460420205
commit
d5c649b36b
54 changed files with 359 additions and 338 deletions
|
@ -519,7 +519,7 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
|
||||||
break;
|
break;
|
||||||
case ZEND_IS_SMALLER:
|
case ZEND_IS_SMALLER:
|
||||||
if (opline->opcode == ZEND_BOOL_NOT) {
|
if (opline->opcode == ZEND_BOOL_NOT) {
|
||||||
zend_uchar tmp_type;
|
uint8_t tmp_type;
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
|
|
||||||
src->opcode = ZEND_IS_SMALLER_OR_EQUAL;
|
src->opcode = ZEND_IS_SMALLER_OR_EQUAL;
|
||||||
|
@ -537,7 +537,7 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
|
||||||
break;
|
break;
|
||||||
case ZEND_IS_SMALLER_OR_EQUAL:
|
case ZEND_IS_SMALLER_OR_EQUAL:
|
||||||
if (opline->opcode == ZEND_BOOL_NOT) {
|
if (opline->opcode == ZEND_BOOL_NOT) {
|
||||||
zend_uchar tmp_type;
|
uint8_t tmp_type;
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
|
|
||||||
src->opcode = ZEND_IS_SMALLER;
|
src->opcode = ZEND_IS_SMALLER;
|
||||||
|
|
|
@ -413,7 +413,7 @@ static inline bool is_free_of_live_var(context *ctx, zend_op *opline, zend_ssa_o
|
||||||
static bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
|
static bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
|
||||||
zend_ssa *ssa = ctx->ssa;
|
zend_ssa *ssa = ctx->ssa;
|
||||||
int free_var = -1;
|
int free_var = -1;
|
||||||
zend_uchar free_var_type;
|
uint8_t free_var_type;
|
||||||
|
|
||||||
if (opline->opcode == ZEND_NOP) {
|
if (opline->opcode == ZEND_NOP) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -932,7 +932,7 @@ optimize_jmpnz:
|
||||||
case ZEND_MATCH:
|
case ZEND_MATCH:
|
||||||
if (opline->op1_type == IS_CONST) {
|
if (opline->op1_type == IS_CONST) {
|
||||||
zval *zv = CT_CONSTANT_EX(op_array, opline->op1.constant);
|
zval *zv = CT_CONSTANT_EX(op_array, opline->op1.constant);
|
||||||
zend_uchar type = Z_TYPE_P(zv);
|
uint8_t type = Z_TYPE_P(zv);
|
||||||
bool correct_type =
|
bool correct_type =
|
||||||
(opline->opcode == ZEND_SWITCH_LONG && type == IS_LONG)
|
(opline->opcode == ZEND_SWITCH_LONG && type == IS_LONG)
|
||||||
|| (opline->opcode == ZEND_SWITCH_STRING && type == IS_STRING)
|
|| (opline->opcode == ZEND_SWITCH_STRING && type == IS_STRING)
|
||||||
|
|
|
@ -83,10 +83,10 @@ typedef struct _sccp_ctx {
|
||||||
zval bot;
|
zval bot;
|
||||||
} sccp_ctx;
|
} sccp_ctx;
|
||||||
|
|
||||||
#define TOP ((zend_uchar)-1)
|
#define TOP ((uint8_t)-1)
|
||||||
#define BOT ((zend_uchar)-2)
|
#define BOT ((uint8_t)-2)
|
||||||
#define PARTIAL_ARRAY ((zend_uchar)-3)
|
#define PARTIAL_ARRAY ((uint8_t)-3)
|
||||||
#define PARTIAL_OBJECT ((zend_uchar)-4)
|
#define PARTIAL_OBJECT ((uint8_t)-4)
|
||||||
#define IS_TOP(zv) (Z_TYPE_P(zv) == TOP)
|
#define IS_TOP(zv) (Z_TYPE_P(zv) == TOP)
|
||||||
#define IS_BOT(zv) (Z_TYPE_P(zv) == BOT)
|
#define IS_BOT(zv) (Z_TYPE_P(zv) == BOT)
|
||||||
#define IS_PARTIAL_ARRAY(zv) (Z_TYPE_P(zv) == PARTIAL_ARRAY)
|
#define IS_PARTIAL_ARRAY(zv) (Z_TYPE_P(zv) == PARTIAL_ARRAY)
|
||||||
|
@ -314,7 +314,7 @@ static bool try_replace_op2(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline zend_result ct_eval_binary_op(zval *result, zend_uchar binop, zval *op1, zval *op2) {
|
static inline zend_result ct_eval_binary_op(zval *result, uint8_t binop, zval *op1, zval *op2) {
|
||||||
/* TODO: We could implement support for evaluation of + on partial arrays. */
|
/* TODO: We could implement support for evaluation of + on partial arrays. */
|
||||||
if (IS_PARTIAL_ARRAY(op1) || IS_PARTIAL_ARRAY(op2)) {
|
if (IS_PARTIAL_ARRAY(op1) || IS_PARTIAL_ARRAY(op2)) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
|
@ -662,7 +662,7 @@ static inline zend_result ct_eval_assign_obj(zval *result, zval *value, const zv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline zend_result ct_eval_incdec(zval *result, zend_uchar opcode, zval *op1) {
|
static inline zend_result ct_eval_incdec(zval *result, uint8_t opcode, zval *op1) {
|
||||||
if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) {
|
if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -1843,7 +1843,7 @@ static void sccp_mark_feasible_successors(
|
||||||
case ZEND_MATCH:
|
case ZEND_MATCH:
|
||||||
{
|
{
|
||||||
bool strict_comparison = opline->opcode == ZEND_MATCH;
|
bool strict_comparison = opline->opcode == ZEND_MATCH;
|
||||||
zend_uchar type = Z_TYPE_P(op1);
|
uint8_t type = Z_TYPE_P(op1);
|
||||||
bool correct_type =
|
bool correct_type =
|
||||||
(opline->opcode == ZEND_SWITCH_LONG && type == IS_LONG)
|
(opline->opcode == ZEND_SWITCH_LONG && type == IS_LONG)
|
||||||
|| (opline->opcode == ZEND_SWITCH_STRING && type == IS_STRING)
|
|| (opline->opcode == ZEND_SWITCH_STRING && type == IS_STRING)
|
||||||
|
@ -2134,7 +2134,7 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var,
|
||||||
&& opline->opcode != ZEND_ADD_ARRAY_ELEMENT
|
&& opline->opcode != ZEND_ADD_ARRAY_ELEMENT
|
||||||
&& opline->opcode != ZEND_ADD_ARRAY_UNPACK) {
|
&& opline->opcode != ZEND_ADD_ARRAY_UNPACK) {
|
||||||
/* Replace with QM_ASSIGN */
|
/* Replace with QM_ASSIGN */
|
||||||
zend_uchar old_type = opline->result_type;
|
uint8_t old_type = opline->result_type;
|
||||||
uint32_t old_var = opline->result.var;
|
uint32_t old_var = opline->result.var;
|
||||||
|
|
||||||
ssa_op->result_def = -1;
|
ssa_op->result_def = -1;
|
||||||
|
|
|
@ -85,7 +85,7 @@ static inline bool is_in_successors(zend_basic_block *block, int check) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool is_var_type(zend_uchar type) {
|
static inline bool is_var_type(uint8_t type) {
|
||||||
return (type & (IS_CV|IS_VAR|IS_TMP_VAR)) != 0;
|
return (type & (IS_CV|IS_VAR|IS_TMP_VAR)) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ static void zend_mark_reachable(zend_op *opcodes, zend_cfg *cfg, zend_basic_bloc
|
||||||
zend_basic_block *succ = blocks + b->successors[i];
|
zend_basic_block *succ = blocks + b->successors[i];
|
||||||
|
|
||||||
if (b->len != 0) {
|
if (b->len != 0) {
|
||||||
zend_uchar opcode = opcodes[b->start + b->len - 1].opcode;
|
uint8_t opcode = opcodes[b->start + b->len - 1].opcode;
|
||||||
if (opcode == ZEND_MATCH) {
|
if (opcode == ZEND_MATCH) {
|
||||||
succ->flags |= ZEND_BB_TARGET;
|
succ->flags |= ZEND_BB_TARGET;
|
||||||
} else if (opcode == ZEND_SWITCH_LONG || opcode == ZEND_SWITCH_STRING) {
|
} else if (opcode == ZEND_SWITCH_LONG || opcode == ZEND_SWITCH_STRING) {
|
||||||
|
|
|
@ -132,7 +132,7 @@ static void zend_dump_unused_op(const zend_op *opline, znode_op op, uint32_t fla
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_API void zend_dump_var(const zend_op_array *op_array, zend_uchar var_type, int var_num)
|
ZEND_API void zend_dump_var(const zend_op_array *op_array, uint8_t var_type, int var_num)
|
||||||
{
|
{
|
||||||
if (var_type == IS_CV && var_num < op_array->last_var) {
|
if (var_type == IS_CV && var_num < op_array->last_var) {
|
||||||
fprintf(stderr, "CV%d($%s)", var_num, op_array->vars[var_num]->val);
|
fprintf(stderr, "CV%d($%s)", var_num, op_array->vars[var_num]->val);
|
||||||
|
@ -348,7 +348,7 @@ static void zend_dump_ssa_var_info(const zend_ssa *ssa, int ssa_var_num, uint32_
|
||||||
dump_flags);
|
dump_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_API void zend_dump_ssa_var(const zend_op_array *op_array, const zend_ssa *ssa, int ssa_var_num, zend_uchar var_type, int var_num, uint32_t dump_flags)
|
ZEND_API void zend_dump_ssa_var(const zend_op_array *op_array, const zend_ssa *ssa, int ssa_var_num, uint8_t var_type, int var_num, uint32_t dump_flags)
|
||||||
{
|
{
|
||||||
if (ssa_var_num >= 0) {
|
if (ssa_var_num >= 0) {
|
||||||
fprintf(stderr, "#%d.", ssa_var_num);
|
fprintf(stderr, "#%d.", ssa_var_num);
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include "zend_ssa.h"
|
#include "zend_ssa.h"
|
||||||
#include "zend_dfg.h"
|
#include "zend_dfg.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#define ZEND_DUMP_HIDE_UNREACHABLE (1<<0)
|
#define ZEND_DUMP_HIDE_UNREACHABLE (1<<0)
|
||||||
#define ZEND_DUMP_RC_INFERENCE (1<<1)
|
#define ZEND_DUMP_RC_INFERENCE (1<<1)
|
||||||
#define ZEND_DUMP_CFG (1<<2)
|
#define ZEND_DUMP_CFG (1<<2)
|
||||||
|
@ -39,8 +41,8 @@ void zend_dump_dfg(const zend_op_array *op_array, const zend_cfg *cfg, const zen
|
||||||
void zend_dump_phi_placement(const zend_op_array *op_array, const zend_ssa *ssa);
|
void zend_dump_phi_placement(const zend_op_array *op_array, const zend_ssa *ssa);
|
||||||
void zend_dump_variables(const zend_op_array *op_array);
|
void zend_dump_variables(const zend_op_array *op_array);
|
||||||
void zend_dump_ssa_variables(const zend_op_array *op_array, const zend_ssa *ssa, uint32_t dump_flags);
|
void zend_dump_ssa_variables(const zend_op_array *op_array, const zend_ssa *ssa, uint32_t dump_flags);
|
||||||
ZEND_API void zend_dump_ssa_var(const zend_op_array *op_array, const zend_ssa *ssa, int ssa_var_num, zend_uchar var_type, int var_num, uint32_t dump_flags);
|
ZEND_API void zend_dump_ssa_var(const zend_op_array *op_array, const zend_ssa *ssa, int ssa_var_num, uint8_t var_type, int var_num, uint32_t dump_flags);
|
||||||
ZEND_API void zend_dump_var(const zend_op_array *op_array, zend_uchar var_type, int var_num);
|
ZEND_API void zend_dump_var(const zend_op_array *op_array, uint8_t var_type, int var_num);
|
||||||
void zend_dump_op_array_name(const zend_op_array *op_array);
|
void zend_dump_op_array_name(const zend_op_array *op_array);
|
||||||
void zend_dump_const(const zval *zv);
|
void zend_dump_const(const zval *zv);
|
||||||
void zend_dump_ht(HashTable *ht);
|
void zend_dump_ht(HashTable *ht);
|
||||||
|
|
|
@ -562,7 +562,7 @@ static void float_div(zend_long a, zend_long b, zend_long *r1, zend_long *r2) {
|
||||||
|
|
||||||
static bool zend_inference_calc_binary_op_range(
|
static bool zend_inference_calc_binary_op_range(
|
||||||
const zend_op_array *op_array, const zend_ssa *ssa,
|
const zend_op_array *op_array, const zend_ssa *ssa,
|
||||||
const zend_op *opline, const zend_ssa_op *ssa_op, zend_uchar opcode, zend_ssa_range *tmp) {
|
const zend_op *opline, const zend_ssa_op *ssa_op, uint8_t opcode, zend_ssa_range *tmp) {
|
||||||
zend_long op1_min, op2_min, op1_max, op2_max, t1, t2, t3, t4;
|
zend_long op1_min, op2_min, op1_max, op2_max, t1, t2, t3, t4;
|
||||||
|
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
|
@ -1881,7 +1881,7 @@ ZEND_API uint32_t ZEND_FASTCALL zend_array_type_info(const zval *zv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ZEND_API uint32_t zend_array_element_type(uint32_t t1, zend_uchar op_type, int write, int insert)
|
ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, int write, int insert)
|
||||||
{
|
{
|
||||||
uint32_t tmp = 0;
|
uint32_t tmp = 0;
|
||||||
|
|
||||||
|
@ -1943,7 +1943,7 @@ ZEND_API uint32_t zend_array_element_type(uint32_t t1, zend_uchar op_type, int w
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t assign_dim_array_result_type(
|
static uint32_t assign_dim_array_result_type(
|
||||||
uint32_t arr_type, uint32_t dim_type, uint32_t value_type, zend_uchar dim_op_type) {
|
uint32_t arr_type, uint32_t dim_type, uint32_t value_type, uint8_t dim_op_type) {
|
||||||
uint32_t tmp = 0;
|
uint32_t tmp = 0;
|
||||||
/* Only add key type if we have a value type. We want to maintain the invariant that a
|
/* Only add key type if we have a value type. We want to maintain the invariant that a
|
||||||
* key type exists iff a value type exists even in dead code that may use empty types. */
|
* key type exists iff a value type exists even in dead code that may use empty types. */
|
||||||
|
@ -1987,7 +1987,7 @@ static uint32_t assign_dim_array_result_type(
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t assign_dim_result_type(
|
static uint32_t assign_dim_result_type(
|
||||||
uint32_t arr_type, uint32_t dim_type, uint32_t value_type, zend_uchar dim_op_type) {
|
uint32_t arr_type, uint32_t dim_type, uint32_t value_type, uint8_t dim_op_type) {
|
||||||
uint32_t tmp = arr_type & ~(MAY_BE_RC1|MAY_BE_RCN);
|
uint32_t tmp = arr_type & ~(MAY_BE_RC1|MAY_BE_RCN);
|
||||||
|
|
||||||
if (arr_type & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
|
if (arr_type & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
|
||||||
|
@ -2008,7 +2008,7 @@ static uint32_t assign_dim_result_type(
|
||||||
|
|
||||||
/* For binary ops that have compound assignment operators */
|
/* For binary ops that have compound assignment operators */
|
||||||
static uint32_t binary_op_result_type(
|
static uint32_t binary_op_result_type(
|
||||||
zend_ssa *ssa, zend_uchar opcode, uint32_t t1, uint32_t t2, int result_var,
|
zend_ssa *ssa, uint8_t opcode, uint32_t t1, uint32_t t2, int result_var,
|
||||||
zend_long optimization_level) {
|
zend_long optimization_level) {
|
||||||
uint32_t tmp = 0;
|
uint32_t tmp = 0;
|
||||||
uint32_t t1_type = (t1 & MAY_BE_ANY) | (t1 & MAY_BE_UNDEF ? MAY_BE_NULL : 0);
|
uint32_t t1_type = (t1 & MAY_BE_ANY) | (t1 & MAY_BE_UNDEF ? MAY_BE_NULL : 0);
|
||||||
|
@ -3335,7 +3335,7 @@ static zend_always_inline zend_result _zend_update_type_info(
|
||||||
tmp |= key_type | MAY_BE_ARRAY | MAY_BE_ARRAY_OF_NULL;
|
tmp |= key_type | MAY_BE_ARRAY | MAY_BE_ARRAY_OF_NULL;
|
||||||
}
|
}
|
||||||
while (j >= 0) {
|
while (j >= 0) {
|
||||||
zend_uchar opcode;
|
uint8_t opcode;
|
||||||
|
|
||||||
if (!ssa_opcodes) {
|
if (!ssa_opcodes) {
|
||||||
ZEND_ASSERT(j == (opline - op_array->opcodes) + 1 && "Use must be in next opline");
|
ZEND_ASSERT(j == (opline - op_array->opcodes) + 1 && "Use must be in next opline");
|
||||||
|
@ -3978,7 +3978,7 @@ static bool can_convert_to_double(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
zend_uchar opcode = opline->opcode;
|
uint8_t opcode = opline->opcode;
|
||||||
|
|
||||||
if (opcode == ZEND_ASSIGN_OP) {
|
if (opcode == ZEND_ASSIGN_OP) {
|
||||||
opcode = opline->extended_value;
|
opcode = opline->extended_value;
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
/* Bitmask for type inference (zend_ssa_var_info.type) */
|
/* Bitmask for type inference (zend_ssa_var_info.type) */
|
||||||
#include "zend_type_info.h"
|
#include "zend_type_info.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#define MAY_BE_PACKED_GUARD (1<<27) /* needs packed array guard */
|
#define MAY_BE_PACKED_GUARD (1<<27) /* needs packed array guard */
|
||||||
#define MAY_BE_CLASS_GUARD (1<<27) /* needs class guard */
|
#define MAY_BE_CLASS_GUARD (1<<27) /* needs class guard */
|
||||||
#define MAY_BE_GUARD (1<<28) /* needs type guard */
|
#define MAY_BE_GUARD (1<<28) /* needs type guard */
|
||||||
|
@ -220,7 +222,7 @@ ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, ze
|
||||||
ZEND_API void zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa);
|
ZEND_API void zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa);
|
||||||
ZEND_API int zend_ssa_inference(zend_arena **raena, const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimization_level);
|
ZEND_API int zend_ssa_inference(zend_arena **raena, const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimization_level);
|
||||||
|
|
||||||
ZEND_API uint32_t zend_array_element_type(uint32_t t1, zend_uchar op_type, int write, int insert);
|
ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, int write, int insert);
|
||||||
|
|
||||||
ZEND_API bool zend_inference_propagate_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op* ssa_op, int var, zend_ssa_range *tmp);
|
ZEND_API bool zend_inference_propagate_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op* ssa_op, int var, zend_ssa_range *tmp);
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, zval *name, zval*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zend_result zend_optimizer_eval_binary_op(zval *result, zend_uchar opcode, zval *op1, zval *op2) /* {{{ */
|
zend_result zend_optimizer_eval_binary_op(zval *result, uint8_t opcode, zval *op1, zval *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
if (zend_binary_op_produces_error(opcode, op1, op2)) {
|
if (zend_binary_op_produces_error(opcode, op1, op2)) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
|
@ -65,7 +65,7 @@ zend_result zend_optimizer_eval_binary_op(zval *result, zend_uchar opcode, zval
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
zend_result zend_optimizer_eval_unary_op(zval *result, zend_uchar opcode, zval *op1) /* {{{ */
|
zend_result zend_optimizer_eval_unary_op(zval *result, uint8_t opcode, zval *op1) /* {{{ */
|
||||||
{
|
{
|
||||||
unary_op_type unary_op = get_unary_op(opcode);
|
unary_op_type unary_op = get_unary_op(opcode);
|
||||||
|
|
||||||
|
@ -620,7 +620,7 @@ bool zend_optimizer_update_op2_const(zend_op_array *op_array,
|
||||||
|
|
||||||
bool zend_optimizer_replace_by_const(zend_op_array *op_array,
|
bool zend_optimizer_replace_by_const(zend_op_array *op_array,
|
||||||
zend_op *opline,
|
zend_op *opline,
|
||||||
zend_uchar type,
|
uint8_t type,
|
||||||
uint32_t var,
|
uint32_t var,
|
||||||
zval *val)
|
zval *val)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include "zend_ssa.h"
|
#include "zend_ssa.h"
|
||||||
#include "zend_func_info.h"
|
#include "zend_func_info.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#define ZEND_OP1_LITERAL(opline) (op_array)->literals[(opline)->op1.constant]
|
#define ZEND_OP1_LITERAL(opline) (op_array)->literals[(opline)->op1.constant]
|
||||||
#define ZEND_OP1_JMP_ADDR(opline) OP_JMP_ADDR(opline, (opline)->op1)
|
#define ZEND_OP1_JMP_ADDR(opline) OP_JMP_ADDR(opline, (opline)->op1)
|
||||||
#define ZEND_OP2_LITERAL(opline) (op_array)->literals[(opline)->op2.constant]
|
#define ZEND_OP2_LITERAL(opline) (op_array)->literals[(opline)->op2.constant]
|
||||||
|
@ -81,8 +83,8 @@ int zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv);
|
||||||
bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy);
|
bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy);
|
||||||
void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, zval *name, zval* value);
|
void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, zval *name, zval* value);
|
||||||
bool zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zval* value);
|
bool zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zval* value);
|
||||||
zend_result zend_optimizer_eval_binary_op(zval *result, zend_uchar opcode, zval *op1, zval *op2);
|
zend_result zend_optimizer_eval_binary_op(zval *result, uint8_t opcode, zval *op1, zval *op2);
|
||||||
zend_result zend_optimizer_eval_unary_op(zval *result, zend_uchar opcode, zval *op1);
|
zend_result zend_optimizer_eval_unary_op(zval *result, uint8_t opcode, zval *op1);
|
||||||
zend_result zend_optimizer_eval_cast(zval *result, uint32_t type, zval *op1);
|
zend_result zend_optimizer_eval_cast(zval *result, uint32_t type, zval *op1);
|
||||||
zend_result zend_optimizer_eval_strlen(zval *result, const zval *op1);
|
zend_result zend_optimizer_eval_strlen(zval *result, const zval *op1);
|
||||||
zend_result zend_optimizer_eval_special_func_call(
|
zend_result zend_optimizer_eval_special_func_call(
|
||||||
|
@ -95,7 +97,7 @@ bool zend_optimizer_update_op2_const(zend_op_array *op_array,
|
||||||
zval *val);
|
zval *val);
|
||||||
bool zend_optimizer_replace_by_const(zend_op_array *op_array,
|
bool zend_optimizer_replace_by_const(zend_op_array *op_array,
|
||||||
zend_op *opline,
|
zend_op *opline,
|
||||||
zend_uchar type,
|
uint8_t type,
|
||||||
uint32_t var,
|
uint32_t var,
|
||||||
zval *val);
|
zval *val);
|
||||||
zend_op *zend_optimizer_get_loop_var_def(const zend_op_array *op_array, zend_op *free_opline);
|
zend_op *zend_optimizer_get_loop_var_def(const zend_op_array *op_array, zend_op *free_opline);
|
||||||
|
|
|
@ -552,7 +552,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, zend_long
|
||||||
}
|
}
|
||||||
} else if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
|
} else if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
|
||||||
double d;
|
double d;
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
|
|
||||||
if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), dest, &d)) != IS_LONG)) {
|
if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), dest, &d)) != IS_LONG)) {
|
||||||
if (EXPECTED(type != 0)) {
|
if (EXPECTED(type != 0)) {
|
||||||
|
@ -613,7 +613,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(const zval *arg, double *
|
||||||
*dest = (double)Z_LVAL_P(arg);
|
*dest = (double)Z_LVAL_P(arg);
|
||||||
} else if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
|
} else if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
|
||||||
zend_long l;
|
zend_long l;
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
|
|
||||||
if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), &l, dest)) != IS_DOUBLE)) {
|
if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), &l, dest)) != IS_DOUBLE)) {
|
||||||
if (EXPECTED(type != 0)) {
|
if (EXPECTED(type != 0)) {
|
||||||
|
@ -660,7 +660,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, u
|
||||||
zend_string *str = Z_STR_P(arg);
|
zend_string *str = Z_STR_P(arg);
|
||||||
zend_long lval;
|
zend_long lval;
|
||||||
double dval;
|
double dval;
|
||||||
zend_uchar type = is_numeric_str_function(str, &lval, &dval);
|
uint8_t type = is_numeric_str_function(str, &lval, &dval);
|
||||||
if (type == IS_LONG) {
|
if (type == IS_LONG) {
|
||||||
ZVAL_LONG(arg, lval);
|
ZVAL_LONG(arg, lval);
|
||||||
} else if (type == IS_DOUBLE) {
|
} else if (type == IS_DOUBLE) {
|
||||||
|
|
|
@ -57,8 +57,8 @@
|
||||||
#define FC(member) (CG(file_context).member)
|
#define FC(member) (CG(file_context).member)
|
||||||
|
|
||||||
typedef struct _zend_loop_var {
|
typedef struct _zend_loop_var {
|
||||||
zend_uchar opcode;
|
uint8_t opcode;
|
||||||
zend_uchar var_type;
|
uint8_t var_type;
|
||||||
uint32_t var_num;
|
uint32_t var_num;
|
||||||
uint32_t try_catch_offset;
|
uint32_t try_catch_offset;
|
||||||
} zend_loop_var;
|
} zend_loop_var;
|
||||||
|
@ -89,7 +89,7 @@ ZEND_API zend_compiler_globals compiler_globals;
|
||||||
ZEND_API zend_executor_globals executor_globals;
|
ZEND_API zend_executor_globals executor_globals;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static zend_op *zend_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2);
|
static zend_op *zend_emit_op(znode *result, uint8_t opcode, znode *op1, znode *op2);
|
||||||
static bool zend_try_ct_eval_array(zval *result, zend_ast *ast);
|
static bool zend_try_ct_eval_array(zval *result, zend_ast *ast);
|
||||||
static void zend_eval_const_expr(zend_ast **ast_ptr);
|
static void zend_eval_const_expr(zend_ast **ast_ptr);
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ void zend_assert_valid_class_name(const zend_string *name) /* {{{ */
|
||||||
typedef struct _builtin_type_info {
|
typedef struct _builtin_type_info {
|
||||||
const char* name;
|
const char* name;
|
||||||
const size_t name_len;
|
const size_t name_len;
|
||||||
const zend_uchar type;
|
const uint8_t type;
|
||||||
} builtin_type_info;
|
} builtin_type_info;
|
||||||
|
|
||||||
static const builtin_type_info builtin_types[] = {
|
static const builtin_type_info builtin_types[] = {
|
||||||
|
@ -246,7 +246,7 @@ static const confusable_type_info confusable_types[] = {
|
||||||
{NULL, 0, NULL},
|
{NULL, 0, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
static zend_always_inline zend_uchar zend_lookup_builtin_type_by_name(const zend_string *name) /* {{{ */
|
static zend_always_inline uint8_t zend_lookup_builtin_type_by_name(const zend_string *name) /* {{{ */
|
||||||
{
|
{
|
||||||
const builtin_type_info *info = &builtin_types[0];
|
const builtin_type_info *info = &builtin_types[0];
|
||||||
|
|
||||||
|
@ -659,7 +659,7 @@ void zend_stop_lexing(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void zend_begin_loop(
|
static inline void zend_begin_loop(
|
||||||
zend_uchar free_opcode, const znode *loop_var, bool is_switch) /* {{{ */
|
uint8_t free_opcode, const znode *loop_var, bool is_switch) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_brk_cont_element *brk_cont_element;
|
zend_brk_cont_element *brk_cont_element;
|
||||||
int parent = CG(context).current_brk_cont;
|
int parent = CG(context).current_brk_cont;
|
||||||
|
@ -2110,7 +2110,7 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
|
||||||
|
|
||||||
static void zend_adjust_for_fetch_type(zend_op *opline, znode *result, uint32_t type) /* {{{ */
|
static void zend_adjust_for_fetch_type(zend_op *opline, znode *result, uint32_t type) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_uchar factor = (opline->opcode == ZEND_FETCH_STATIC_PROP_R) ? 1 : 3;
|
uint_fast8_t factor = (opline->opcode == ZEND_FETCH_STATIC_PROP_R) ? 1 : 3;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BP_VAR_R:
|
case BP_VAR_R:
|
||||||
|
@ -2155,7 +2155,7 @@ static inline void zend_make_tmp_result(znode *result, zend_op *opline) /* {{{ *
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static zend_op *zend_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2) /* {{{ */
|
static zend_op *zend_emit_op(znode *result, uint8_t opcode, znode *op1, znode *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_op *opline = get_next_op();
|
zend_op *opline = get_next_op();
|
||||||
opline->opcode = opcode;
|
opline->opcode = opcode;
|
||||||
|
@ -2175,7 +2175,7 @@ static zend_op *zend_emit_op(znode *result, zend_uchar opcode, znode *op1, znode
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static zend_op *zend_emit_op_tmp(znode *result, zend_uchar opcode, znode *op1, znode *op2) /* {{{ */
|
static zend_op *zend_emit_op_tmp(znode *result, uint8_t opcode, znode *op1, znode *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_op *opline = get_next_op();
|
zend_op *opline = get_next_op();
|
||||||
opline->opcode = opcode;
|
opline->opcode = opcode;
|
||||||
|
@ -2255,7 +2255,7 @@ ZEND_API bool zend_is_smart_branch(const zend_op *opline) /* {{{ */
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static inline uint32_t zend_emit_cond_jump(zend_uchar opcode, znode *cond, uint32_t opnum_target) /* {{{ */
|
static inline uint32_t zend_emit_cond_jump(uint8_t opcode, znode *cond, uint32_t opnum_target) /* {{{ */
|
||||||
{
|
{
|
||||||
uint32_t opnum = get_next_op_number();
|
uint32_t opnum = get_next_op_number();
|
||||||
zend_op *opline;
|
zend_op *opline;
|
||||||
|
@ -2306,7 +2306,7 @@ static inline void zend_update_jump_target_to_next(uint32_t opnum_jump) /* {{{ *
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static inline zend_op *zend_delayed_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2) /* {{{ */
|
static inline zend_op *zend_delayed_emit_op(znode *result, uint8_t opcode, znode *op1, znode *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_op tmp_opline;
|
zend_op tmp_opline;
|
||||||
|
|
||||||
|
@ -3590,7 +3590,7 @@ static uint32_t zend_compile_args(
|
||||||
|
|
||||||
znode arg_node;
|
znode arg_node;
|
||||||
zend_op *opline;
|
zend_op *opline;
|
||||||
zend_uchar opcode;
|
uint8_t opcode;
|
||||||
|
|
||||||
if (arg->kind == ZEND_AST_UNPACK) {
|
if (arg->kind == ZEND_AST_UNPACK) {
|
||||||
if (uses_named_args) {
|
if (uses_named_args) {
|
||||||
|
@ -3769,7 +3769,7 @@ static uint32_t zend_compile_args(
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
ZEND_API zend_uchar zend_get_call_op(const zend_op *init_op, zend_function *fbc) /* {{{ */
|
ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, zend_function *fbc) /* {{{ */
|
||||||
{
|
{
|
||||||
if (fbc) {
|
if (fbc) {
|
||||||
ZEND_ASSERT(!(fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE));
|
ZEND_ASSERT(!(fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE));
|
||||||
|
@ -5542,9 +5542,9 @@ static void zend_compile_if(zend_ast *ast) /* {{{ */
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static zend_uchar determine_switch_jumptable_type(zend_ast_list *cases) {
|
static uint8_t determine_switch_jumptable_type(zend_ast_list *cases) {
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
zend_uchar common_type = IS_UNDEF;
|
uint8_t common_type = IS_UNDEF;
|
||||||
for (i = 0; i < cases->children; i++) {
|
for (i = 0; i < cases->children; i++) {
|
||||||
zend_ast *case_ast = cases->child[i];
|
zend_ast *case_ast = cases->child[i];
|
||||||
zend_ast **cond_ast = &case_ast->child[0];
|
zend_ast **cond_ast = &case_ast->child[0];
|
||||||
|
@ -5583,7 +5583,7 @@ static zend_uchar determine_switch_jumptable_type(zend_ast_list *cases) {
|
||||||
return common_type;
|
return common_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool should_use_jumptable(zend_ast_list *cases, zend_uchar jumptable_type) {
|
static bool should_use_jumptable(zend_ast_list *cases, uint8_t jumptable_type) {
|
||||||
if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) {
|
if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5609,7 +5609,7 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */
|
||||||
znode expr_node, case_node;
|
znode expr_node, case_node;
|
||||||
zend_op *opline;
|
zend_op *opline;
|
||||||
uint32_t *jmpnz_opnums, opnum_default_jmp, opnum_switch = (uint32_t)-1;
|
uint32_t *jmpnz_opnums, opnum_default_jmp, opnum_switch = (uint32_t)-1;
|
||||||
zend_uchar jumptable_type;
|
uint8_t jumptable_type;
|
||||||
HashTable *jumptable = NULL;
|
HashTable *jumptable = NULL;
|
||||||
|
|
||||||
zend_compile_expr(&expr_node, expr_ast);
|
zend_compile_expr(&expr_node, expr_ast);
|
||||||
|
@ -5791,7 +5791,7 @@ static void zend_compile_match(znode *result, zend_ast *ast)
|
||||||
case_node.u.op.var = get_temporary_variable();
|
case_node.u.op.var = get_temporary_variable();
|
||||||
|
|
||||||
uint32_t num_conds = count_match_conds(arms);
|
uint32_t num_conds = count_match_conds(arms);
|
||||||
zend_uchar can_use_jumptable = can_match_use_jumptable(arms);
|
uint8_t can_use_jumptable = can_match_use_jumptable(arms);
|
||||||
bool uses_jumptable = can_use_jumptable && num_conds >= 2;
|
bool uses_jumptable = can_use_jumptable && num_conds >= 2;
|
||||||
HashTable *jumptable = NULL;
|
HashTable *jumptable = NULL;
|
||||||
uint32_t *jmpnz_opnums = NULL;
|
uint32_t *jmpnz_opnums = NULL;
|
||||||
|
@ -6321,7 +6321,7 @@ static zend_type zend_compile_single_typename(zend_ast *ast)
|
||||||
return (zend_type) ZEND_TYPE_INIT_CODE(ast->attr, 0, 0);
|
return (zend_type) ZEND_TYPE_INIT_CODE(ast->attr, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
zend_string *class_name = zend_ast_get_str(ast);
|
zend_string *class_name = zend_ast_get_str(ast);
|
||||||
zend_uchar type_code = zend_lookup_builtin_type_by_name(class_name);
|
uint8_t type_code = zend_lookup_builtin_type_by_name(class_name);
|
||||||
|
|
||||||
if (type_code != 0) {
|
if (type_code != 0) {
|
||||||
if ((ast->attr & ZEND_NAME_NOT_FQ) != ZEND_NAME_NOT_FQ) {
|
if ((ast->attr & ZEND_NAME_NOT_FQ) != ZEND_NAME_NOT_FQ) {
|
||||||
|
@ -6869,7 +6869,7 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32
|
||||||
uint32_t property_flags = param_ast->attr & (ZEND_ACC_PPP_MASK | ZEND_ACC_READONLY);
|
uint32_t property_flags = param_ast->attr & (ZEND_ACC_PPP_MASK | ZEND_ACC_READONLY);
|
||||||
|
|
||||||
znode var_node, default_node;
|
znode var_node, default_node;
|
||||||
zend_uchar opcode;
|
uint8_t opcode;
|
||||||
zend_op *opline;
|
zend_op *opline;
|
||||||
zend_arg_info *arg_info;
|
zend_arg_info *arg_info;
|
||||||
|
|
||||||
|
@ -8528,7 +8528,7 @@ ZEND_API bool zend_is_op_long_compatible(const zval *op)
|
||||||
|
|
||||||
if (Z_TYPE_P(op) == IS_STRING) {
|
if (Z_TYPE_P(op) == IS_STRING) {
|
||||||
double dval = 0;
|
double dval = 0;
|
||||||
zend_uchar is_num = is_numeric_str_function(Z_STR_P(op), NULL, &dval);
|
uint8_t is_num = is_numeric_str_function(Z_STR_P(op), NULL, &dval);
|
||||||
if (is_num == 0 || (is_num == IS_DOUBLE && !zend_is_long_compatible(dval, zend_dval_to_lval(dval)))) {
|
if (is_num == 0 || (is_num == IS_DOUBLE && !zend_is_long_compatible(dval, zend_dval_to_lval(dval)))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -10710,7 +10710,7 @@ static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||||
}
|
}
|
||||||
} else if (Z_TYPE_P(container) == IS_STRING) {
|
} else if (Z_TYPE_P(container) == IS_STRING) {
|
||||||
zend_long offset;
|
zend_long offset;
|
||||||
zend_uchar c;
|
uint8_t c;
|
||||||
if (Z_TYPE_P(dim) == IS_LONG) {
|
if (Z_TYPE_P(dim) == IS_LONG) {
|
||||||
offset = Z_LVAL_P(dim);
|
offset = Z_LVAL_P(dim);
|
||||||
} else if (Z_TYPE_P(dim) != IS_STRING || is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), &offset, NULL, 1) != IS_LONG) {
|
} else if (Z_TYPE_P(dim) != IS_STRING || is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), &offset, NULL, 1) != IS_LONG) {
|
||||||
|
@ -10719,7 +10719,7 @@ static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||||
if (offset < 0 || (size_t)offset >= Z_STRLEN_P(container)) {
|
if (offset < 0 || (size_t)offset >= Z_STRLEN_P(container)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
c = (zend_uchar) Z_STRVAL_P(container)[offset];
|
c = (uint8_t) Z_STRVAL_P(container)[offset];
|
||||||
ZVAL_CHAR(&result, c);
|
ZVAL_CHAR(&result, c);
|
||||||
} else if (Z_TYPE_P(container) <= IS_FALSE) {
|
} else if (Z_TYPE_P(container) <= IS_FALSE) {
|
||||||
return; /* warning... handle at runtime */
|
return; /* warning... handle at runtime */
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "zend_ast.h"
|
#include "zend_ast.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "zend_llist.h"
|
#include "zend_llist.h"
|
||||||
|
|
||||||
|
@ -79,8 +80,8 @@ typedef union _znode_op {
|
||||||
} znode_op;
|
} znode_op;
|
||||||
|
|
||||||
typedef struct _znode { /* used only during compilation */
|
typedef struct _znode { /* used only during compilation */
|
||||||
zend_uchar op_type;
|
uint8_t op_type;
|
||||||
zend_uchar flag;
|
uint8_t flag;
|
||||||
union {
|
union {
|
||||||
znode_op op;
|
znode_op op;
|
||||||
zval constant; /* replaced by literal/zv */
|
zval constant; /* replaced by literal/zv */
|
||||||
|
@ -140,10 +141,10 @@ struct _zend_op {
|
||||||
znode_op result;
|
znode_op result;
|
||||||
uint32_t extended_value;
|
uint32_t extended_value;
|
||||||
uint32_t lineno;
|
uint32_t lineno;
|
||||||
zend_uchar opcode; /* Opcodes defined in Zend/zend_vm_opcodes.h */
|
uint8_t opcode; /* Opcodes defined in Zend/zend_vm_opcodes.h */
|
||||||
zend_uchar op1_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */
|
uint8_t op1_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */
|
||||||
zend_uchar op2_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */
|
uint8_t op2_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */
|
||||||
zend_uchar result_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */
|
uint8_t result_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -438,8 +439,8 @@ typedef struct _zend_internal_function_info {
|
||||||
|
|
||||||
struct _zend_op_array {
|
struct _zend_op_array {
|
||||||
/* Common elements */
|
/* Common elements */
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
zend_uchar arg_flags[3]; /* bitset of arg_info.pass_by_reference */
|
uint8_t arg_flags[3]; /* bitset of arg_info.pass_by_reference */
|
||||||
uint32_t fn_flags;
|
uint32_t fn_flags;
|
||||||
zend_string *function_name;
|
zend_string *function_name;
|
||||||
zend_class_entry *scope;
|
zend_class_entry *scope;
|
||||||
|
@ -493,8 +494,8 @@ typedef void (ZEND_FASTCALL *zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
|
||||||
|
|
||||||
typedef struct _zend_internal_function {
|
typedef struct _zend_internal_function {
|
||||||
/* Common elements */
|
/* Common elements */
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
zend_uchar arg_flags[3]; /* bitset of arg_info.pass_by_reference */
|
uint8_t arg_flags[3]; /* bitset of arg_info.pass_by_reference */
|
||||||
uint32_t fn_flags;
|
uint32_t fn_flags;
|
||||||
zend_string* function_name;
|
zend_string* function_name;
|
||||||
zend_class_entry *scope;
|
zend_class_entry *scope;
|
||||||
|
@ -515,12 +516,12 @@ typedef struct _zend_internal_function {
|
||||||
#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? ZSTR_VAL((function)->common.scope->name) : "")
|
#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? ZSTR_VAL((function)->common.scope->name) : "")
|
||||||
|
|
||||||
union _zend_function {
|
union _zend_function {
|
||||||
zend_uchar type; /* MUST be the first element of this struct! */
|
uint8_t type; /* MUST be the first element of this struct! */
|
||||||
uint32_t quick_arg_flags;
|
uint32_t quick_arg_flags;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
zend_uchar type; /* never used */
|
uint8_t type; /* never used */
|
||||||
zend_uchar arg_flags[3]; /* bitset of arg_info.pass_by_reference */
|
uint8_t arg_flags[3]; /* bitset of arg_info.pass_by_reference */
|
||||||
uint32_t fn_flags;
|
uint32_t fn_flags;
|
||||||
zend_string *function_name;
|
zend_string *function_name;
|
||||||
zend_class_entry *scope;
|
zend_class_entry *scope;
|
||||||
|
@ -848,7 +849,7 @@ ZEND_API zend_ast *zend_compile_string_to_ast(
|
||||||
zend_string *code, struct _zend_arena **ast_arena, zend_string *filename);
|
zend_string *code, struct _zend_arena **ast_arena, zend_string *filename);
|
||||||
ZEND_API int zend_execute_scripts(int type, zval *retval, int file_count, ...);
|
ZEND_API int zend_execute_scripts(int type, zval *retval, int file_count, ...);
|
||||||
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle);
|
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle);
|
||||||
ZEND_API void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size);
|
ZEND_API void init_op_array(zend_op_array *op_array, uint8_t type, int initial_ops_size);
|
||||||
ZEND_API void destroy_op_array(zend_op_array *op_array);
|
ZEND_API void destroy_op_array(zend_op_array *op_array);
|
||||||
ZEND_API void zend_destroy_static_vars(zend_op_array *op_array);
|
ZEND_API void zend_destroy_static_vars(zend_op_array *op_array);
|
||||||
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle);
|
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle);
|
||||||
|
@ -897,7 +898,7 @@ ZEND_API bool zend_is_compiling(void);
|
||||||
ZEND_API char *zend_make_compiled_string_description(const char *name);
|
ZEND_API char *zend_make_compiled_string_description(const char *name);
|
||||||
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_handlers);
|
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_handlers);
|
||||||
uint32_t zend_get_class_fetch_type(const zend_string *name);
|
uint32_t zend_get_class_fetch_type(const zend_string *name);
|
||||||
ZEND_API zend_uchar zend_get_call_op(const zend_op *init_op, zend_function *fbc);
|
ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, zend_function *fbc);
|
||||||
ZEND_API bool zend_is_smart_branch(const zend_op *opline);
|
ZEND_API bool zend_is_smart_branch(const zend_op *opline);
|
||||||
|
|
||||||
typedef bool (*zend_auto_global_callback)(zend_string *name);
|
typedef bool (*zend_auto_global_callback)(zend_string *name);
|
||||||
|
|
|
@ -481,7 +481,7 @@ static const zend_function_entry backed_enum_methods[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
ZEND_API zend_class_entry *zend_register_internal_enum(
|
ZEND_API zend_class_entry *zend_register_internal_enum(
|
||||||
const char *name, zend_uchar type, const zend_function_entry *functions)
|
const char *name, uint8_t type, const zend_function_entry *functions)
|
||||||
{
|
{
|
||||||
ZEND_ASSERT(type == IS_UNDEF || type == IS_LONG || type == IS_STRING);
|
ZEND_ASSERT(type == IS_UNDEF || type == IS_LONG || type == IS_STRING);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include "zend.h"
|
#include "zend.h"
|
||||||
#include "zend_types.h"
|
#include "zend_types.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
BEGIN_EXTERN_C()
|
BEGIN_EXTERN_C()
|
||||||
|
|
||||||
extern ZEND_API zend_class_entry *zend_ce_unit_enum;
|
extern ZEND_API zend_class_entry *zend_ce_unit_enum;
|
||||||
|
@ -37,7 +39,7 @@ void zend_enum_register_funcs(zend_class_entry *ce);
|
||||||
void zend_enum_register_props(zend_class_entry *ce);
|
void zend_enum_register_props(zend_class_entry *ce);
|
||||||
|
|
||||||
ZEND_API zend_class_entry *zend_register_internal_enum(
|
ZEND_API zend_class_entry *zend_register_internal_enum(
|
||||||
const char *name, zend_uchar type, const zend_function_entry *functions);
|
const char *name, uint8_t type, const zend_function_entry *functions);
|
||||||
ZEND_API void zend_enum_add_case(zend_class_entry *ce, zend_string *case_name, zval *value);
|
ZEND_API void zend_enum_add_case(zend_class_entry *ce, zend_string *case_name, zval *value);
|
||||||
ZEND_API void zend_enum_add_case_cstr(zend_class_entry *ce, const char *name, zval *value);
|
ZEND_API void zend_enum_add_case_cstr(zend_class_entry *ce, const char *name, zval *value);
|
||||||
ZEND_API zend_object *zend_enum_get_case(zend_class_entry *ce, zend_string *name);
|
ZEND_API zend_object *zend_enum_get_case(zend_class_entry *ce, zend_string *name);
|
||||||
|
|
|
@ -734,7 +734,7 @@ static bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg)
|
||||||
/* For an int|float union type and string value,
|
/* For an int|float union type and string value,
|
||||||
* determine chosen type by is_numeric_string() semantics. */
|
* determine chosen type by is_numeric_string() semantics. */
|
||||||
if ((type_mask & MAY_BE_DOUBLE) && Z_TYPE_P(arg) == IS_STRING) {
|
if ((type_mask & MAY_BE_DOUBLE) && Z_TYPE_P(arg) == IS_STRING) {
|
||||||
zend_uchar type = is_numeric_str_function(Z_STR_P(arg), &lval, &dval);
|
uint8_t type = is_numeric_str_function(Z_STR_P(arg), &lval, &dval);
|
||||||
if (type == IS_LONG) {
|
if (type == IS_LONG) {
|
||||||
zend_string_release(Z_STR_P(arg));
|
zend_string_release(Z_STR_P(arg));
|
||||||
ZVAL_LONG(arg, lval);
|
ZVAL_LONG(arg, lval);
|
||||||
|
@ -894,7 +894,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modificati
|
||||||
ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name));
|
ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(zend_uchar type)
|
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(uint8_t type)
|
||||||
{
|
{
|
||||||
zend_type_error("Cannot use value of type %s as class constant name", zend_get_type_by_const(type));
|
zend_type_error("Cannot use value of type %s as class constant name", zend_get_type_by_const(type));
|
||||||
}
|
}
|
||||||
|
@ -2287,7 +2287,7 @@ static ZEND_COLD void zend_binary_assign_op_dim_slow(zval *container, zval *dim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static zend_never_inline zend_uchar slow_index_convert(HashTable *ht, const zval *dim, zend_value *value EXECUTE_DATA_DC)
|
static zend_never_inline uint8_t slow_index_convert(HashTable *ht, const zval *dim, zend_value *value EXECUTE_DATA_DC)
|
||||||
{
|
{
|
||||||
switch (Z_TYPE_P(dim)) {
|
switch (Z_TYPE_P(dim)) {
|
||||||
case IS_UNDEF: {
|
case IS_UNDEF: {
|
||||||
|
@ -2355,7 +2355,7 @@ static zend_never_inline zend_uchar slow_index_convert(HashTable *ht, const zval
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static zend_never_inline zend_uchar slow_index_convert_w(HashTable *ht, const zval *dim, zend_value *value EXECUTE_DATA_DC)
|
static zend_never_inline uint8_t slow_index_convert_w(HashTable *ht, const zval *dim, zend_value *value EXECUTE_DATA_DC)
|
||||||
{
|
{
|
||||||
switch (Z_TYPE_P(dim)) {
|
switch (Z_TYPE_P(dim)) {
|
||||||
case IS_UNDEF: {
|
case IS_UNDEF: {
|
||||||
|
@ -2490,7 +2490,7 @@ str_index:
|
||||||
goto try_again;
|
goto try_again;
|
||||||
} else {
|
} else {
|
||||||
zend_value val;
|
zend_value val;
|
||||||
zend_uchar t;
|
uint8_t t;
|
||||||
|
|
||||||
if (type != BP_VAR_W && type != BP_VAR_RW) {
|
if (type != BP_VAR_W && type != BP_VAR_RW) {
|
||||||
t = slow_index_convert(ht, dim, &val EXECUTE_DATA_CC);
|
t = slow_index_convert(ht, dim, &val EXECUTE_DATA_CC);
|
||||||
|
@ -2630,7 +2630,7 @@ fetch_from_array:
|
||||||
}
|
}
|
||||||
if (type != BP_VAR_UNSET) {
|
if (type != BP_VAR_UNSET) {
|
||||||
HashTable *ht = zend_new_array(0);
|
HashTable *ht = zend_new_array(0);
|
||||||
zend_uchar old_type = Z_TYPE_P(container);
|
uint8_t old_type = Z_TYPE_P(container);
|
||||||
|
|
||||||
ZVAL_ARR(container, ht);
|
ZVAL_ARR(container, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -3314,7 +3314,7 @@ static zend_never_inline zend_result zend_fetch_static_property_address_ex(zval
|
||||||
zend_class_entry *ce;
|
zend_class_entry *ce;
|
||||||
zend_property_info *property_info;
|
zend_property_info *property_info;
|
||||||
|
|
||||||
zend_uchar op1_type = opline->op1_type, op2_type = opline->op2_type;
|
uint8_t op1_type = opline->op1_type, op2_type = opline->op2_type;
|
||||||
|
|
||||||
if (EXPECTED(op2_type == IS_CONST)) {
|
if (EXPECTED(op2_type == IS_CONST)) {
|
||||||
zval *class_name = RT_CONSTANT(opline, opline->op2);
|
zval *class_name = RT_CONSTANT(opline, opline->op2);
|
||||||
|
@ -3471,7 +3471,7 @@ static zend_always_inline int i_zend_verify_type_assignable_zval(
|
||||||
const zend_property_info *info, const zval *zv, bool strict) {
|
const zend_property_info *info, const zval *zv, bool strict) {
|
||||||
zend_type type = info->type;
|
zend_type type = info->type;
|
||||||
uint32_t type_mask;
|
uint32_t type_mask;
|
||||||
zend_uchar zv_type = Z_TYPE_P(zv);
|
uint8_t zv_type = Z_TYPE_P(zv);
|
||||||
|
|
||||||
if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(type, zv_type))) {
|
if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(type, zv_type))) {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -3587,7 +3587,7 @@ static zend_always_inline void i_zval_ptr_dtor_noref(zval *zval_ptr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *orig_value, zend_uchar value_type, bool strict)
|
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *orig_value, uint8_t value_type, bool strict)
|
||||||
{
|
{
|
||||||
bool ret;
|
bool ret;
|
||||||
zval value;
|
zval value;
|
||||||
|
@ -4579,7 +4579,7 @@ ZEND_API HashTable *zend_unfinished_execution_gc_ex(zend_execute_data *execute_d
|
||||||
static void zend_swap_operands(zend_op *op) /* {{{ */
|
static void zend_swap_operands(zend_op *op) /* {{{ */
|
||||||
{
|
{
|
||||||
znode_op tmp;
|
znode_op tmp;
|
||||||
zend_uchar tmp_type;
|
uint8_t tmp_type;
|
||||||
|
|
||||||
tmp = op->op1;
|
tmp = op->op1;
|
||||||
tmp_type = op->op1_type;
|
tmp_type = op->op1_type;
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
#include "zend_operators.h"
|
#include "zend_operators.h"
|
||||||
#include "zend_variables.h"
|
#include "zend_variables.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
BEGIN_EXTERN_C()
|
BEGIN_EXTERN_C()
|
||||||
struct _zend_fcall_info;
|
struct _zend_fcall_info;
|
||||||
ZEND_API extern void (*zend_execute_ex)(zend_execute_data *execute_data);
|
ZEND_API extern void (*zend_execute_ex)(zend_execute_data *execute_data);
|
||||||
|
@ -82,7 +84,7 @@ ZEND_API ZEND_COLD void zend_wrong_string_offset_error(void);
|
||||||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error(const zend_property_info *info);
|
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error(const zend_property_info *info);
|
||||||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info);
|
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info);
|
||||||
|
|
||||||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(zend_uchar type);
|
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(uint8_t type);
|
||||||
|
|
||||||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info);
|
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info);
|
||||||
|
|
||||||
|
@ -118,9 +120,9 @@ ZEND_API bool zend_verify_internal_return_type(zend_function *zf, zval *ret);
|
||||||
ZEND_API void ZEND_FASTCALL zend_ref_add_type_source(zend_property_info_source_list *source_list, zend_property_info *prop);
|
ZEND_API void ZEND_FASTCALL zend_ref_add_type_source(zend_property_info_source_list *source_list, zend_property_info *prop);
|
||||||
ZEND_API void ZEND_FASTCALL zend_ref_del_type_source(zend_property_info_source_list *source_list, const zend_property_info *prop);
|
ZEND_API void ZEND_FASTCALL zend_ref_del_type_source(zend_property_info_source_list *source_list, const zend_property_info *prop);
|
||||||
|
|
||||||
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, zend_uchar value_type, bool strict);
|
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, uint8_t value_type, bool strict);
|
||||||
|
|
||||||
static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
|
static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *value, uint8_t value_type)
|
||||||
{
|
{
|
||||||
zend_refcounted *ref = NULL;
|
zend_refcounted *ref = NULL;
|
||||||
|
|
||||||
|
@ -147,7 +149,7 @@ static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type, bool strict)
|
static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, uint8_t value_type, bool strict)
|
||||||
{
|
{
|
||||||
do {
|
do {
|
||||||
if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
|
if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
|
||||||
|
@ -382,8 +384,8 @@ ZEND_API bool zend_gcc_global_regs(void);
|
||||||
|
|
||||||
#define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of returned opcode */
|
#define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of returned opcode */
|
||||||
|
|
||||||
ZEND_API int zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler_t handler);
|
ZEND_API int zend_set_user_opcode_handler(uint8_t opcode, user_opcode_handler_t handler);
|
||||||
ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode);
|
ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(uint8_t opcode);
|
||||||
|
|
||||||
ZEND_API zval *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode_op *node, const zend_execute_data *execute_data);
|
ZEND_API zval *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode_op *node, const zend_execute_data *execute_data);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#ifndef ZEND_GENERATORS_H
|
#ifndef ZEND_GENERATORS_H
|
||||||
#define ZEND_GENERATORS_H
|
#define ZEND_GENERATORS_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
BEGIN_EXTERN_C()
|
BEGIN_EXTERN_C()
|
||||||
|
|
||||||
extern ZEND_API zend_class_entry *zend_ce_generator;
|
extern ZEND_API zend_class_entry *zend_ce_generator;
|
||||||
|
@ -85,14 +87,14 @@ struct _zend_generator {
|
||||||
zend_execute_data execute_fake;
|
zend_execute_data execute_fake;
|
||||||
|
|
||||||
/* ZEND_GENERATOR_* flags */
|
/* ZEND_GENERATOR_* flags */
|
||||||
zend_uchar flags;
|
uint8_t flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const zend_uchar ZEND_GENERATOR_CURRENTLY_RUNNING = 0x1;
|
static const uint8_t ZEND_GENERATOR_CURRENTLY_RUNNING = 0x1;
|
||||||
static const zend_uchar ZEND_GENERATOR_FORCED_CLOSE = 0x2;
|
static const uint8_t ZEND_GENERATOR_FORCED_CLOSE = 0x2;
|
||||||
static const zend_uchar ZEND_GENERATOR_AT_FIRST_YIELD = 0x4;
|
static const uint8_t ZEND_GENERATOR_AT_FIRST_YIELD = 0x4;
|
||||||
static const zend_uchar ZEND_GENERATOR_DO_INIT = 0x8;
|
static const uint8_t ZEND_GENERATOR_DO_INIT = 0x8;
|
||||||
static const zend_uchar ZEND_GENERATOR_IN_FIBER = 0x10;
|
static const uint8_t ZEND_GENERATOR_IN_FIBER = 0x10;
|
||||||
|
|
||||||
void zend_register_generator_ce(void);
|
void zend_register_generator_ce(void);
|
||||||
ZEND_API void zend_generator_close(zend_generator *generator, bool finished_execution);
|
ZEND_API void zend_generator_close(zend_generator *generator, bool finished_execution);
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "zend_globals_macros.h"
|
#include "zend_globals_macros.h"
|
||||||
|
|
||||||
|
@ -93,7 +94,7 @@ struct _zend_compiler_globals {
|
||||||
HashTable *auto_globals;
|
HashTable *auto_globals;
|
||||||
|
|
||||||
/* Refer to zend_yytnamerr() in zend_language_parser.y for meaning of values */
|
/* Refer to zend_yytnamerr() in zend_language_parser.y for meaning of values */
|
||||||
zend_uchar parse_error;
|
uint8_t parse_error;
|
||||||
bool in_compilation;
|
bool in_compilation;
|
||||||
bool short_tags;
|
bool short_tags;
|
||||||
|
|
||||||
|
@ -244,7 +245,7 @@ struct _zend_executor_globals {
|
||||||
struct _zend_module_entry *current_module;
|
struct _zend_module_entry *current_module;
|
||||||
|
|
||||||
bool active;
|
bool active;
|
||||||
zend_uchar flags;
|
uint8_t flags;
|
||||||
|
|
||||||
zend_long assertions;
|
zend_long assertions;
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||||
|
|
||||||
static inline zend_result convert_to_number(zval *retval, const char *str, const int str_len)
|
static inline zend_result convert_to_number(zval *retval, const char *str, const int str_len)
|
||||||
{
|
{
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
int overflow;
|
int overflow;
|
||||||
zend_long lval;
|
zend_long lval;
|
||||||
double dval;
|
double dval;
|
||||||
|
|
|
@ -1664,7 +1664,7 @@ ZEND_API int zend_std_compare_objects(zval *o1, zval *o2) /* {{{ */
|
||||||
object_lhs = false;
|
object_lhs = false;
|
||||||
}
|
}
|
||||||
ZEND_ASSERT(Z_TYPE_P(value) != IS_OBJECT);
|
ZEND_ASSERT(Z_TYPE_P(value) != IS_OBJECT);
|
||||||
zend_uchar target_type = (Z_TYPE_P(value) == IS_FALSE || Z_TYPE_P(value) == IS_TRUE)
|
uint8_t target_type = (Z_TYPE_P(value) == IS_FALSE || Z_TYPE_P(value) == IS_TRUE)
|
||||||
? _IS_BOOL : Z_TYPE_P(value);
|
? _IS_BOOL : Z_TYPE_P(value);
|
||||||
if (Z_OBJ_HT_P(object)->cast_object(Z_OBJ_P(object), &casted, target_type) == FAILURE) {
|
if (Z_OBJ_HT_P(object)->cast_object(Z_OBJ_P(object), &casted, target_type) == FAILURE) {
|
||||||
// TODO: Less crazy.
|
// TODO: Less crazy.
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#ifndef ZEND_OBJECT_HANDLERS_H
|
#ifndef ZEND_OBJECT_HANDLERS_H
|
||||||
#define ZEND_OBJECT_HANDLERS_H
|
#define ZEND_OBJECT_HANDLERS_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
struct _zend_property_info;
|
struct _zend_property_info;
|
||||||
|
|
||||||
#define ZEND_WRONG_PROPERTY_INFO \
|
#define ZEND_WRONG_PROPERTY_INFO \
|
||||||
|
@ -154,7 +156,7 @@ typedef zend_result (*zend_object_get_closure_t)(zend_object *obj, zend_class_en
|
||||||
|
|
||||||
typedef HashTable *(*zend_object_get_gc_t)(zend_object *object, zval **table, int *n);
|
typedef HashTable *(*zend_object_get_gc_t)(zend_object *object, zval **table, int *n);
|
||||||
|
|
||||||
typedef zend_result (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval *op1, zval *op2);
|
typedef zend_result (*zend_object_do_operation_t)(uint8_t opcode, zval *result, zval *op1, zval *op2);
|
||||||
|
|
||||||
struct _zend_object_handlers {
|
struct _zend_object_handlers {
|
||||||
/* offset of real object header (usually zero) */
|
/* offset of real object header (usually zero) */
|
||||||
|
|
|
@ -45,7 +45,7 @@ static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size)
|
void init_op_array(zend_op_array *op_array, uint8_t type, int initial_ops_size)
|
||||||
{
|
{
|
||||||
op_array->type = type;
|
op_array->type = type;
|
||||||
op_array->arg_flags[0] = 0;
|
op_array->arg_flags[0] = 0;
|
||||||
|
|
|
@ -371,7 +371,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(zval *op, bo
|
||||||
}
|
}
|
||||||
case IS_STRING:
|
case IS_STRING:
|
||||||
{
|
{
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
zend_long lval;
|
zend_long lval;
|
||||||
double dval;
|
double dval;
|
||||||
bool trailing_data = false;
|
bool trailing_data = false;
|
||||||
|
@ -891,7 +891,7 @@ try_again:
|
||||||
}
|
}
|
||||||
case IS_STRING:
|
case IS_STRING:
|
||||||
{
|
{
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
zend_long lval;
|
zend_long lval;
|
||||||
double dval;
|
double dval;
|
||||||
if (0 == (type = is_numeric_string(Z_STRVAL_P(op), Z_STRLEN_P(op), &lval, &dval, true))) {
|
if (0 == (type = is_numeric_string(Z_STRVAL_P(op), Z_STRLEN_P(op), &lval, &dval, true))) {
|
||||||
|
@ -1054,7 +1054,7 @@ static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zva
|
||||||
|
|
||||||
static zend_always_inline zend_result add_function_fast(zval *result, zval *op1, zval *op2) /* {{{ */
|
static zend_always_inline zend_result add_function_fast(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
uint8_t type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
||||||
|
|
||||||
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
||||||
fast_long_add_function(result, op1, op2);
|
fast_long_add_function(result, op1, op2);
|
||||||
|
@ -1120,7 +1120,7 @@ ZEND_API zend_result ZEND_FASTCALL add_function(zval *result, zval *op1, zval *o
|
||||||
|
|
||||||
static zend_always_inline zend_result sub_function_fast(zval *result, zval *op1, zval *op2) /* {{{ */
|
static zend_always_inline zend_result sub_function_fast(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
uint8_t type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
||||||
|
|
||||||
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
||||||
fast_long_sub_function(result, op1, op2);
|
fast_long_sub_function(result, op1, op2);
|
||||||
|
@ -1185,7 +1185,7 @@ ZEND_API zend_result ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *o
|
||||||
|
|
||||||
static zend_always_inline zend_result mul_function_fast(zval *result, zval *op1, zval *op2) /* {{{ */
|
static zend_always_inline zend_result mul_function_fast(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
uint8_t type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
||||||
|
|
||||||
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
||||||
zend_long overflow;
|
zend_long overflow;
|
||||||
|
@ -1254,7 +1254,7 @@ ZEND_API zend_result ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *o
|
||||||
|
|
||||||
static zend_result ZEND_FASTCALL pow_function_base(zval *result, zval *op1, zval *op2) /* {{{ */
|
static zend_result ZEND_FASTCALL pow_function_base(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
uint8_t type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
||||||
|
|
||||||
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
||||||
if (Z_LVAL_P(op2) >= 0) {
|
if (Z_LVAL_P(op2) >= 0) {
|
||||||
|
@ -1347,7 +1347,7 @@ ZEND_API zend_result ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *o
|
||||||
#define DIV_BY_ZERO 2
|
#define DIV_BY_ZERO 2
|
||||||
static int ZEND_FASTCALL div_function_base(zval *result, zval *op1, zval *op2) /* {{{ */
|
static int ZEND_FASTCALL div_function_base(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
uint8_t type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
|
||||||
|
|
||||||
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
if (EXPECTED(type_pair == TYPE_PAIR(IS_LONG, IS_LONG))) {
|
||||||
if (Z_LVAL_P(op2) == 0) {
|
if (Z_LVAL_P(op2) == 0) {
|
||||||
|
@ -2118,7 +2118,7 @@ static int compare_long_to_string(zend_long lval, zend_string *str) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_long str_lval;
|
zend_long str_lval;
|
||||||
double str_dval;
|
double str_dval;
|
||||||
zend_uchar type = is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), &str_lval, &str_dval, 0);
|
uint8_t type = is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), &str_lval, &str_dval, 0);
|
||||||
|
|
||||||
if (type == IS_LONG) {
|
if (type == IS_LONG) {
|
||||||
return lval > str_lval ? 1 : lval < str_lval ? -1 : 0;
|
return lval > str_lval ? 1 : lval < str_lval ? -1 : 0;
|
||||||
|
@ -2141,7 +2141,7 @@ static int compare_double_to_string(double dval, zend_string *str) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_long str_lval;
|
zend_long str_lval;
|
||||||
double str_dval;
|
double str_dval;
|
||||||
zend_uchar type = is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), &str_lval, &str_dval, 0);
|
uint8_t type = is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), &str_lval, &str_dval, 0);
|
||||||
|
|
||||||
if (type == IS_LONG) {
|
if (type == IS_LONG) {
|
||||||
double diff = dval - (double) str_lval;
|
double diff = dval - (double) str_lval;
|
||||||
|
@ -3110,7 +3110,7 @@ ZEND_API int ZEND_FASTCALL zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3
|
||||||
|
|
||||||
ZEND_API bool ZEND_FASTCALL zendi_smart_streq(zend_string *s1, zend_string *s2) /* {{{ */
|
ZEND_API bool ZEND_FASTCALL zendi_smart_streq(zend_string *s1, zend_string *s2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_uchar ret1, ret2;
|
uint8_t ret1, ret2;
|
||||||
int oflow1, oflow2;
|
int oflow1, oflow2;
|
||||||
zend_long lval1 = 0, lval2 = 0;
|
zend_long lval1 = 0, lval2 = 0;
|
||||||
double dval1 = 0.0, dval2 = 0.0;
|
double dval1 = 0.0, dval2 = 0.0;
|
||||||
|
@ -3158,7 +3158,7 @@ string_cmp:
|
||||||
|
|
||||||
ZEND_API int ZEND_FASTCALL zendi_smart_strcmp(zend_string *s1, zend_string *s2) /* {{{ */
|
ZEND_API int ZEND_FASTCALL zendi_smart_strcmp(zend_string *s1, zend_string *s2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_uchar ret1, ret2;
|
uint8_t ret1, ret2;
|
||||||
int oflow1, oflow2;
|
int oflow1, oflow2;
|
||||||
zend_long lval1 = 0, lval2 = 0;
|
zend_long lval1 = 0, lval2 = 0;
|
||||||
double dval1 = 0.0, dval2 = 0.0;
|
double dval1 = 0.0, dval2 = 0.0;
|
||||||
|
@ -3334,19 +3334,19 @@ ZEND_API zend_string* ZEND_FASTCALL zend_double_to_str(double num)
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_API zend_uchar ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval) /* {{{ */
|
ZEND_API uint8_t ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval) /* {{{ */
|
||||||
{
|
{
|
||||||
return is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), lval, dval, false);
|
return is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), lval, dval, false);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
ZEND_API zend_uchar ZEND_FASTCALL _is_numeric_string_ex(const char *str, size_t length, zend_long *lval,
|
ZEND_API uint8_t ZEND_FASTCALL _is_numeric_string_ex(const char *str, size_t length, zend_long *lval,
|
||||||
double *dval, bool allow_errors, int *oflow_info, bool *trailing_data) /* {{{ */
|
double *dval, bool allow_errors, int *oflow_info, bool *trailing_data) /* {{{ */
|
||||||
{
|
{
|
||||||
const char *ptr;
|
const char *ptr;
|
||||||
int digits = 0, dp_or_e = 0;
|
int digits = 0, dp_or_e = 0;
|
||||||
double local_dval = 0.0;
|
double local_dval = 0.0;
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
zend_ulong tmp_lval = 0;
|
zend_ulong tmp_lval = 0;
|
||||||
int neg = 0;
|
int neg = 0;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef HAVE_IEEEFP_H
|
#ifdef HAVE_IEEEFP_H
|
||||||
#include <ieeefp.h>
|
#include <ieeefp.h>
|
||||||
|
@ -88,7 +89,7 @@ static zend_always_inline bool instanceof_function(
|
||||||
* could not be represented as such due to overflow. It writes 1 to oflow_info
|
* could not be represented as such due to overflow. It writes 1 to oflow_info
|
||||||
* if the integer is larger than ZEND_LONG_MAX and -1 if it's smaller than ZEND_LONG_MIN.
|
* if the integer is larger than ZEND_LONG_MAX and -1 if it's smaller than ZEND_LONG_MIN.
|
||||||
*/
|
*/
|
||||||
ZEND_API zend_uchar ZEND_FASTCALL _is_numeric_string_ex(const char *str, size_t length, zend_long *lval,
|
ZEND_API uint8_t ZEND_FASTCALL _is_numeric_string_ex(const char *str, size_t length, zend_long *lval,
|
||||||
double *dval, bool allow_errors, int *oflow_info, bool *trailing_data);
|
double *dval, bool allow_errors, int *oflow_info, bool *trailing_data);
|
||||||
|
|
||||||
ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end);
|
ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end);
|
||||||
|
@ -144,7 +145,7 @@ static zend_always_inline zend_long zend_dval_to_lval_safe(double d)
|
||||||
#define ZEND_IS_DIGIT(c) ((c) >= '0' && (c) <= '9')
|
#define ZEND_IS_DIGIT(c) ((c) >= '0' && (c) <= '9')
|
||||||
#define ZEND_IS_XDIGIT(c) (((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))
|
#define ZEND_IS_XDIGIT(c) (((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))
|
||||||
|
|
||||||
static zend_always_inline zend_uchar is_numeric_string_ex(const char *str, size_t length, zend_long *lval,
|
static zend_always_inline uint8_t is_numeric_string_ex(const char *str, size_t length, zend_long *lval,
|
||||||
double *dval, bool allow_errors, int *oflow_info, bool *trailing_data)
|
double *dval, bool allow_errors, int *oflow_info, bool *trailing_data)
|
||||||
{
|
{
|
||||||
if (*str > '9') {
|
if (*str > '9') {
|
||||||
|
@ -153,11 +154,11 @@ static zend_always_inline zend_uchar is_numeric_string_ex(const char *str, size_
|
||||||
return _is_numeric_string_ex(str, length, lval, dval, allow_errors, oflow_info, trailing_data);
|
return _is_numeric_string_ex(str, length, lval, dval, allow_errors, oflow_info, trailing_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static zend_always_inline zend_uchar is_numeric_string(const char *str, size_t length, zend_long *lval, double *dval, bool allow_errors) {
|
static zend_always_inline uint8_t is_numeric_string(const char *str, size_t length, zend_long *lval, double *dval, bool allow_errors) {
|
||||||
return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL, NULL);
|
return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_API zend_uchar ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval);
|
ZEND_API uint8_t ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval);
|
||||||
|
|
||||||
static zend_always_inline const char *
|
static zend_always_inline const char *
|
||||||
zend_memnstr(const char *haystack, const char *needle, size_t needle_len, const char *end)
|
zend_memnstr(const char *haystack, const char *needle, size_t needle_len, const char *end)
|
||||||
|
|
|
@ -57,7 +57,7 @@ typedef struct _zend_file_handle {
|
||||||
} handle;
|
} handle;
|
||||||
zend_string *filename;
|
zend_string *filename;
|
||||||
zend_string *opened_path;
|
zend_string *opened_path;
|
||||||
zend_uchar type; /* packed zend_stream_type */
|
uint8_t type; /* packed zend_stream_type */
|
||||||
bool primary_script;
|
bool primary_script;
|
||||||
bool in_list; /* added into CG(open_file) */
|
bool in_list; /* added into CG(open_file) */
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
|
@ -63,7 +63,7 @@ void zend_startup_system_id(void)
|
||||||
void zend_finalize_system_id(void)
|
void zend_finalize_system_id(void)
|
||||||
{
|
{
|
||||||
unsigned char digest[16];
|
unsigned char digest[16];
|
||||||
zend_uchar hooks = 0;
|
uint8_t hooks = 0;
|
||||||
|
|
||||||
if (zend_ast_process) {
|
if (zend_ast_process) {
|
||||||
hooks |= ZEND_HOOK_AST_PROCESS;
|
hooks |= ZEND_HOOK_AST_PROCESS;
|
||||||
|
@ -80,7 +80,7 @@ void zend_finalize_system_id(void)
|
||||||
PHP_MD5Update(&context, &hooks, sizeof hooks);
|
PHP_MD5Update(&context, &hooks, sizeof hooks);
|
||||||
|
|
||||||
for (int16_t i = 0; i < 256; i++) {
|
for (int16_t i = 0; i < 256; i++) {
|
||||||
if (zend_get_user_opcode_handler((zend_uchar) i) != NULL) {
|
if (zend_get_user_opcode_handler((uint8_t) i) != NULL) {
|
||||||
PHP_MD5Update(&context, &i, sizeof i);
|
PHP_MD5Update(&context, &i, sizeof i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "zend_result.h"
|
#include "zend_result.h"
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef __SSE2__
|
#ifdef __SSE2__
|
||||||
# include <mmintrin.h>
|
# include <mmintrin.h>
|
||||||
|
@ -309,8 +310,8 @@ struct _zval_struct {
|
||||||
uint32_t type_info;
|
uint32_t type_info;
|
||||||
struct {
|
struct {
|
||||||
ZEND_ENDIAN_LOHI_3(
|
ZEND_ENDIAN_LOHI_3(
|
||||||
zend_uchar type, /* active type */
|
uint8_t type, /* active type */
|
||||||
zend_uchar type_flags,
|
uint8_t type_flags,
|
||||||
union {
|
union {
|
||||||
uint16_t extra; /* not further specified */
|
uint16_t extra; /* not further specified */
|
||||||
} u)
|
} u)
|
||||||
|
@ -361,10 +362,10 @@ struct _zend_array {
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
ZEND_ENDIAN_LOHI_4(
|
ZEND_ENDIAN_LOHI_4(
|
||||||
zend_uchar flags,
|
uint8_t flags,
|
||||||
zend_uchar _unused,
|
uint8_t _unused,
|
||||||
zend_uchar nIteratorsCount,
|
uint8_t nIteratorsCount,
|
||||||
zend_uchar _unused2)
|
uint8_t _unused2)
|
||||||
} v;
|
} v;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
} u;
|
} u;
|
||||||
|
@ -569,7 +570,7 @@ struct _zend_ast_ref {
|
||||||
#define _IS_BOOL 18
|
#define _IS_BOOL 18
|
||||||
#define _IS_NUMBER 19
|
#define _IS_NUMBER 19
|
||||||
|
|
||||||
static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
|
static zend_always_inline uint8_t zval_get_type(const zval* pz) {
|
||||||
return pz->u1.v.type;
|
return pz->u1.v.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,7 +639,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
|
||||||
#define GC_FLAGS_SHIFT 0
|
#define GC_FLAGS_SHIFT 0
|
||||||
#define GC_INFO_SHIFT 10
|
#define GC_INFO_SHIFT 10
|
||||||
|
|
||||||
static zend_always_inline zend_uchar zval_gc_type(uint32_t gc_type_info) {
|
static zend_always_inline uint8_t zval_gc_type(uint32_t gc_type_info) {
|
||||||
return (gc_type_info & GC_TYPE_MASK);
|
return (gc_type_info & GC_TYPE_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1170,7 +1171,7 @@ extern ZEND_API bool zend_rc_debug;
|
||||||
* Skip checks for OBJECT/NULL type to avoid interpreting the flag incorrectly. */
|
* Skip checks for OBJECT/NULL type to avoid interpreting the flag incorrectly. */
|
||||||
# define ZEND_RC_MOD_CHECK(p) do { \
|
# define ZEND_RC_MOD_CHECK(p) do { \
|
||||||
if (zend_rc_debug) { \
|
if (zend_rc_debug) { \
|
||||||
zend_uchar type = zval_gc_type((p)->u.type_info); \
|
uint8_t type = zval_gc_type((p)->u.type_info); \
|
||||||
if (type != IS_OBJECT && type != IS_NULL) { \
|
if (type != IS_OBJECT && type != IS_NULL) { \
|
||||||
ZEND_ASSERT(!(zval_gc_flags((p)->u.type_info) & GC_IMMUTABLE)); \
|
ZEND_ASSERT(!(zval_gc_flags((p)->u.type_info) & GC_IMMUTABLE)); \
|
||||||
ZEND_ASSERT((zval_gc_flags((p)->u.type_info) & (GC_PERSISTENT|GC_PERSISTENT_LOCAL)) != GC_PERSISTENT); \
|
ZEND_ASSERT((zval_gc_flags((p)->u.type_info) & (GC_PERSISTENT|GC_PERSISTENT_LOCAL)) != GC_PERSISTENT); \
|
||||||
|
|
|
@ -1216,7 +1216,7 @@ ZEND_VM_C_LABEL(assign_dim_op_new_array):
|
||||||
}
|
}
|
||||||
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||||
zend_uchar old_type;
|
uint8_t old_type;
|
||||||
|
|
||||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
||||||
ZVAL_UNDEFINED_OP1();
|
ZVAL_UNDEFINED_OP1();
|
||||||
|
@ -2654,7 +2654,7 @@ ZEND_VM_C_LABEL(try_assign_dim_array):
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -2960,7 +2960,7 @@ ZEND_VM_HOT_NOCONST_HANDLER(43, ZEND_JMPZ, CONST|TMPVAR|CV, JMP_ADDR)
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
zval *val;
|
zval *val;
|
||||||
zend_uchar op1_type;
|
uint8_t op1_type;
|
||||||
|
|
||||||
val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
|
val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
|
||||||
|
|
||||||
|
@ -2994,7 +2994,7 @@ ZEND_VM_HOT_NOCONST_HANDLER(44, ZEND_JMPNZ, CONST|TMPVAR|CV, JMP_ADDR)
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
zval *val;
|
zval *val;
|
||||||
zend_uchar op1_type;
|
uint8_t op1_type;
|
||||||
|
|
||||||
val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
|
val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
|
||||||
|
|
||||||
|
@ -8066,7 +8066,7 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
|
||||||
case ZEND_USER_OPCODE_DISPATCH:
|
case ZEND_USER_OPCODE_DISPATCH:
|
||||||
ZEND_VM_DISPATCH(opline->opcode, opline);
|
ZEND_VM_DISPATCH(opline->opcode, opline);
|
||||||
default:
|
default:
|
||||||
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
|
ZEND_VM_DISPATCH((uint8_t)(ret & 0xff), opline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
108
Zend/zend_vm_execute.h
generated
108
Zend/zend_vm_execute.h
generated
|
@ -287,7 +287,7 @@ static user_opcode_handler_t zend_user_opcode_handlers[256] = {
|
||||||
(user_opcode_handler_t)NULL
|
(user_opcode_handler_t)NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static zend_uchar zend_user_opcodes[256] = {0,
|
static uint8_t zend_user_opcodes[256] = {0,
|
||||||
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,
|
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,
|
||||||
17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,
|
17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,
|
||||||
33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,
|
33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,
|
||||||
|
@ -326,11 +326,11 @@ static const void * const * zend_opcode_handler_funcs;
|
||||||
static zend_op hybrid_halt_op;
|
static zend_op hybrid_halt_op;
|
||||||
#endif
|
#endif
|
||||||
#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC
|
#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC
|
||||||
static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);
|
static const void *zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
|
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
|
||||||
static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);
|
static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op* op);
|
||||||
#else
|
#else
|
||||||
# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler
|
# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler
|
||||||
#endif
|
#endif
|
||||||
|
@ -3278,7 +3278,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
|
||||||
case ZEND_USER_OPCODE_DISPATCH:
|
case ZEND_USER_OPCODE_DISPATCH:
|
||||||
ZEND_VM_DISPATCH(opline->opcode, opline);
|
ZEND_VM_DISPATCH(opline->opcode, opline);
|
||||||
default:
|
default:
|
||||||
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
|
ZEND_VM_DISPATCH((uint8_t)(ret & 0xff), opline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4141,7 +4141,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_H
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
zval *val;
|
zval *val;
|
||||||
zend_uchar op1_type;
|
uint8_t op1_type;
|
||||||
|
|
||||||
val = RT_CONSTANT(opline, opline->op1);
|
val = RT_CONSTANT(opline, opline->op1);
|
||||||
|
|
||||||
|
@ -4175,7 +4175,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
zval *val;
|
zval *val;
|
||||||
zend_uchar op1_type;
|
uint8_t op1_type;
|
||||||
|
|
||||||
val = RT_CONSTANT(opline, opline->op1);
|
val = RT_CONSTANT(opline, opline->op1);
|
||||||
|
|
||||||
|
@ -14424,7 +14424,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_SPEC_TMPVAR_H
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
zval *val;
|
zval *val;
|
||||||
zend_uchar op1_type;
|
uint8_t op1_type;
|
||||||
|
|
||||||
val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
||||||
|
|
||||||
|
@ -14458,7 +14458,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMPVAR_
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
zval *val;
|
zval *val;
|
||||||
zend_uchar op1_type;
|
uint8_t op1_type;
|
||||||
|
|
||||||
val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
||||||
|
|
||||||
|
@ -22900,7 +22900,7 @@ assign_dim_op_new_array:
|
||||||
}
|
}
|
||||||
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||||
zend_uchar old_type;
|
uint8_t old_type;
|
||||||
|
|
||||||
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
||||||
ZVAL_UNDEFINED_OP1();
|
ZVAL_UNDEFINED_OP1();
|
||||||
|
@ -23890,7 +23890,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -24039,7 +24039,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -24188,7 +24188,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -24336,7 +24336,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -25751,7 +25751,7 @@ assign_dim_op_new_array:
|
||||||
}
|
}
|
||||||
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||||
zend_uchar old_type;
|
uint8_t old_type;
|
||||||
|
|
||||||
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
||||||
ZVAL_UNDEFINED_OP1();
|
ZVAL_UNDEFINED_OP1();
|
||||||
|
@ -26746,7 +26746,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -26895,7 +26895,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -27044,7 +27044,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -27192,7 +27192,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -28079,7 +28079,7 @@ assign_dim_op_new_array:
|
||||||
}
|
}
|
||||||
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||||
zend_uchar old_type;
|
uint8_t old_type;
|
||||||
|
|
||||||
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
||||||
ZVAL_UNDEFINED_OP1();
|
ZVAL_UNDEFINED_OP1();
|
||||||
|
@ -28277,7 +28277,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -28426,7 +28426,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -28575,7 +28575,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -28723,7 +28723,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -29959,7 +29959,7 @@ assign_dim_op_new_array:
|
||||||
}
|
}
|
||||||
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||||
zend_uchar old_type;
|
uint8_t old_type;
|
||||||
|
|
||||||
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
||||||
ZVAL_UNDEFINED_OP1();
|
ZVAL_UNDEFINED_OP1();
|
||||||
|
@ -30949,7 +30949,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -31098,7 +31098,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -31247,7 +31247,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -31395,7 +31395,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -38866,7 +38866,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_SPEC_CV_HANDL
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
zval *val;
|
zval *val;
|
||||||
zend_uchar op1_type;
|
uint8_t op1_type;
|
||||||
|
|
||||||
val = EX_VAR(opline->op1.var);
|
val = EX_VAR(opline->op1.var);
|
||||||
|
|
||||||
|
@ -38900,7 +38900,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_SPEC_CV_HAND
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
zval *val;
|
zval *val;
|
||||||
zend_uchar op1_type;
|
uint8_t op1_type;
|
||||||
|
|
||||||
val = EX_VAR(opline->op1.var);
|
val = EX_VAR(opline->op1.var);
|
||||||
|
|
||||||
|
@ -40935,7 +40935,7 @@ assign_dim_op_new_array:
|
||||||
}
|
}
|
||||||
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||||
zend_uchar old_type;
|
uint8_t old_type;
|
||||||
|
|
||||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
||||||
ZVAL_UNDEFINED_OP1();
|
ZVAL_UNDEFINED_OP1();
|
||||||
|
@ -42196,7 +42196,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -42345,7 +42345,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -42494,7 +42494,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -42642,7 +42642,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -44725,7 +44725,7 @@ assign_dim_op_new_array:
|
||||||
}
|
}
|
||||||
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||||
zend_uchar old_type;
|
uint8_t old_type;
|
||||||
|
|
||||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
||||||
ZVAL_UNDEFINED_OP1();
|
ZVAL_UNDEFINED_OP1();
|
||||||
|
@ -45985,7 +45985,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -46134,7 +46134,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -46283,7 +46283,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -46431,7 +46431,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -47642,7 +47642,7 @@ assign_dim_op_new_array:
|
||||||
}
|
}
|
||||||
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||||
zend_uchar old_type;
|
uint8_t old_type;
|
||||||
|
|
||||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
||||||
ZVAL_UNDEFINED_OP1();
|
ZVAL_UNDEFINED_OP1();
|
||||||
|
@ -47968,7 +47968,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -48117,7 +48117,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -48266,7 +48266,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -48414,7 +48414,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -50057,7 +50057,7 @@ assign_dim_op_new_array:
|
||||||
}
|
}
|
||||||
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||||
zend_uchar old_type;
|
uint8_t old_type;
|
||||||
|
|
||||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
|
||||||
ZVAL_UNDEFINED_OP1();
|
ZVAL_UNDEFINED_OP1();
|
||||||
|
@ -51313,7 +51313,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -51462,7 +51462,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -51611,7 +51611,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -51759,7 +51759,7 @@ try_assign_dim_array:
|
||||||
UNDEF_RESULT();
|
UNDEF_RESULT();
|
||||||
} else {
|
} else {
|
||||||
HashTable *ht = zend_new_array(8);
|
HashTable *ht = zend_new_array(8);
|
||||||
zend_uchar old_type = Z_TYPE_P(object_ptr);
|
uint8_t old_type = Z_TYPE_P(object_ptr);
|
||||||
|
|
||||||
ZVAL_ARR(object_ptr, ht);
|
ZVAL_ARR(object_ptr, ht);
|
||||||
if (UNEXPECTED(old_type == IS_FALSE)) {
|
if (UNEXPECTED(old_type == IS_FALSE)) {
|
||||||
|
@ -64805,14 +64805,14 @@ static uint32_t ZEND_FASTCALL zend_vm_get_opcode_handler_idx(uint32_t spec, cons
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC
|
#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC
|
||||||
static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)
|
static const void *zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op)
|
||||||
{
|
{
|
||||||
return zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[opcode], op)];
|
return zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[opcode], op)];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID
|
#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID
|
||||||
static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op)
|
static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op* op)
|
||||||
{
|
{
|
||||||
uint32_t spec = zend_spec_handlers[opcode];
|
uint32_t spec = zend_spec_handlers[opcode];
|
||||||
return zend_opcode_handler_funcs[zend_vm_get_opcode_handler_idx(spec, op)];
|
return zend_opcode_handler_funcs[zend_vm_get_opcode_handler_idx(spec, op)];
|
||||||
|
@ -64822,7 +64822,7 @@ static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend
|
||||||
|
|
||||||
ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)
|
ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)
|
||||||
{
|
{
|
||||||
zend_uchar opcode = zend_user_opcodes[op->opcode];
|
uint8_t opcode = zend_user_opcodes[op->opcode];
|
||||||
|
|
||||||
if (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {
|
if (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {
|
||||||
if (op->op1_type < op->op2_type) {
|
if (op->op1_type < op->op2_type) {
|
||||||
|
@ -64834,7 +64834,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)
|
||||||
|
|
||||||
ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_info, uint32_t res_info)
|
ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_info, uint32_t res_info)
|
||||||
{
|
{
|
||||||
zend_uchar opcode = zend_user_opcodes[op->opcode];
|
uint8_t opcode = zend_user_opcodes[op->opcode];
|
||||||
uint32_t spec = zend_spec_handlers[opcode];
|
uint32_t spec = zend_spec_handlers[opcode];
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case ZEND_ADD:
|
case ZEND_ADD:
|
||||||
|
|
|
@ -1819,11 +1819,11 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
|
||||||
out($f,"#endif\n");
|
out($f,"#endif\n");
|
||||||
}
|
}
|
||||||
out($f,"#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
|
out($f,"#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
|
||||||
out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n");
|
out($f,"static const void *zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op);\n");
|
||||||
out($f,"#endif\n\n");
|
out($f,"#endif\n\n");
|
||||||
if ($kind == ZEND_VM_KIND_HYBRID) {
|
if ($kind == ZEND_VM_KIND_HYBRID) {
|
||||||
out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
|
out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
|
||||||
out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);\n");
|
out($f,"static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op* op);\n");
|
||||||
out($f,"#else\n");
|
out($f,"#else\n");
|
||||||
out($f,"# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler\n");
|
out($f,"# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler\n");
|
||||||
out($f,"#endif\n\n");
|
out($f,"#endif\n\n");
|
||||||
|
@ -2350,9 +2350,9 @@ function gen_vm_opcodes_header(
|
||||||
$str .= "#define ZEND_VM_OP2_FLAGS(flags) ((flags >> 8) & 0xff)\n";
|
$str .= "#define ZEND_VM_OP2_FLAGS(flags) ((flags >> 8) & 0xff)\n";
|
||||||
$str .= "\n";
|
$str .= "\n";
|
||||||
$str .= "BEGIN_EXTERN_C()\n\n";
|
$str .= "BEGIN_EXTERN_C()\n\n";
|
||||||
$str .= "ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode);\n";
|
$str .= "ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(uint8_t opcode);\n";
|
||||||
$str .= "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode);\n";
|
$str .= "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(uint8_t opcode);\n";
|
||||||
$str .= "ZEND_API zend_uchar zend_get_opcode_id(const char *name, size_t length);\n\n";
|
$str .= "ZEND_API uint8_t zend_get_opcode_id(const char *name, size_t length);\n\n";
|
||||||
$str .= "END_EXTERN_C()\n\n";
|
$str .= "END_EXTERN_C()\n\n";
|
||||||
|
|
||||||
$code_len = strlen((string) $max_opcode);
|
$code_len = strlen((string) $max_opcode);
|
||||||
|
@ -2636,22 +2636,22 @@ function gen_vm($def, $skel) {
|
||||||
}
|
}
|
||||||
fputs($f, "};\n\n");
|
fputs($f, "};\n\n");
|
||||||
|
|
||||||
fputs($f, "ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode) {\n");
|
fputs($f, "ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(uint8_t opcode) {\n");
|
||||||
fputs($f, "\tif (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {\n");
|
fputs($f, "\tif (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {\n");
|
||||||
fputs($f, "\t\treturn NULL;\n");
|
fputs($f, "\t\treturn NULL;\n");
|
||||||
fputs($f, "\t}\n");
|
fputs($f, "\t}\n");
|
||||||
fputs($f, "\treturn zend_vm_opcodes_names[opcode];\n");
|
fputs($f, "\treturn zend_vm_opcodes_names[opcode];\n");
|
||||||
fputs($f, "}\n");
|
fputs($f, "}\n");
|
||||||
|
|
||||||
fputs($f, "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode) {\n");
|
fputs($f, "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(uint8_t opcode) {\n");
|
||||||
fputs($f, "\tif (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {\n");
|
fputs($f, "\tif (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {\n");
|
||||||
fputs($f, "\t\topcode = ZEND_NOP;\n");
|
fputs($f, "\t\topcode = ZEND_NOP;\n");
|
||||||
fputs($f, "\t}\n");
|
fputs($f, "\t}\n");
|
||||||
fputs($f, "\treturn zend_vm_opcodes_flags[opcode];\n");
|
fputs($f, "\treturn zend_vm_opcodes_flags[opcode];\n");
|
||||||
fputs($f, "}\n");
|
fputs($f, "}\n");
|
||||||
|
|
||||||
fputs($f, "ZEND_API zend_uchar zend_get_opcode_id(const char *name, size_t length) {\n");
|
fputs($f, "ZEND_API uint8_t zend_get_opcode_id(const char *name, size_t length) {\n");
|
||||||
fputs($f, "\tzend_uchar opcode;\n");
|
fputs($f, "\tuint8_t opcode;\n");
|
||||||
fputs($f, "\tfor (opcode = 0; opcode < (sizeof(zend_vm_opcodes_names) / sizeof(zend_vm_opcodes_names[0])) - 1; opcode++) {\n");
|
fputs($f, "\tfor (opcode = 0; opcode < (sizeof(zend_vm_opcodes_names) / sizeof(zend_vm_opcodes_names[0])) - 1; opcode++) {\n");
|
||||||
fputs($f, "\t\tconst char *opcode_name = zend_vm_opcodes_names[opcode];\n");
|
fputs($f, "\t\tconst char *opcode_name = zend_vm_opcodes_names[opcode];\n");
|
||||||
fputs($f, "\t\tif (opcode_name && strncmp(opcode_name, name, length) == 0) {\n");
|
fputs($f, "\t\tif (opcode_name && strncmp(opcode_name, name, length) == 0) {\n");
|
||||||
|
@ -2699,7 +2699,7 @@ function gen_vm($def, $skel) {
|
||||||
}
|
}
|
||||||
out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
|
out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
|
||||||
|
|
||||||
out($f, "static zend_uchar zend_user_opcodes[256] = {");
|
out($f, "static uint8_t zend_user_opcodes[256] = {");
|
||||||
for ($i = 0; $i < 255; ++$i) {
|
for ($i = 0; $i < 255; ++$i) {
|
||||||
if ($i % 16 == 1) out($f, "\n\t");
|
if ($i % 16 == 1) out($f, "\n\t");
|
||||||
out($f, "$i,");
|
out($f, "$i,");
|
||||||
|
@ -2791,7 +2791,7 @@ function gen_vm($def, $skel) {
|
||||||
}
|
}
|
||||||
out($f, "}\n\n");
|
out($f, "}\n\n");
|
||||||
out($f, "#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
|
out($f, "#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
|
||||||
out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n");
|
out($f, "static const void *zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op)\n");
|
||||||
out($f, "{\n");
|
out($f, "{\n");
|
||||||
if (!ZEND_VM_SPEC) {
|
if (!ZEND_VM_SPEC) {
|
||||||
out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
|
out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
|
||||||
|
@ -2804,7 +2804,7 @@ function gen_vm($def, $skel) {
|
||||||
if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) {
|
if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) {
|
||||||
// Generate zend_vm_get_opcode_handler_func() function
|
// Generate zend_vm_get_opcode_handler_func() function
|
||||||
out($f, "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID\n");
|
out($f, "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID\n");
|
||||||
out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op)\n");
|
out($f,"static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op* op)\n");
|
||||||
out($f, "{\n");
|
out($f, "{\n");
|
||||||
out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
|
out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
|
||||||
if (!ZEND_VM_SPEC) {
|
if (!ZEND_VM_SPEC) {
|
||||||
|
@ -2819,7 +2819,7 @@ function gen_vm($def, $skel) {
|
||||||
// Generate zend_vm_get_opcode_handler() function
|
// Generate zend_vm_get_opcode_handler() function
|
||||||
out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)\n");
|
out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)\n");
|
||||||
out($f, "{\n");
|
out($f, "{\n");
|
||||||
out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
|
out($f, "\tuint8_t opcode = zend_user_opcodes[op->opcode];\n");
|
||||||
if (!ZEND_VM_SPEC) {
|
if (!ZEND_VM_SPEC) {
|
||||||
out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
|
out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
|
||||||
} else {
|
} else {
|
||||||
|
@ -2836,7 +2836,7 @@ function gen_vm($def, $skel) {
|
||||||
// Generate zend_vm_set_opcode_handler_ex() function
|
// Generate zend_vm_set_opcode_handler_ex() function
|
||||||
out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_info, uint32_t res_info)\n");
|
out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_info, uint32_t res_info)\n");
|
||||||
out($f, "{\n");
|
out($f, "{\n");
|
||||||
out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
|
out($f, "\tuint8_t opcode = zend_user_opcodes[op->opcode];\n");
|
||||||
if (!ZEND_VM_SPEC) {
|
if (!ZEND_VM_SPEC) {
|
||||||
out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
|
out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -434,20 +434,20 @@ static uint32_t zend_vm_opcodes_flags[203] = {
|
||||||
0x00000101,
|
0x00000101,
|
||||||
};
|
};
|
||||||
|
|
||||||
ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode) {
|
ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(uint8_t opcode) {
|
||||||
if (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {
|
if (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return zend_vm_opcodes_names[opcode];
|
return zend_vm_opcodes_names[opcode];
|
||||||
}
|
}
|
||||||
ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode) {
|
ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(uint8_t opcode) {
|
||||||
if (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {
|
if (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {
|
||||||
opcode = ZEND_NOP;
|
opcode = ZEND_NOP;
|
||||||
}
|
}
|
||||||
return zend_vm_opcodes_flags[opcode];
|
return zend_vm_opcodes_flags[opcode];
|
||||||
}
|
}
|
||||||
ZEND_API zend_uchar zend_get_opcode_id(const char *name, size_t length) {
|
ZEND_API uint8_t zend_get_opcode_id(const char *name, size_t length) {
|
||||||
zend_uchar opcode;
|
uint8_t opcode;
|
||||||
for (opcode = 0; opcode < (sizeof(zend_vm_opcodes_names) / sizeof(zend_vm_opcodes_names[0])) - 1; opcode++) {
|
for (opcode = 0; opcode < (sizeof(zend_vm_opcodes_names) / sizeof(zend_vm_opcodes_names[0])) - 1; opcode++) {
|
||||||
const char *opcode_name = zend_vm_opcodes_names[opcode];
|
const char *opcode_name = zend_vm_opcodes_names[opcode];
|
||||||
if (opcode_name && strncmp(opcode_name, name, length) == 0) {
|
if (opcode_name && strncmp(opcode_name, name, length) == 0) {
|
||||||
|
|
|
@ -77,9 +77,9 @@
|
||||||
|
|
||||||
BEGIN_EXTERN_C()
|
BEGIN_EXTERN_C()
|
||||||
|
|
||||||
ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode);
|
ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(uint8_t opcode);
|
||||||
ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode);
|
ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(uint8_t opcode);
|
||||||
ZEND_API zend_uchar zend_get_opcode_id(const char *name, size_t length);
|
ZEND_API uint8_t zend_get_opcode_id(const char *name, size_t length);
|
||||||
|
|
||||||
END_EXTERN_C()
|
END_EXTERN_C()
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ bogus:
|
||||||
static void php_com_variant_from_zval_ex(VARIANT *v, zval *z, int codepage, VARTYPE vt)
|
static void php_com_variant_from_zval_ex(VARIANT *v, zval *z, int codepage, VARTYPE vt)
|
||||||
{
|
{
|
||||||
php_com_dotnet_object *obj;
|
php_com_dotnet_object *obj;
|
||||||
zend_uchar ztype = IS_NULL;
|
uint8_t ztype = IS_NULL;
|
||||||
|
|
||||||
if (z) {
|
if (z) {
|
||||||
ZVAL_DEREF(z);
|
ZVAL_DEREF(z);
|
||||||
|
|
|
@ -1838,7 +1838,7 @@ static zend_object* zend_ffi_add(zend_ffi_cdata *base_cdata, zend_ffi_type *base
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static zend_result zend_ffi_cdata_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2) /* {{{ */
|
static zend_result zend_ffi_cdata_do_operation(uint8_t opcode, zval *result, zval *op1, zval *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zend_long offset;
|
zend_long offset;
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,7 @@ static zend_object *gmp_clone_obj(zend_object *obj) /* {{{ */
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zval *op1, zval *op2, zend_uchar opcode) {
|
static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zval *op1, zval *op2, uint8_t opcode) {
|
||||||
zend_long shift = zval_get_long(op2);
|
zend_long shift = zval_get_long(op2);
|
||||||
|
|
||||||
if (shift < 0) {
|
if (shift < 0) {
|
||||||
|
@ -370,7 +370,7 @@ static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zva
|
||||||
} \
|
} \
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
|
||||||
static zend_result gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval *op2) /* {{{ */
|
static zend_result gmp_do_operation_ex(uint8_t opcode, zval *result, zval *op1, zval *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case ZEND_ADD:
|
case ZEND_ADD:
|
||||||
|
@ -407,7 +407,7 @@ static zend_result gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static zend_result gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2) /* {{{ */
|
static zend_result gmp_do_operation(uint8_t opcode, zval *result, zval *op1, zval *op2) /* {{{ */
|
||||||
{
|
{
|
||||||
zval op1_copy;
|
zval op1_copy;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
|
@ -308,7 +308,7 @@ zval* collator_convert_string_to_double( zval* str, zval *rv )
|
||||||
*/
|
*/
|
||||||
zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv )
|
zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv )
|
||||||
{
|
{
|
||||||
zend_uchar is_numeric = 0;
|
uint8_t is_numeric = 0;
|
||||||
zend_long lval = 0;
|
zend_long lval = 0;
|
||||||
double dval = 0;
|
double dval = 0;
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,7 @@ static zend_long collator_u_strtol(const UChar *nptr, UChar **endptr, int base)
|
||||||
/* {{{ collator_is_numeric]
|
/* {{{ collator_is_numeric]
|
||||||
* Taken from PHP6:is_numeric_unicode()
|
* Taken from PHP6:is_numeric_unicode()
|
||||||
*/
|
*/
|
||||||
zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, bool allow_errors )
|
uint8_t collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, bool allow_errors )
|
||||||
{
|
{
|
||||||
zend_long local_lval;
|
zend_long local_lval;
|
||||||
double local_dval;
|
double local_dval;
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
|
|
||||||
#include <php.h>
|
#include <php.h>
|
||||||
#include <unicode/uchar.h>
|
#include <unicode/uchar.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, bool allow_errors );
|
uint8_t collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, bool allow_errors );
|
||||||
|
|
||||||
#endif // COLLATOR_IS_NUMERIC_H
|
#endif // COLLATOR_IS_NUMERIC_H
|
||||||
|
|
|
@ -91,7 +91,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int num_vars, zval *a
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_vars; i++) {
|
for (i = 0; i < num_vars; i++) {
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
switch (types[i]) {
|
switch (types[i]) {
|
||||||
case 'd': /* Double */
|
case 'd': /* Double */
|
||||||
type = MYSQL_TYPE_DOUBLE;
|
type = MYSQL_TYPE_DOUBLE;
|
||||||
|
|
|
@ -150,7 +150,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
|
||||||
zend_jit_addr var_addr,
|
zend_jit_addr var_addr,
|
||||||
uint32_t var_info,
|
uint32_t var_info,
|
||||||
uint32_t var_def_info,
|
uint32_t var_def_info,
|
||||||
zend_uchar val_type,
|
uint8_t val_type,
|
||||||
zend_jit_addr val_addr,
|
zend_jit_addr val_addr,
|
||||||
uint32_t val_info,
|
uint32_t val_info,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -214,7 +214,7 @@ static bool zend_ival_is_last_use(const zend_lifetime_interval *ival, int use)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool zend_is_commutative(zend_uchar opcode)
|
static bool zend_is_commutative(uint8_t opcode)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
opcode == ZEND_ADD ||
|
opcode == ZEND_ADD ||
|
||||||
|
@ -2646,7 +2646,7 @@ static bool zend_jit_next_is_send_result(const zend_op *opline)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool zend_jit_supported_binary_op(zend_uchar op, uint32_t op1_info, uint32_t op2_info)
|
static bool zend_jit_supported_binary_op(uint8_t op, uint32_t op1_info, uint32_t op2_info)
|
||||||
{
|
{
|
||||||
if ((op1_info & MAY_BE_UNDEF) || (op2_info & MAY_BE_UNDEF)) {
|
if ((op1_info & MAY_BE_UNDEF) || (op2_info & MAY_BE_UNDEF)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -2685,7 +2685,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
|
||||||
zend_lifetime_interval **ra = NULL;
|
zend_lifetime_interval **ra = NULL;
|
||||||
bool is_terminated = 1; /* previous basic block is terminated by jump */
|
bool is_terminated = 1; /* previous basic block is terminated by jump */
|
||||||
bool recv_emitted = 0; /* emitted at least one RECV opcode */
|
bool recv_emitted = 0; /* emitted at least one RECV opcode */
|
||||||
zend_uchar smart_branch_opcode;
|
uint8_t smart_branch_opcode;
|
||||||
uint32_t target_label, target_label2;
|
uint32_t target_label, target_label2;
|
||||||
uint32_t op1_info, op1_def_info, op2_info, res_info, res_use_info;
|
uint32_t op1_info, op1_def_info, op2_info, res_info, res_use_info;
|
||||||
zend_jit_addr op1_addr, op1_def_addr, op2_addr, op2_def_addr, res_addr;
|
zend_jit_addr op1_addr, op1_def_addr, op2_addr, op2_def_addr, res_addr;
|
||||||
|
|
|
@ -1464,7 +1464,7 @@ static bool logical_immediate_p(uint64_t value, uint32_t reg_size)
|
||||||
|| do {
|
|| do {
|
||||||
|| if (!((var_info) & MAY_BE_GUARD)
|
|| if (!((var_info) & MAY_BE_GUARD)
|
||||||
|| && has_concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
|
|| && has_concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
|
||||||
|| zend_uchar type = concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
|
|| uint8_t type = concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
|
||||||
|| if (type == IS_STRING && !ZEND_DEBUG) {
|
|| if (type == IS_STRING && !ZEND_DEBUG) {
|
||||||
| EXT_CALL _efree, tmp_reg
|
| EXT_CALL _efree, tmp_reg
|
||||||
|| break;
|
|| break;
|
||||||
|
@ -3606,7 +3606,7 @@ static int zend_jit_load_var(dasm_State **Dst, uint32_t info, int var, zend_reg
|
||||||
return zend_jit_load_reg(Dst, src, dst, info);
|
return zend_jit_load_reg(Dst, src, dst, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_invalidate_var_if_necessary(dasm_State **Dst, zend_uchar op_type, zend_jit_addr addr, znode_op op)
|
static int zend_jit_invalidate_var_if_necessary(dasm_State **Dst, uint8_t op_type, zend_jit_addr addr, znode_op op)
|
||||||
{
|
{
|
||||||
if ((op_type & (IS_TMP_VAR|IS_VAR)) && Z_MODE(addr) == IS_REG && !Z_LOAD(addr) && !Z_STORE(addr)) {
|
if ((op_type & (IS_TMP_VAR|IS_VAR)) && Z_MODE(addr) == IS_REG && !Z_LOAD(addr) && !Z_STORE(addr)) {
|
||||||
zend_jit_addr dst = ZEND_ADDR_MEM_ZVAL(ZREG_FP, op.var);
|
zend_jit_addr dst = ZEND_ADDR_MEM_ZVAL(ZREG_FP, op.var);
|
||||||
|
@ -4001,7 +4001,7 @@ static int zend_jit_opline_uses_reg(const zend_op *opline, int8_t reg)
|
||||||
|
|
||||||
static int zend_jit_math_long_long(dasm_State **Dst,
|
static int zend_jit_math_long_long(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -4219,7 +4219,7 @@ static int zend_jit_math_long_long(dasm_State **Dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_math_long_double(dasm_State **Dst,
|
static int zend_jit_math_long_double(dasm_State **Dst,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -4252,7 +4252,7 @@ static int zend_jit_math_long_double(dasm_State **Dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_math_double_long(dasm_State **Dst,
|
static int zend_jit_math_double_long(dasm_State **Dst,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -4315,7 +4315,7 @@ static int zend_jit_math_double_long(dasm_State **Dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_math_double_double(dasm_State **Dst,
|
static int zend_jit_math_double_double(dasm_State **Dst,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -4376,12 +4376,12 @@ static int zend_jit_math_double_double(dasm_State **Dst,
|
||||||
|
|
||||||
static int zend_jit_math_helper(dasm_State **Dst,
|
static int zend_jit_math_helper(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_uchar op1_type,
|
uint8_t op1_type,
|
||||||
znode_op op1,
|
znode_op op1,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
uint32_t op1_info,
|
uint32_t op1_info,
|
||||||
zend_uchar op2_type,
|
uint8_t op2_type,
|
||||||
znode_op op2,
|
znode_op op2,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
uint32_t op2_info,
|
uint32_t op2_info,
|
||||||
|
@ -4654,13 +4654,13 @@ static int zend_jit_add_arrays(dasm_State **Dst, const zend_op *opline, uint32_t
|
||||||
|
|
||||||
static int zend_jit_long_math_helper(dasm_State **Dst,
|
static int zend_jit_long_math_helper(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_uchar op1_type,
|
uint8_t op1_type,
|
||||||
znode_op op1,
|
znode_op op1,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
uint32_t op1_info,
|
uint32_t op1_info,
|
||||||
zend_ssa_range *op1_range,
|
zend_ssa_range *op1_range,
|
||||||
zend_uchar op2_type,
|
uint8_t op2_type,
|
||||||
znode_op op2,
|
znode_op op2,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
uint32_t op2_info,
|
uint32_t op2_info,
|
||||||
|
@ -4995,11 +4995,11 @@ static int zend_jit_long_math(dasm_State **Dst, const zend_op *opline, uint32_t
|
||||||
|
|
||||||
static int zend_jit_concat_helper(dasm_State **Dst,
|
static int zend_jit_concat_helper(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar op1_type,
|
uint8_t op1_type,
|
||||||
znode_op op1,
|
znode_op op1,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
uint32_t op1_info,
|
uint32_t op1_info,
|
||||||
zend_uchar op2_type,
|
uint8_t op2_type,
|
||||||
znode_op op2,
|
znode_op op2,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
uint32_t op2_info,
|
uint32_t op2_info,
|
||||||
|
@ -5569,7 +5569,7 @@ static int zend_jit_simple_assign(dasm_State **Dst,
|
||||||
zend_jit_addr var_addr,
|
zend_jit_addr var_addr,
|
||||||
uint32_t var_info,
|
uint32_t var_info,
|
||||||
uint32_t var_def_info,
|
uint32_t var_def_info,
|
||||||
zend_uchar val_type,
|
uint8_t val_type,
|
||||||
zend_jit_addr val_addr,
|
zend_jit_addr val_addr,
|
||||||
uint32_t val_info,
|
uint32_t val_info,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -5727,7 +5727,7 @@ static int zend_jit_simple_assign(dasm_State **Dst,
|
||||||
|
|
||||||
static int zend_jit_assign_to_typed_ref(dasm_State **Dst,
|
static int zend_jit_assign_to_typed_ref(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar val_type,
|
uint8_t val_type,
|
||||||
zend_jit_addr val_addr,
|
zend_jit_addr val_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
bool check_exception)
|
bool check_exception)
|
||||||
|
@ -5779,7 +5779,7 @@ static int zend_jit_assign_to_variable_call(dasm_State **Dst,
|
||||||
zend_jit_addr var_addr,
|
zend_jit_addr var_addr,
|
||||||
uint32_t __var_info,
|
uint32_t __var_info,
|
||||||
uint32_t __var_def_info,
|
uint32_t __var_def_info,
|
||||||
zend_uchar val_type,
|
uint8_t val_type,
|
||||||
zend_jit_addr val_addr,
|
zend_jit_addr val_addr,
|
||||||
uint32_t val_info,
|
uint32_t val_info,
|
||||||
zend_jit_addr __res_addr,
|
zend_jit_addr __res_addr,
|
||||||
|
@ -5862,7 +5862,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
|
||||||
zend_jit_addr var_addr,
|
zend_jit_addr var_addr,
|
||||||
uint32_t var_info,
|
uint32_t var_info,
|
||||||
uint32_t var_def_info,
|
uint32_t var_def_info,
|
||||||
zend_uchar val_type,
|
uint8_t val_type,
|
||||||
zend_jit_addr val_addr,
|
zend_jit_addr val_addr,
|
||||||
uint32_t val_info,
|
uint32_t val_info,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -6536,7 +6536,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst,
|
||||||
zend_ssa_range *op2_range,
|
zend_ssa_range *op2_range,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
zend_uchar smart_branch_opcode,
|
uint8_t smart_branch_opcode,
|
||||||
uint32_t target_label,
|
uint32_t target_label,
|
||||||
uint32_t target_label2,
|
uint32_t target_label2,
|
||||||
const void *exit_addr,
|
const void *exit_addr,
|
||||||
|
@ -6796,7 +6796,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, bool swap, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, bool swap, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
if (smart_branch_opcode) {
|
if (smart_branch_opcode) {
|
||||||
if (smart_branch_opcode == ZEND_JMPZ) {
|
if (smart_branch_opcode == ZEND_JMPZ) {
|
||||||
|
@ -7095,7 +7095,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_long_double(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_long_double(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
zend_reg tmp_reg = ZREG_FPR0;
|
zend_reg tmp_reg = ZREG_FPR0;
|
||||||
|
|
||||||
|
@ -7105,7 +7105,7 @@ static int zend_jit_cmp_long_double(dasm_State **Dst, const zend_op *opline, zen
|
||||||
return zend_jit_cmp_double_common(Dst, opline, res_addr, 0, smart_branch_opcode, target_label, target_label2, exit_addr);
|
return zend_jit_cmp_double_common(Dst, opline, res_addr, 0, smart_branch_opcode, target_label, target_label2, exit_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_double_long(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_double_long(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
zend_reg tmp_reg = ZREG_FPR0;
|
zend_reg tmp_reg = ZREG_FPR0;
|
||||||
|
|
||||||
|
@ -7115,7 +7115,7 @@ static int zend_jit_cmp_double_long(dasm_State **Dst, const zend_op *opline, zen
|
||||||
return zend_jit_cmp_double_common(Dst, opline, res_addr, /* swap */ 1, smart_branch_opcode, target_label, target_label2, exit_addr);
|
return zend_jit_cmp_double_common(Dst, opline, res_addr, /* swap */ 1, smart_branch_opcode, target_label, target_label2, exit_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_double_double(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_double_double(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
bool swap = 0;
|
bool swap = 0;
|
||||||
|
|
||||||
|
@ -7134,7 +7134,7 @@ static int zend_jit_cmp_double_double(dasm_State **Dst, const zend_op *opline, z
|
||||||
return zend_jit_cmp_double_common(Dst, opline, res_addr, swap, smart_branch_opcode, target_label, target_label2, exit_addr);
|
return zend_jit_cmp_double_common(Dst, opline, res_addr, swap, smart_branch_opcode, target_label, target_label2, exit_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_slow(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_slow(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
| tst RETVALw, RETVALw
|
| tst RETVALw, RETVALw
|
||||||
if (smart_branch_opcode) {
|
if (smart_branch_opcode) {
|
||||||
|
@ -7268,7 +7268,7 @@ static int zend_jit_cmp(dasm_State **Dst,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
int may_throw,
|
int may_throw,
|
||||||
zend_uchar smart_branch_opcode,
|
uint8_t smart_branch_opcode,
|
||||||
uint32_t target_label,
|
uint32_t target_label,
|
||||||
uint32_t target_label2,
|
uint32_t target_label2,
|
||||||
const void *exit_addr,
|
const void *exit_addr,
|
||||||
|
@ -7496,7 +7496,7 @@ static int zend_jit_identical(dasm_State **Dst,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
int may_throw,
|
int may_throw,
|
||||||
zend_uchar smart_branch_opcode,
|
uint8_t smart_branch_opcode,
|
||||||
uint32_t target_label,
|
uint32_t target_label,
|
||||||
uint32_t target_label2,
|
uint32_t target_label2,
|
||||||
const void *exit_addr,
|
const void *exit_addr,
|
||||||
|
@ -7878,7 +7878,7 @@ static int zend_jit_identical(dasm_State **Dst,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, zend_jit_addr res_addr, uint32_t target_label, uint32_t target_label2, int may_throw, zend_uchar branch_opcode, const void *exit_addr)
|
static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, zend_jit_addr res_addr, uint32_t target_label, uint32_t target_label2, int may_throw, uint8_t branch_opcode, const void *exit_addr)
|
||||||
{
|
{
|
||||||
uint32_t true_label = -1;
|
uint32_t true_label = -1;
|
||||||
uint32_t false_label = -1;
|
uint32_t false_label = -1;
|
||||||
|
@ -10187,7 +10187,7 @@ static int zend_jit_check_func_arg(dasm_State **Dst, const zend_op *opline)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_smart_true(dasm_State **Dst, const zend_op *opline, int jmp, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2)
|
static int zend_jit_smart_true(dasm_State **Dst, const zend_op *opline, int jmp, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2)
|
||||||
{
|
{
|
||||||
if (smart_branch_opcode) {
|
if (smart_branch_opcode) {
|
||||||
if (smart_branch_opcode == ZEND_JMPZ) {
|
if (smart_branch_opcode == ZEND_JMPZ) {
|
||||||
|
@ -10211,7 +10211,7 @@ static int zend_jit_smart_true(dasm_State **Dst, const zend_op *opline, int jmp,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_smart_false(dasm_State **Dst, const zend_op *opline, int jmp, zend_uchar smart_branch_opcode, uint32_t target_label)
|
static int zend_jit_smart_false(dasm_State **Dst, const zend_op *opline, int jmp, uint8_t smart_branch_opcode, uint32_t target_label)
|
||||||
{
|
{
|
||||||
if (smart_branch_opcode) {
|
if (smart_branch_opcode) {
|
||||||
if (smart_branch_opcode == ZEND_JMPZ) {
|
if (smart_branch_opcode == ZEND_JMPZ) {
|
||||||
|
@ -10235,7 +10235,7 @@ static int zend_jit_smart_false(dasm_State **Dst, const zend_op *opline, int jmp
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_defined(dasm_State **Dst, const zend_op *opline, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_defined(dasm_State **Dst, const zend_op *opline, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
uint32_t defined_label = (uint32_t)-1;
|
uint32_t defined_label = (uint32_t)-1;
|
||||||
uint32_t undefined_label = (uint32_t)-1;
|
uint32_t undefined_label = (uint32_t)-1;
|
||||||
|
@ -10326,7 +10326,7 @@ static int zend_jit_defined(dasm_State **Dst, const zend_op *opline, zend_uchar
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_type_check(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_type_check(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
uint32_t mask;
|
uint32_t mask;
|
||||||
zend_jit_addr op1_addr = OP1_ADDR();
|
zend_jit_addr op1_addr = OP1_ADDR();
|
||||||
|
@ -10392,7 +10392,7 @@ static int zend_jit_type_check(dasm_State **Dst, const zend_op *opline, uint32_t
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bool invert = 0;
|
bool invert = 0;
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
|
|
||||||
switch (mask) {
|
switch (mask) {
|
||||||
case MAY_BE_NULL: type = IS_NULL; break;
|
case MAY_BE_NULL: type = IS_NULL; break;
|
||||||
|
@ -11618,7 +11618,7 @@ static int zend_jit_isset_isempty_dim(dasm_State **Dst,
|
||||||
uint32_t op2_info,
|
uint32_t op2_info,
|
||||||
uint8_t dim_type,
|
uint8_t dim_type,
|
||||||
int may_throw,
|
int may_throw,
|
||||||
zend_uchar smart_branch_opcode,
|
uint8_t smart_branch_opcode,
|
||||||
uint32_t target_label,
|
uint32_t target_label,
|
||||||
uint32_t target_label2,
|
uint32_t target_label2,
|
||||||
const void *exit_addr)
|
const void *exit_addr)
|
||||||
|
@ -14315,7 +14315,7 @@ static bool zend_jit_verify_return_type(dasm_State **Dst, const zend_op *opline,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_isset_isempty_cv(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_isset_isempty_cv(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
|
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
|
||||||
|
|
||||||
|
@ -14405,7 +14405,7 @@ static int zend_jit_fe_reset(dasm_State **Dst, const zend_op *opline, uint32_t o
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_fe_fetch(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, uint32_t op2_info, unsigned int target_label, zend_uchar exit_opcode, const void *exit_addr)
|
static int zend_jit_fe_fetch(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, uint32_t op2_info, unsigned int target_label, uint8_t exit_opcode, const void *exit_addr)
|
||||||
{
|
{
|
||||||
zend_jit_addr op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->op1.var);
|
zend_jit_addr op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->op1.var);
|
||||||
|
|
||||||
|
@ -14698,7 +14698,7 @@ static int zend_jit_fetch_constant(dasm_State **Dst,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_in_array(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_in_array(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
|
HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
|
||||||
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
|
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
|
||||||
|
|
|
@ -1080,13 +1080,13 @@ static zend_always_inline zend_string* zend_jit_fetch_dim_str_offset(zend_string
|
||||||
zend_long real_offset = (zend_long)ZSTR_LEN(str) + offset;
|
zend_long real_offset = (zend_long)ZSTR_LEN(str) + offset;
|
||||||
|
|
||||||
if (EXPECTED(real_offset >= 0)) {
|
if (EXPECTED(real_offset >= 0)) {
|
||||||
return ZSTR_CHAR((zend_uchar)ZSTR_VAL(str)[real_offset]);
|
return ZSTR_CHAR((uint8_t)ZSTR_VAL(str)[real_offset]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
zend_error(E_WARNING, "Uninitialized string offset " ZEND_LONG_FMT, offset);
|
zend_error(E_WARNING, "Uninitialized string offset " ZEND_LONG_FMT, offset);
|
||||||
return ZSTR_EMPTY_ALLOC();
|
return ZSTR_EMPTY_ALLOC();
|
||||||
} else {
|
} else {
|
||||||
return ZSTR_CHAR((zend_uchar)ZSTR_VAL(str)[offset]);
|
return ZSTR_CHAR((uint8_t)ZSTR_VAL(str)[offset]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1155,13 +1155,13 @@ try_string_offset:
|
||||||
zend_long real_offset = (zend_long)ZSTR_LEN(str) + offset;
|
zend_long real_offset = (zend_long)ZSTR_LEN(str) + offset;
|
||||||
|
|
||||||
if (real_offset >= 0) {
|
if (real_offset >= 0) {
|
||||||
ZVAL_CHAR(result, (zend_uchar)ZSTR_VAL(str)[real_offset]);
|
ZVAL_CHAR(result, (uint8_t)ZSTR_VAL(str)[real_offset]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ZVAL_NULL(result);
|
ZVAL_NULL(result);
|
||||||
} else {
|
} else {
|
||||||
ZVAL_CHAR(result, (zend_uchar)ZSTR_VAL(str)[offset]);
|
ZVAL_CHAR(result, (uint8_t)ZSTR_VAL(str)[offset]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1221,7 +1221,7 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_obj_is_helper(zval *container, zval
|
||||||
|
|
||||||
static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim, zval *value, zval *result)
|
static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim, zval *value, zval *result)
|
||||||
{
|
{
|
||||||
zend_uchar c;
|
uint8_t c;
|
||||||
size_t string_len;
|
size_t string_len;
|
||||||
zend_long offset;
|
zend_long offset;
|
||||||
zend_string *s;
|
zend_string *s;
|
||||||
|
@ -1310,11 +1310,11 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
|
||||||
}
|
}
|
||||||
|
|
||||||
string_len = ZSTR_LEN(tmp);
|
string_len = ZSTR_LEN(tmp);
|
||||||
c = (zend_uchar)ZSTR_VAL(tmp)[0];
|
c = (uint8_t)ZSTR_VAL(tmp)[0];
|
||||||
zend_string_release(tmp);
|
zend_string_release(tmp);
|
||||||
} else {
|
} else {
|
||||||
string_len = Z_STRLEN_P(value);
|
string_len = Z_STRLEN_P(value);
|
||||||
c = (zend_uchar)Z_STRVAL_P(value)[0];
|
c = (uint8_t)Z_STRVAL_P(value)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2146,7 +2146,7 @@ static void ZEND_FASTCALL zend_jit_vm_stack_free_args_helper(zend_execute_data *
|
||||||
zend_vm_stack_free_args(call);
|
zend_vm_stack_free_args(call);
|
||||||
}
|
}
|
||||||
|
|
||||||
static zend_always_inline zval* zend_jit_assign_to_typed_ref_helper(zend_reference *ref, zval *value, zend_uchar value_type)
|
static zend_always_inline zval* zend_jit_assign_to_typed_ref_helper(zend_reference *ref, zval *value, uint8_t value_type)
|
||||||
{
|
{
|
||||||
zval variable;
|
zval variable;
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ typedef uintptr_t zend_jit_addr;
|
||||||
zend_ival_is_last_use(ra[ssa_op->op], ssa_op - ssa->ops) \
|
zend_ival_is_last_use(ra[ssa_op->op], ssa_op - ssa->ops) \
|
||||||
) : ZREG_NONE)
|
) : ZREG_NONE)
|
||||||
|
|
||||||
static zend_always_inline zend_jit_addr _zend_jit_decode_op(zend_uchar op_type, znode_op op, const zend_op *opline, zend_reg reg)
|
static zend_always_inline zend_jit_addr _zend_jit_decode_op(uint8_t op_type, znode_op op, const zend_op *opline, zend_reg reg)
|
||||||
{
|
{
|
||||||
if (op_type == IS_CONST) {
|
if (op_type == IS_CONST) {
|
||||||
#if ZEND_USE_ABS_CONST_ADDR
|
#if ZEND_USE_ABS_CONST_ADDR
|
||||||
|
|
|
@ -371,7 +371,7 @@ static int zend_jit_trace_may_exit(const zend_op_array *op_array, const zend_op
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static zend_always_inline uint32_t zend_jit_trace_type_to_info_ex(zend_uchar type, uint32_t info)
|
static zend_always_inline uint32_t zend_jit_trace_type_to_info_ex(uint8_t type, uint32_t info)
|
||||||
{
|
{
|
||||||
if (type == IS_UNKNOWN) {
|
if (type == IS_UNKNOWN) {
|
||||||
return info;
|
return info;
|
||||||
|
@ -386,7 +386,7 @@ static zend_always_inline uint32_t zend_jit_trace_type_to_info_ex(zend_uchar typ
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static zend_always_inline uint32_t zend_jit_trace_type_to_info(zend_uchar type)
|
static zend_always_inline uint32_t zend_jit_trace_type_to_info(uint8_t type)
|
||||||
{
|
{
|
||||||
return zend_jit_trace_type_to_info_ex(type, -1);
|
return zend_jit_trace_type_to_info_ex(type, -1);
|
||||||
}
|
}
|
||||||
|
@ -479,7 +479,7 @@ static zend_jit_trace_stack_frame* zend_jit_trace_ret_frame(zend_jit_trace_stack
|
||||||
return (zend_jit_trace_stack_frame*)((char*)frame - zend_jit_trace_frame_size(op_array));
|
return (zend_jit_trace_stack_frame*)((char*)frame - zend_jit_trace_frame_size(op_array));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zend_jit_trace_send_type(const zend_op *opline, zend_jit_trace_stack_frame *call, zend_uchar type)
|
static void zend_jit_trace_send_type(const zend_op *opline, zend_jit_trace_stack_frame *call, uint8_t type)
|
||||||
{
|
{
|
||||||
zend_jit_trace_stack *stack = call->stack;
|
zend_jit_trace_stack *stack = call->stack;
|
||||||
const zend_op_array *op_array = &call->func->op_array;
|
const zend_op_array *op_array = &call->func->op_array;
|
||||||
|
@ -1595,7 +1595,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
|
||||||
}
|
}
|
||||||
if (i < parent_vars_count) {
|
if (i < parent_vars_count) {
|
||||||
/* Initialize TSSA variable from parent trace */
|
/* Initialize TSSA variable from parent trace */
|
||||||
zend_uchar op_type = STACK_TYPE(parent_stack, i);
|
uint8_t op_type = STACK_TYPE(parent_stack, i);
|
||||||
|
|
||||||
if (op_type != IS_UNKNOWN) {
|
if (op_type != IS_UNKNOWN) {
|
||||||
ssa_var_info[i].type &= zend_jit_trace_type_to_info(op_type);
|
ssa_var_info[i].type &= zend_jit_trace_type_to_info(op_type);
|
||||||
|
@ -3857,7 +3857,7 @@ static void zend_jit_trace_update_condition_ranges(const zend_op *opline, const
|
||||||
|
|
||||||
static bool zend_jit_may_skip_comparison(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_ssa *ssa, const zend_op **ssa_opcodes, const zend_op_array *op_array)
|
static bool zend_jit_may_skip_comparison(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_ssa *ssa, const zend_op **ssa_opcodes, const zend_op_array *op_array)
|
||||||
{
|
{
|
||||||
zend_uchar prev_opcode;
|
uint8_t prev_opcode;
|
||||||
|
|
||||||
if (opline->op1_type == IS_CONST
|
if (opline->op1_type == IS_CONST
|
||||||
&& Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_LONG
|
&& Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_LONG
|
||||||
|
@ -3993,7 +3993,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||||
int num_op_arrays = 0;
|
int num_op_arrays = 0;
|
||||||
zend_jit_trace_info *t;
|
zend_jit_trace_info *t;
|
||||||
const zend_op_array *op_arrays[ZEND_JIT_TRACE_MAX_FUNCS];
|
const zend_op_array *op_arrays[ZEND_JIT_TRACE_MAX_FUNCS];
|
||||||
zend_uchar smart_branch_opcode;
|
uint8_t smart_branch_opcode;
|
||||||
const void *exit_addr;
|
const void *exit_addr;
|
||||||
uint32_t op1_info, op1_def_info, op2_info, res_info, res_use_info, op1_data_info;
|
uint32_t op1_info, op1_def_info, op2_info, res_info, res_use_info, op1_data_info;
|
||||||
bool send_result = 0;
|
bool send_result = 0;
|
||||||
|
@ -4010,7 +4010,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
zend_jit_trace_stack_frame *frame, *top, *call;
|
zend_jit_trace_stack_frame *frame, *top, *call;
|
||||||
zend_jit_trace_stack *stack;
|
zend_jit_trace_stack *stack;
|
||||||
zend_uchar res_type = IS_UNKNOWN;
|
uint8_t res_type = IS_UNKNOWN;
|
||||||
const zend_op *opline, *orig_opline;
|
const zend_op *opline, *orig_opline;
|
||||||
const zend_ssa_op *ssa_op, *orig_ssa_op;
|
const zend_ssa_op *ssa_op, *orig_ssa_op;
|
||||||
int checked_stack;
|
int checked_stack;
|
||||||
|
@ -5386,7 +5386,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||||
if (!left_frame) {
|
if (!left_frame) {
|
||||||
for (j = 0 ; j < op_array->last_var; j++) {
|
for (j = 0 ; j < op_array->last_var; j++) {
|
||||||
uint32_t info;
|
uint32_t info;
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
|
|
||||||
info = zend_ssa_cv_info(op_array, op_array_ssa, j);
|
info = zend_ssa_cv_info(op_array, op_array_ssa, j);
|
||||||
type = STACK_TYPE(stack, j);
|
type = STACK_TYPE(stack, j);
|
||||||
|
@ -6225,7 +6225,7 @@ done:
|
||||||
|
|
||||||
/* Keep information about known types on abstract stack */
|
/* Keep information about known types on abstract stack */
|
||||||
if (ssa_op->result_def >= 0) {
|
if (ssa_op->result_def >= 0) {
|
||||||
zend_uchar type = IS_UNKNOWN;
|
uint8_t type = IS_UNKNOWN;
|
||||||
|
|
||||||
if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0
|
if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0
|
||||||
|| send_result) {
|
|| send_result) {
|
||||||
|
@ -6293,7 +6293,7 @@ done:
|
||||||
&& (opline->opcode != ZEND_QM_ASSIGN
|
&& (opline->opcode != ZEND_QM_ASSIGN
|
||||||
|| opline->result_type != IS_CV
|
|| opline->result_type != IS_CV
|
||||||
|| opline->result.var != opline->op1.var)) {
|
|| opline->result.var != opline->op1.var)) {
|
||||||
zend_uchar type = IS_UNKNOWN;
|
uint8_t type = IS_UNKNOWN;
|
||||||
|
|
||||||
if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD)
|
if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD)
|
||||||
&& has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) {
|
&& has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) {
|
||||||
|
@ -6354,7 +6354,7 @@ done:
|
||||||
&& (opline->opcode != ZEND_ASSIGN
|
&& (opline->opcode != ZEND_ASSIGN
|
||||||
|| opline->op1_type != IS_CV
|
|| opline->op1_type != IS_CV
|
||||||
|| opline->op1.var != opline->op2.var)) {
|
|| opline->op1.var != opline->op2.var)) {
|
||||||
zend_uchar type = IS_UNKNOWN;
|
uint8_t type = IS_UNKNOWN;
|
||||||
|
|
||||||
if (!(ssa->var_info[ssa_op->op2_def].type & MAY_BE_GUARD)
|
if (!(ssa->var_info[ssa_op->op2_def].type & MAY_BE_GUARD)
|
||||||
&& has_concrete_type(ssa->var_info[ssa_op->op2_def].type)) {
|
&& has_concrete_type(ssa->var_info[ssa_op->op2_def].type)) {
|
||||||
|
@ -6405,7 +6405,7 @@ done:
|
||||||
ssa_op++;
|
ssa_op++;
|
||||||
opline++;
|
opline++;
|
||||||
if (ssa_op->op1_def >= 0) {
|
if (ssa_op->op1_def >= 0) {
|
||||||
zend_uchar type = IS_UNKNOWN;
|
uint8_t type = IS_UNKNOWN;
|
||||||
|
|
||||||
if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD)
|
if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD)
|
||||||
&& has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) {
|
&& has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) {
|
||||||
|
@ -6441,7 +6441,7 @@ done:
|
||||||
opline++;
|
opline++;
|
||||||
while (opline->opcode == ZEND_RECV_INIT) {
|
while (opline->opcode == ZEND_RECV_INIT) {
|
||||||
if (ssa_op->result_def >= 0) {
|
if (ssa_op->result_def >= 0) {
|
||||||
zend_uchar type = IS_UNKNOWN;
|
uint8_t type = IS_UNKNOWN;
|
||||||
|
|
||||||
if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD)
|
if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD)
|
||||||
&& has_concrete_type(ssa->var_info[ssa_op->result_def].type)) {
|
&& has_concrete_type(ssa->var_info[ssa_op->result_def].type)) {
|
||||||
|
@ -6463,7 +6463,7 @@ done:
|
||||||
opline++;
|
opline++;
|
||||||
while (opline->opcode == ZEND_BIND_GLOBAL) {
|
while (opline->opcode == ZEND_BIND_GLOBAL) {
|
||||||
if (ssa_op->op1_def >= 0) {
|
if (ssa_op->op1_def >= 0) {
|
||||||
zend_uchar type = IS_UNKNOWN;
|
uint8_t type = IS_UNKNOWN;
|
||||||
|
|
||||||
if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD)
|
if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD)
|
||||||
&& has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) {
|
&& has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) {
|
||||||
|
@ -7539,7 +7539,7 @@ static void zend_jit_dump_exit_info(zend_jit_trace_info *t)
|
||||||
fprintf(stderr, "/FREE_OP2");
|
fprintf(stderr, "/FREE_OP2");
|
||||||
}
|
}
|
||||||
for (j = 0; j < stack_size; j++) {
|
for (j = 0; j < stack_size; j++) {
|
||||||
zend_uchar type = STACK_TYPE(stack, j);
|
uint8_t type = STACK_TYPE(stack, j);
|
||||||
if (type != IS_UNKNOWN) {
|
if (type != IS_UNKNOWN) {
|
||||||
fprintf(stderr, " ");
|
fprintf(stderr, " ");
|
||||||
zend_dump_var(op_array, (j < op_array->last_var) ? IS_CV : 0, j);
|
zend_dump_var(op_array, (j < op_array->last_var) ? IS_CV : 0, j);
|
||||||
|
|
|
@ -1070,7 +1070,7 @@ static size_t tsrm_tls_offset;
|
||||||
|| has_concrete_type(src_info & MAY_BE_ANY)) {
|
|| has_concrete_type(src_info & MAY_BE_ANY)) {
|
||||||
|| if (Z_MODE(dst_addr) == IS_MEM_ZVAL) {
|
|| if (Z_MODE(dst_addr) == IS_MEM_ZVAL) {
|
||||||
|| if ((dst_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD)) != (src_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD))) {
|
|| if ((dst_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD)) != (src_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD))) {
|
||||||
|| zend_uchar type = concrete_type(src_info);
|
|| uint8_t type = concrete_type(src_info);
|
||||||
| SET_ZVAL_TYPE_INFO dst_addr, type
|
| SET_ZVAL_TYPE_INFO dst_addr, type
|
||||||
|| }
|
|| }
|
||||||
|| }
|
|| }
|
||||||
|
@ -1194,7 +1194,7 @@ static size_t tsrm_tls_offset;
|
||||||
|| }
|
|| }
|
||||||
|| if ((src_info & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE)) &&
|
|| if ((src_info & (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE)) &&
|
||||||
|| has_concrete_type(src_info & MAY_BE_ANY)) {
|
|| has_concrete_type(src_info & MAY_BE_ANY)) {
|
||||||
|| zend_uchar type = concrete_type(src_info);
|
|| uint8_t type = concrete_type(src_info);
|
||||||
|| if (Z_MODE(dst_addr) == IS_MEM_ZVAL) {
|
|| if (Z_MODE(dst_addr) == IS_MEM_ZVAL) {
|
||||||
|| if ((dst_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD)) != (src_info & (MAY_BE_ANY|MAY_BE_UNDEF))) {
|
|| if ((dst_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD)) != (src_info & (MAY_BE_ANY|MAY_BE_UNDEF))) {
|
||||||
| SET_ZVAL_TYPE_INFO dst_addr, type
|
| SET_ZVAL_TYPE_INFO dst_addr, type
|
||||||
|
@ -1375,7 +1375,7 @@ static size_t tsrm_tls_offset;
|
||||||
|| do {
|
|| do {
|
||||||
|| if (!((var_info) & MAY_BE_GUARD)
|
|| if (!((var_info) & MAY_BE_GUARD)
|
||||||
|| && has_concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
|
|| && has_concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
|
||||||
|| zend_uchar type = concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
|
|| uint8_t type = concrete_type((var_info) & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
|
||||||
|| if (type == IS_STRING && !ZEND_DEBUG) {
|
|| if (type == IS_STRING && !ZEND_DEBUG) {
|
||||||
| EXT_CALL _efree, r0
|
| EXT_CALL _efree, r0
|
||||||
|| break;
|
|| break;
|
||||||
|
@ -3969,7 +3969,7 @@ static int zend_jit_load_var(dasm_State **Dst, uint32_t info, int var, zend_reg
|
||||||
return zend_jit_load_reg(Dst, src, dst, info);
|
return zend_jit_load_reg(Dst, src, dst, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_invalidate_var_if_necessary(dasm_State **Dst, zend_uchar op_type, zend_jit_addr addr, znode_op op)
|
static int zend_jit_invalidate_var_if_necessary(dasm_State **Dst, uint8_t op_type, zend_jit_addr addr, znode_op op)
|
||||||
{
|
{
|
||||||
if ((op_type & (IS_TMP_VAR|IS_VAR)) && Z_MODE(addr) == IS_REG && !Z_LOAD(addr) && !Z_STORE(addr)) {
|
if ((op_type & (IS_TMP_VAR|IS_VAR)) && Z_MODE(addr) == IS_REG && !Z_LOAD(addr) && !Z_STORE(addr)) {
|
||||||
zend_jit_addr dst = ZEND_ADDR_MEM_ZVAL(ZREG_FP, op.var);
|
zend_jit_addr dst = ZEND_ADDR_MEM_ZVAL(ZREG_FP, op.var);
|
||||||
|
@ -4383,7 +4383,7 @@ static int zend_jit_opline_uses_reg(const zend_op *opline, int8_t reg)
|
||||||
|
|
||||||
static int zend_jit_math_long_long(dasm_State **Dst,
|
static int zend_jit_math_long_long(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -4593,7 +4593,7 @@ static int zend_jit_math_long_long(dasm_State **Dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_math_long_double(dasm_State **Dst,
|
static int zend_jit_math_long_double(dasm_State **Dst,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -4638,7 +4638,7 @@ static int zend_jit_math_long_double(dasm_State **Dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_math_double_long(dasm_State **Dst,
|
static int zend_jit_math_double_long(dasm_State **Dst,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -4731,7 +4731,7 @@ static int zend_jit_math_double_long(dasm_State **Dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_math_double_double(dasm_State **Dst,
|
static int zend_jit_math_double_double(dasm_State **Dst,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -4811,12 +4811,12 @@ static int zend_jit_math_double_double(dasm_State **Dst,
|
||||||
|
|
||||||
static int zend_jit_math_helper(dasm_State **Dst,
|
static int zend_jit_math_helper(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_uchar op1_type,
|
uint8_t op1_type,
|
||||||
znode_op op1,
|
znode_op op1,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
uint32_t op1_info,
|
uint32_t op1_info,
|
||||||
zend_uchar op2_type,
|
uint8_t op2_type,
|
||||||
znode_op op2,
|
znode_op op2,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
uint32_t op2_info,
|
uint32_t op2_info,
|
||||||
|
@ -5098,13 +5098,13 @@ static int zend_jit_add_arrays(dasm_State **Dst, const zend_op *opline, uint32_t
|
||||||
|
|
||||||
static int zend_jit_long_math_helper(dasm_State **Dst,
|
static int zend_jit_long_math_helper(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar opcode,
|
uint8_t opcode,
|
||||||
zend_uchar op1_type,
|
uint8_t op1_type,
|
||||||
znode_op op1,
|
znode_op op1,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
uint32_t op1_info,
|
uint32_t op1_info,
|
||||||
zend_ssa_range *op1_range,
|
zend_ssa_range *op1_range,
|
||||||
zend_uchar op2_type,
|
uint8_t op2_type,
|
||||||
znode_op op2,
|
znode_op op2,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
uint32_t op2_info,
|
uint32_t op2_info,
|
||||||
|
@ -5494,11 +5494,11 @@ static int zend_jit_long_math(dasm_State **Dst, const zend_op *opline, uint32_t
|
||||||
|
|
||||||
static int zend_jit_concat_helper(dasm_State **Dst,
|
static int zend_jit_concat_helper(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar op1_type,
|
uint8_t op1_type,
|
||||||
znode_op op1,
|
znode_op op1,
|
||||||
zend_jit_addr op1_addr,
|
zend_jit_addr op1_addr,
|
||||||
uint32_t op1_info,
|
uint32_t op1_info,
|
||||||
zend_uchar op2_type,
|
uint8_t op2_type,
|
||||||
znode_op op2,
|
znode_op op2,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
uint32_t op2_info,
|
uint32_t op2_info,
|
||||||
|
@ -6105,7 +6105,7 @@ static int zend_jit_simple_assign(dasm_State **Dst,
|
||||||
zend_jit_addr var_addr,
|
zend_jit_addr var_addr,
|
||||||
uint32_t var_info,
|
uint32_t var_info,
|
||||||
uint32_t var_def_info,
|
uint32_t var_def_info,
|
||||||
zend_uchar val_type,
|
uint8_t val_type,
|
||||||
zend_jit_addr val_addr,
|
zend_jit_addr val_addr,
|
||||||
uint32_t val_info,
|
uint32_t val_info,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -6269,7 +6269,7 @@ static int zend_jit_simple_assign(dasm_State **Dst,
|
||||||
|
|
||||||
static int zend_jit_assign_to_typed_ref(dasm_State **Dst,
|
static int zend_jit_assign_to_typed_ref(dasm_State **Dst,
|
||||||
const zend_op *opline,
|
const zend_op *opline,
|
||||||
zend_uchar val_type,
|
uint8_t val_type,
|
||||||
zend_jit_addr val_addr,
|
zend_jit_addr val_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
bool check_exception)
|
bool check_exception)
|
||||||
|
@ -6321,7 +6321,7 @@ static int zend_jit_assign_to_variable_call(dasm_State **Dst,
|
||||||
zend_jit_addr var_addr,
|
zend_jit_addr var_addr,
|
||||||
uint32_t __var_info,
|
uint32_t __var_info,
|
||||||
uint32_t __var_def_info,
|
uint32_t __var_def_info,
|
||||||
zend_uchar val_type,
|
uint8_t val_type,
|
||||||
zend_jit_addr val_addr,
|
zend_jit_addr val_addr,
|
||||||
uint32_t val_info,
|
uint32_t val_info,
|
||||||
zend_jit_addr __res_addr,
|
zend_jit_addr __res_addr,
|
||||||
|
@ -6403,7 +6403,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
|
||||||
zend_jit_addr var_addr,
|
zend_jit_addr var_addr,
|
||||||
uint32_t var_info,
|
uint32_t var_info,
|
||||||
uint32_t var_def_info,
|
uint32_t var_def_info,
|
||||||
zend_uchar val_type,
|
uint8_t val_type,
|
||||||
zend_jit_addr val_addr,
|
zend_jit_addr val_addr,
|
||||||
uint32_t val_info,
|
uint32_t val_info,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
|
@ -7117,7 +7117,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst,
|
||||||
zend_ssa_range *op2_range,
|
zend_ssa_range *op2_range,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
zend_uchar smart_branch_opcode,
|
uint8_t smart_branch_opcode,
|
||||||
uint32_t target_label,
|
uint32_t target_label,
|
||||||
uint32_t target_label2,
|
uint32_t target_label2,
|
||||||
const void *exit_addr,
|
const void *exit_addr,
|
||||||
|
@ -7379,7 +7379,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, bool swap, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, bool swap, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
if (smart_branch_opcode) {
|
if (smart_branch_opcode) {
|
||||||
if (smart_branch_opcode == ZEND_JMPZ) {
|
if (smart_branch_opcode == ZEND_JMPZ) {
|
||||||
|
@ -7682,7 +7682,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_long_double(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_long_double(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
zend_reg tmp_reg = ZREG_XMM0;
|
zend_reg tmp_reg = ZREG_XMM0;
|
||||||
|
|
||||||
|
@ -7692,7 +7692,7 @@ static int zend_jit_cmp_long_double(dasm_State **Dst, const zend_op *opline, zen
|
||||||
return zend_jit_cmp_double_common(Dst, opline, res_addr, 0, smart_branch_opcode, target_label, target_label2, exit_addr);
|
return zend_jit_cmp_double_common(Dst, opline, res_addr, 0, smart_branch_opcode, target_label, target_label2, exit_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_double_long(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_double_long(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
zend_reg tmp_reg = ZREG_XMM0;
|
zend_reg tmp_reg = ZREG_XMM0;
|
||||||
|
|
||||||
|
@ -7702,7 +7702,7 @@ static int zend_jit_cmp_double_long(dasm_State **Dst, const zend_op *opline, zen
|
||||||
return zend_jit_cmp_double_common(Dst, opline, res_addr, /* swap */ 1, smart_branch_opcode, target_label, target_label2, exit_addr);
|
return zend_jit_cmp_double_common(Dst, opline, res_addr, /* swap */ 1, smart_branch_opcode, target_label, target_label2, exit_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_double_double(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_double_double(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
bool swap = 0;
|
bool swap = 0;
|
||||||
|
|
||||||
|
@ -7721,7 +7721,7 @@ static int zend_jit_cmp_double_double(dasm_State **Dst, const zend_op *opline, z
|
||||||
return zend_jit_cmp_double_common(Dst, opline, res_addr, swap, smart_branch_opcode, target_label, target_label2, exit_addr);
|
return zend_jit_cmp_double_common(Dst, opline, res_addr, swap, smart_branch_opcode, target_label, target_label2, exit_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_cmp_slow(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_cmp_slow(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
| test, eax, eax
|
| test, eax, eax
|
||||||
if (smart_branch_opcode) {
|
if (smart_branch_opcode) {
|
||||||
|
@ -7857,7 +7857,7 @@ static int zend_jit_cmp(dasm_State **Dst,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
int may_throw,
|
int may_throw,
|
||||||
zend_uchar smart_branch_opcode,
|
uint8_t smart_branch_opcode,
|
||||||
uint32_t target_label,
|
uint32_t target_label,
|
||||||
uint32_t target_label2,
|
uint32_t target_label2,
|
||||||
const void *exit_addr,
|
const void *exit_addr,
|
||||||
|
@ -8101,7 +8101,7 @@ static int zend_jit_identical(dasm_State **Dst,
|
||||||
zend_jit_addr op2_addr,
|
zend_jit_addr op2_addr,
|
||||||
zend_jit_addr res_addr,
|
zend_jit_addr res_addr,
|
||||||
int may_throw,
|
int may_throw,
|
||||||
zend_uchar smart_branch_opcode,
|
uint8_t smart_branch_opcode,
|
||||||
uint32_t target_label,
|
uint32_t target_label,
|
||||||
uint32_t target_label2,
|
uint32_t target_label2,
|
||||||
const void *exit_addr,
|
const void *exit_addr,
|
||||||
|
@ -8485,7 +8485,7 @@ static int zend_jit_identical(dasm_State **Dst,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, zend_jit_addr res_addr, uint32_t target_label, uint32_t target_label2, int may_throw, zend_uchar branch_opcode, const void *exit_addr)
|
static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, zend_jit_addr res_addr, uint32_t target_label, uint32_t target_label2, int may_throw, uint8_t branch_opcode, const void *exit_addr)
|
||||||
{
|
{
|
||||||
uint32_t true_label = -1;
|
uint32_t true_label = -1;
|
||||||
uint32_t false_label = -1;
|
uint32_t false_label = -1;
|
||||||
|
@ -10866,7 +10866,7 @@ static int zend_jit_check_func_arg(dasm_State **Dst, const zend_op *opline)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_smart_true(dasm_State **Dst, const zend_op *opline, int jmp, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2)
|
static int zend_jit_smart_true(dasm_State **Dst, const zend_op *opline, int jmp, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2)
|
||||||
{
|
{
|
||||||
if (smart_branch_opcode) {
|
if (smart_branch_opcode) {
|
||||||
if (smart_branch_opcode == ZEND_JMPZ) {
|
if (smart_branch_opcode == ZEND_JMPZ) {
|
||||||
|
@ -10890,7 +10890,7 @@ static int zend_jit_smart_true(dasm_State **Dst, const zend_op *opline, int jmp,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_smart_false(dasm_State **Dst, const zend_op *opline, int jmp, zend_uchar smart_branch_opcode, uint32_t target_label)
|
static int zend_jit_smart_false(dasm_State **Dst, const zend_op *opline, int jmp, uint8_t smart_branch_opcode, uint32_t target_label)
|
||||||
{
|
{
|
||||||
if (smart_branch_opcode) {
|
if (smart_branch_opcode) {
|
||||||
if (smart_branch_opcode == ZEND_JMPZ) {
|
if (smart_branch_opcode == ZEND_JMPZ) {
|
||||||
|
@ -10914,7 +10914,7 @@ static int zend_jit_smart_false(dasm_State **Dst, const zend_op *opline, int jmp
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_defined(dasm_State **Dst, const zend_op *opline, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_defined(dasm_State **Dst, const zend_op *opline, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
uint32_t defined_label = (uint32_t)-1;
|
uint32_t defined_label = (uint32_t)-1;
|
||||||
uint32_t undefined_label = (uint32_t)-1;
|
uint32_t undefined_label = (uint32_t)-1;
|
||||||
|
@ -11007,7 +11007,7 @@ static int zend_jit_defined(dasm_State **Dst, const zend_op *opline, zend_uchar
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_type_check(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_type_check(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
uint32_t mask;
|
uint32_t mask;
|
||||||
zend_jit_addr op1_addr = OP1_ADDR();
|
zend_jit_addr op1_addr = OP1_ADDR();
|
||||||
|
@ -11073,7 +11073,7 @@ static int zend_jit_type_check(dasm_State **Dst, const zend_op *opline, uint32_t
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bool invert = 0;
|
bool invert = 0;
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
|
|
||||||
switch (mask) {
|
switch (mask) {
|
||||||
case MAY_BE_NULL: type = IS_NULL; break;
|
case MAY_BE_NULL: type = IS_NULL; break;
|
||||||
|
@ -12017,7 +12017,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
|
||||||
|
|
||||||
|8:
|
|8:
|
||||||
if (res_exit_addr) {
|
if (res_exit_addr) {
|
||||||
zend_uchar type = concrete_type(res_info);
|
uint8_t type = concrete_type(res_info);
|
||||||
|
|
||||||
if ((op1_info & MAY_BE_ARRAY_OF_REF)
|
if ((op1_info & MAY_BE_ARRAY_OF_REF)
|
||||||
&& dim_type != IS_UNKNOWN
|
&& dim_type != IS_UNKNOWN
|
||||||
|
@ -12349,7 +12349,7 @@ static int zend_jit_isset_isempty_dim(dasm_State **Dst,
|
||||||
uint32_t op2_info,
|
uint32_t op2_info,
|
||||||
uint8_t dim_type,
|
uint8_t dim_type,
|
||||||
int may_throw,
|
int may_throw,
|
||||||
zend_uchar smart_branch_opcode,
|
uint8_t smart_branch_opcode,
|
||||||
uint32_t target_label,
|
uint32_t target_label,
|
||||||
uint32_t target_label2,
|
uint32_t target_label2,
|
||||||
const void *exit_addr)
|
const void *exit_addr)
|
||||||
|
@ -13129,7 +13129,7 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
|
||||||
zend_jit_trace_stack *stack = JIT_G(current_frame)->stack;
|
zend_jit_trace_stack *stack = JIT_G(current_frame)->stack;
|
||||||
int32_t exit_point;
|
int32_t exit_point;
|
||||||
const void *exit_addr;
|
const void *exit_addr;
|
||||||
zend_uchar type;
|
uint8_t type;
|
||||||
zend_jit_addr val_addr = prop_addr;
|
zend_jit_addr val_addr = prop_addr;
|
||||||
|
|
||||||
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR))
|
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR))
|
||||||
|
@ -15232,7 +15232,7 @@ static bool zend_jit_verify_return_type(dasm_State **Dst, const zend_op *opline,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_isset_isempty_cv(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_isset_isempty_cv(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
|
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
|
||||||
|
|
||||||
|
@ -15322,7 +15322,7 @@ static int zend_jit_fe_reset(dasm_State **Dst, const zend_op *opline, uint32_t o
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_fe_fetch(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, uint32_t op2_info, unsigned int target_label, zend_uchar exit_opcode, const void *exit_addr)
|
static int zend_jit_fe_fetch(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, uint32_t op2_info, unsigned int target_label, uint8_t exit_opcode, const void *exit_addr)
|
||||||
{
|
{
|
||||||
zend_jit_addr op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->op1.var);
|
zend_jit_addr op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->op1.var);
|
||||||
|
|
||||||
|
@ -15575,7 +15575,7 @@ static int zend_jit_fetch_constant(dasm_State **Dst,
|
||||||
res_info &= ~MAY_BE_GUARD;
|
res_info &= ~MAY_BE_GUARD;
|
||||||
ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD;
|
ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD;
|
||||||
|
|
||||||
zend_uchar type = concrete_type(res_info);
|
uint8_t type = concrete_type(res_info);
|
||||||
|
|
||||||
if (type < IS_STRING) {
|
if (type < IS_STRING) {
|
||||||
| IF_NOT_ZVAL_TYPE const_addr, type, &exit_addr
|
| IF_NOT_ZVAL_TYPE const_addr, type, &exit_addr
|
||||||
|
@ -15617,7 +15617,7 @@ static int zend_jit_fetch_constant(dasm_State **Dst,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zend_jit_in_array(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
static int zend_jit_in_array(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, uint8_t smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
|
||||||
{
|
{
|
||||||
HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
|
HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
|
||||||
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
|
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
|
||||||
|
@ -16023,7 +16023,7 @@ static bool zend_jit_may_be_in_reg(const zend_op_array *op_array, zend_ssa *ssa,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool zend_needs_extra_reg_for_const(const zend_op *opline, zend_uchar op_type, znode_op op)
|
static bool zend_needs_extra_reg_for_const(const zend_op *opline, uint8_t op_type, znode_op op)
|
||||||
{
|
{
|
||||||
|.if X64
|
|.if X64
|
||||||
|| if (op_type == IS_CONST) {
|
|| if (op_type == IS_CONST) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ static void observer_set_user_opcode_handler(const char *opcode_names, user_opco
|
||||||
while (1) {
|
while (1) {
|
||||||
if (*e == ' ' || *e == ',' || *e == '\0') {
|
if (*e == ' ' || *e == ',' || *e == '\0') {
|
||||||
if (s) {
|
if (s) {
|
||||||
zend_uchar opcode = zend_get_opcode_id(s, e - s);
|
uint8_t opcode = zend_get_opcode_id(s, e - s);
|
||||||
if (opcode <= ZEND_VM_LAST_OPCODE) {
|
if (opcode <= ZEND_VM_LAST_OPCODE) {
|
||||||
zend_set_user_opcode_handler(opcode, handler);
|
zend_set_user_opcode_handler(opcode, handler);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -417,7 +417,7 @@ static PHP_INI_MH(OnUpdateTimeout)
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ php_get_display_errors_mode() helper function */
|
/* {{{ php_get_display_errors_mode() helper function */
|
||||||
static zend_uchar php_get_display_errors_mode(zend_string *value)
|
static uint8_t php_get_display_errors_mode(zend_string *value)
|
||||||
{
|
{
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return PHP_DISPLAY_ERRORS_STDOUT;
|
return PHP_DISPLAY_ERRORS_STDOUT;
|
||||||
|
@ -440,7 +440,7 @@ static zend_uchar php_get_display_errors_mode(zend_string *value)
|
||||||
return PHP_DISPLAY_ERRORS_STDOUT;
|
return PHP_DISPLAY_ERRORS_STDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
zend_uchar mode = ZEND_ATOL(ZSTR_VAL(value));
|
uint8_t mode = ZEND_ATOL(ZSTR_VAL(value));
|
||||||
if (mode && mode != PHP_DISPLAY_ERRORS_STDOUT && mode != PHP_DISPLAY_ERRORS_STDERR) {
|
if (mode && mode != PHP_DISPLAY_ERRORS_STDOUT && mode != PHP_DISPLAY_ERRORS_STDERR) {
|
||||||
return PHP_DISPLAY_ERRORS_STDOUT;
|
return PHP_DISPLAY_ERRORS_STDOUT;
|
||||||
}
|
}
|
||||||
|
@ -461,7 +461,7 @@ static PHP_INI_MH(OnUpdateDisplayErrors)
|
||||||
/* {{{ PHP_INI_DISP */
|
/* {{{ PHP_INI_DISP */
|
||||||
static PHP_INI_DISP(display_errors_mode)
|
static PHP_INI_DISP(display_errors_mode)
|
||||||
{
|
{
|
||||||
zend_uchar mode;
|
uint8_t mode;
|
||||||
bool cgi_or_cli;
|
bool cgi_or_cli;
|
||||||
zend_string *temporary_value;
|
zend_string *temporary_value;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
#include "zend_globals.h"
|
#include "zend_globals.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef struct _php_core_globals php_core_globals;
|
typedef struct _php_core_globals php_core_globals;
|
||||||
|
|
||||||
#ifdef ZTS
|
#ifdef ZTS
|
||||||
|
@ -65,7 +67,7 @@ struct _php_core_globals {
|
||||||
zend_long memory_limit;
|
zend_long memory_limit;
|
||||||
zend_long max_input_time;
|
zend_long max_input_time;
|
||||||
|
|
||||||
zend_uchar display_errors;
|
uint8_t display_errors;
|
||||||
bool display_startup_errors;
|
bool display_startup_errors;
|
||||||
bool log_errors;
|
bool log_errors;
|
||||||
bool ignore_repeated_errors;
|
bool ignore_repeated_errors;
|
||||||
|
|
|
@ -429,7 +429,7 @@ PHP_FUNCTION(phpdbg_start_oplog)
|
||||||
PHPDBG_G(oplog_cur)->next = NULL;
|
PHPDBG_G(oplog_cur)->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static zend_always_inline bool phpdbg_is_ignored_opcode(zend_uchar opcode) {
|
static zend_always_inline bool phpdbg_is_ignored_opcode(uint8_t opcode) {
|
||||||
return
|
return
|
||||||
opcode == ZEND_NOP || opcode == ZEND_OP_DATA || opcode == ZEND_FE_FREE || opcode == ZEND_FREE || opcode == ZEND_ASSERT_CHECK || opcode == ZEND_VERIFY_RETURN_TYPE
|
opcode == ZEND_NOP || opcode == ZEND_OP_DATA || opcode == ZEND_FE_FREE || opcode == ZEND_FREE || opcode == ZEND_ASSERT_CHECK || opcode == ZEND_VERIFY_RETURN_TYPE
|
||||||
|| opcode == ZEND_DECLARE_CONST || opcode == ZEND_DECLARE_CLASS || opcode == ZEND_DECLARE_FUNCTION
|
|| opcode == ZEND_DECLARE_CONST || opcode == ZEND_DECLARE_CLASS || opcode == ZEND_DECLARE_FUNCTION
|
||||||
|
@ -457,7 +457,7 @@ static void phpdbg_oplog_fill_executable(zend_op_array *op_array, HashTable *ins
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; cur < end; cur++) {
|
for (; cur < end; cur++) {
|
||||||
zend_uchar opcode = cur->opcode;
|
uint8_t opcode = cur->opcode;
|
||||||
if (phpdbg_is_ignored_opcode(opcode)) {
|
if (phpdbg_is_ignored_opcode(opcode)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array*);
|
||||||
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function*);
|
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function*);
|
||||||
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array*);
|
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array*);
|
||||||
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t);
|
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t);
|
||||||
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar);
|
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(uint8_t);
|
||||||
static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data); /* }}} */
|
static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data); /* }}} */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1009,7 +1009,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_pt
|
||||||
return (phpdbg_breakbase_t *) brake;
|
return (phpdbg_breakbase_t *) brake;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcode) /* {{{ */
|
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(uint8_t opcode) /* {{{ */
|
||||||
{
|
{
|
||||||
const char *opname = zend_get_opcode_name(opcode);
|
const char *opname = zend_get_opcode_name(opcode);
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ typedef struct _zend_op *phpdbg_opline_ptr_t; /* }}} */
|
||||||
/* {{{ breakpoint base structure */
|
/* {{{ breakpoint base structure */
|
||||||
#define phpdbg_breakbase(name) \
|
#define phpdbg_breakbase(name) \
|
||||||
int id; \
|
int id; \
|
||||||
zend_uchar type; \
|
uint8_t type; \
|
||||||
zend_ulong hits; \
|
zend_ulong hits; \
|
||||||
bool disabled; \
|
bool disabled; \
|
||||||
const char *name /* }}} */
|
const char *name /* }}} */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue