Skip to content

Commit 44e77f7

Browse files
committed
Move znode back to compile header
1 parent 5397d84 commit 44e77f7

File tree

2 files changed

+37
-36
lines changed

2 files changed

+37
-36
lines changed

Zend/zend_ast.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -213,37 +213,6 @@ typedef struct _zend_ast_decl {
213213
zend_ast *child[5];
214214
} zend_ast_decl;
215215

216-
typedef union _znode_op {
217-
uint32_t constant;
218-
uint32_t var;
219-
uint32_t num;
220-
uint32_t opline_num; /* Needs to be signed */
221-
#if ZEND_USE_ABS_JMP_ADDR
222-
zend_op *jmp_addr;
223-
#else
224-
uint32_t jmp_offset;
225-
#endif
226-
#if ZEND_USE_ABS_CONST_ADDR
227-
zval *zv;
228-
#endif
229-
} znode_op;
230-
231-
typedef struct _znode { /* used only during compilation */
232-
uint8_t op_type;
233-
uint8_t flag;
234-
union {
235-
znode_op op;
236-
zval constant; /* replaced by literal/zv */
237-
} u;
238-
} znode;
239-
240-
typedef struct _zend_ast_znode {
241-
zend_ast_kind kind;
242-
zend_ast_attr attr;
243-
uint32_t lineno;
244-
znode node;
245-
} zend_ast_znode;
246-
247216
typedef void (*zend_ast_process_t)(zend_ast *ast);
248217
extern ZEND_API zend_ast_process_t zend_ast_process;
249218

@@ -255,7 +224,6 @@ ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_zval_from_long(zend_long lval)
255224

256225
ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_constant(zend_string *name, zend_ast_attr attr);
257226
ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_class_const_or_name(zend_ast *class_name, zend_ast *name);
258-
ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_znode(znode *node);
259227

260228
#if ZEND_AST_SPEC
261229
# define ZEND_AST_SPEC_CALL(name, ...) \
@@ -392,10 +360,6 @@ static zend_always_inline uint32_t zend_ast_get_lineno(zend_ast *ast) {
392360
}
393361
}
394362

395-
static zend_always_inline znode *zend_ast_get_znode(zend_ast *ast) {
396-
return &((zend_ast_znode *) ast)->node;
397-
}
398-
399363
static zend_always_inline zend_ast *zend_ast_create_binary_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) {
400364
return zend_ast_create_ex(ZEND_AST_BINARY_OP, opcode, op0, op1);
401365
}

Zend/zend_compile.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,43 @@ typedef struct _zend_op zend_op;
6363
# define ZEND_USE_ABS_CONST_ADDR 0
6464
#endif
6565

66+
typedef union _znode_op {
67+
uint32_t constant;
68+
uint32_t var;
69+
uint32_t num;
70+
uint32_t opline_num; /* Needs to be signed */
71+
#if ZEND_USE_ABS_JMP_ADDR
72+
zend_op *jmp_addr;
73+
#else
74+
uint32_t jmp_offset;
75+
#endif
76+
#if ZEND_USE_ABS_CONST_ADDR
77+
zval *zv;
78+
#endif
79+
} znode_op;
80+
81+
typedef struct _znode { /* used only during compilation */
82+
uint8_t op_type;
83+
uint8_t flag;
84+
union {
85+
znode_op op;
86+
zval constant; /* replaced by literal/zv */
87+
} u;
88+
} znode;
89+
90+
typedef struct _zend_ast_znode {
91+
zend_ast_kind kind;
92+
zend_ast_attr attr;
93+
uint32_t lineno;
94+
znode node;
95+
} zend_ast_znode;
96+
97+
ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_znode(znode *node);
98+
99+
static zend_always_inline znode *zend_ast_get_znode(zend_ast *ast) {
100+
return &((zend_ast_znode *) ast)->node;
101+
}
102+
66103
typedef struct _zend_declarables {
67104
zend_long ticks;
68105
} zend_declarables;

0 commit comments

Comments
 (0)