Skip to content

Commit 89688b1

Browse files
authored
Add function exposing HAVE_GCC_GLOBAL_REGS (#8359)
1 parent 5f035dc commit 89688b1

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Zend/zend_execute.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute
229229
return EX_VAR(var);
230230
}
231231

232+
ZEND_API bool zend_gcc_global_regs(void)
233+
{
234+
#if defined(HAVE_GCC_GLOBAL_REGS)
235+
return 1;
236+
#else
237+
return 0;
238+
#endif
239+
}
240+
232241
static zend_always_inline zval *_get_zval_ptr_tmp(uint32_t var EXECUTE_DATA_DC)
233242
{
234243
zval *ret = EX_VAR(var);

Zend/zend_execute.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *di
360360

361361
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
362362

363+
ZEND_API bool zend_gcc_global_regs(void);
364+
363365
#define ZEND_USER_OPCODE_CONTINUE 0 /* execute next opcode */
364366
#define ZEND_USER_OPCODE_RETURN 1 /* exit from executor (return from function) */
365367
#define ZEND_USER_OPCODE_DISPATCH 2 /* call original opcode handler */

Zend/zend_vm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *o
2929
ZEND_API const zend_op *zend_get_halt_op(void);
3030
ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data *ex);
3131
ZEND_API int zend_vm_kind(void);
32+
ZEND_API bool zend_gcc_global_regs(void);
3233

3334
void zend_vm_init(void);
3435
void zend_vm_dtor(void);

0 commit comments

Comments
 (0)