@@ -111,11 +111,11 @@ static const void *zend_jit_func_trace_counter_handler = NULL;
111
111
static const void * zend_jit_ret_trace_counter_handler = NULL ;
112
112
static const void * zend_jit_loop_trace_counter_handler = NULL ;
113
113
114
- static bool zend_may_overflow (const zend_op * opline , const zend_op_array * op_array , zend_ssa * ssa );
114
+ static int zend_may_overflow (const zend_op * opline , const zend_op_array * op_array , zend_ssa * ssa );
115
115
static void ZEND_FASTCALL zend_runtime_jit (void );
116
116
117
117
static int zend_jit_trace_op_len (const zend_op * opline );
118
- static bool zend_jit_trace_may_exit (const zend_op_array * op_array , const zend_op * opline );
118
+ static int zend_jit_trace_may_exit (const zend_op_array * op_array , const zend_op * opline );
119
119
static uint32_t zend_jit_trace_get_exit_point (const zend_op * from_opline , const zend_op * to_opline , zend_jit_trace_rec * trace , uint32_t flags );
120
120
static const void * zend_jit_trace_get_exit_addr (uint32_t n );
121
121
static void zend_jit_trace_add_code (const void * start , uint32_t size );
@@ -487,7 +487,7 @@ static void *dasm_link_and_encode(dasm_State **dasm_state,
487
487
return entry ;
488
488
}
489
489
490
- static bool zend_may_overflow_ex (const zend_op * opline , const zend_ssa_op * ssa_op , const zend_op_array * op_array , zend_ssa * ssa )
490
+ static int zend_may_overflow_ex (const zend_op * opline , const zend_ssa_op * ssa_op , const zend_op_array * op_array , zend_ssa * ssa )
491
491
{
492
492
int res ;
493
493
@@ -650,12 +650,12 @@ static bool zend_may_overflow_ex(const zend_op *opline, const zend_ssa_op *ssa_o
650
650
}
651
651
}
652
652
653
- static bool zend_may_overflow (const zend_op * opline , const zend_op_array * op_array , zend_ssa * ssa )
653
+ static int zend_may_overflow (const zend_op * opline , const zend_op_array * op_array , zend_ssa * ssa )
654
654
{
655
655
return zend_may_overflow_ex (opline , & ssa -> ops [opline - op_array -> opcodes ], op_array , ssa );
656
656
}
657
657
658
- static ZEND_RESULT_CODE zend_jit_build_cfg (const zend_op_array * op_array , zend_cfg * cfg )
658
+ static int zend_jit_build_cfg (const zend_op_array * op_array , zend_cfg * cfg )
659
659
{
660
660
uint32_t flags ;
661
661
@@ -689,7 +689,7 @@ static ZEND_RESULT_CODE zend_jit_build_cfg(const zend_op_array *op_array, zend_c
689
689
return SUCCESS ;
690
690
}
691
691
692
- static ZEND_RESULT_CODE zend_jit_op_array_analyze1 (const zend_op_array * op_array , zend_script * script , zend_ssa * ssa )
692
+ static int zend_jit_op_array_analyze1 (const zend_op_array * op_array , zend_script * script , zend_ssa * ssa )
693
693
{
694
694
if (zend_jit_build_cfg (op_array , & ssa -> cfg ) != SUCCESS ) {
695
695
return FAILURE ;
@@ -727,7 +727,7 @@ static ZEND_RESULT_CODE zend_jit_op_array_analyze1(const zend_op_array *op_array
727
727
return SUCCESS ;
728
728
}
729
729
730
- static ZEND_RESULT_CODE zend_jit_op_array_analyze2 (const zend_op_array * op_array , zend_script * script , zend_ssa * ssa , uint32_t optimization_level )
730
+ static int zend_jit_op_array_analyze2 (const zend_op_array * op_array , zend_script * script , zend_ssa * ssa , uint32_t optimization_level )
731
731
{
732
732
if ((JIT_G (opt_level ) >= ZEND_JIT_LEVEL_OPT_FUNC )
733
733
&& ssa -> cfg .blocks
@@ -742,7 +742,7 @@ static ZEND_RESULT_CODE zend_jit_op_array_analyze2(const zend_op_array *op_array
742
742
return SUCCESS ;
743
743
}
744
744
745
- static ZEND_RESULT_CODE zend_jit_add_range (zend_lifetime_interval * * intervals , int var , uint32_t from , uint32_t to )
745
+ static int zend_jit_add_range (zend_lifetime_interval * * intervals , int var , uint32_t from , uint32_t to )
746
746
{
747
747
zend_lifetime_interval * ival = intervals [var ];
748
748
@@ -817,7 +817,7 @@ static ZEND_RESULT_CODE zend_jit_add_range(zend_lifetime_interval **intervals, i
817
817
return SUCCESS ;
818
818
}
819
819
820
- static ZEND_RESULT_CODE zend_jit_begin_range (zend_lifetime_interval * * intervals , int var , uint32_t block_start , uint32_t from )
820
+ static int zend_jit_begin_range (zend_lifetime_interval * * intervals , int var , uint32_t block_start , uint32_t from )
821
821
{
822
822
if (block_start != from && intervals [var ]) {
823
823
zend_life_range * range = & intervals [var ]-> range ;
@@ -863,7 +863,7 @@ static void zend_jit_insert_interval(zend_lifetime_interval **list, zend_lifetim
863
863
}
864
864
}
865
865
866
- static ZEND_RESULT_CODE zend_jit_split_interval (zend_lifetime_interval * current , uint32_t pos , zend_lifetime_interval * * list , zend_lifetime_interval * * free )
866
+ static int zend_jit_split_interval (zend_lifetime_interval * current , uint32_t pos , zend_lifetime_interval * * list , zend_lifetime_interval * * free )
867
867
{
868
868
zend_lifetime_interval * ival ;
869
869
zend_life_range * range = & current -> range ;
@@ -1072,7 +1072,7 @@ static void zend_jit_add_hint(zend_lifetime_interval **intervals, int dst, int s
1072
1072
1073
1073
/* See "Linear Scan Register Allocation on SSA Form", Christian Wimmer and
1074
1074
Michael Franz, CGO'10 (2010), Figure 4. */
1075
- static ZEND_RESULT_CODE zend_jit_compute_liveness (const zend_op_array * op_array , zend_ssa * ssa , zend_bitset candidates , zend_lifetime_interval * * list )
1075
+ static int zend_jit_compute_liveness (const zend_op_array * op_array , zend_ssa * ssa , zend_bitset candidates , zend_lifetime_interval * * list )
1076
1076
{
1077
1077
int set_size , i , j , k , l ;
1078
1078
uint32_t n ;
@@ -1415,7 +1415,7 @@ static uint32_t zend_interval_intersection(zend_lifetime_interval *ival1, zend_l
1415
1415
1416
1416
/* See "Optimized Interval Splitting in a Linear Scan Register Allocator",
1417
1417
Christian Wimmer VEE'05 (2005), Figure 4. Allocation without spilling */
1418
- static bool zend_jit_try_allocate_free_reg (const zend_op_array * op_array , const zend_op * * ssa_opcodes , zend_ssa * ssa , zend_lifetime_interval * current , zend_regset available , zend_regset * hints , zend_lifetime_interval * active , zend_lifetime_interval * inactive , zend_lifetime_interval * * list , zend_lifetime_interval * * free )
1418
+ static int zend_jit_try_allocate_free_reg (const zend_op_array * op_array , const zend_op * * ssa_opcodes , zend_ssa * ssa , zend_lifetime_interval * current , zend_regset available , zend_regset * hints , zend_lifetime_interval * active , zend_lifetime_interval * inactive , zend_lifetime_interval * * list , zend_lifetime_interval * * free )
1419
1419
{
1420
1420
zend_lifetime_interval * it ;
1421
1421
uint32_t freeUntilPos [ZREG_NUM ];
@@ -1639,7 +1639,7 @@ static bool zend_jit_try_allocate_free_reg(const zend_op_array *op_array, const
1639
1639
Christian Wimmer VEE'05 (2005), Figure 5. Allocation with spilling.
1640
1640
and "Linear Scan Register Allocation on SSA Form", Christian Wimmer and
1641
1641
Michael Franz, CGO'10 (2010), Figure 6. */
1642
- static bool zend_jit_allocate_blocked_reg (void )
1642
+ static int zend_jit_allocate_blocked_reg (void )
1643
1643
{
1644
1644
/* TODO: ??? */
1645
1645
return 0 ;
@@ -1996,7 +1996,7 @@ static zend_lifetime_interval** zend_jit_allocate_registers(const zend_op_array
1996
1996
return NULL ;
1997
1997
}
1998
1998
1999
- static ZEND_RESULT_CODE zend_jit (const zend_op_array * op_array , zend_ssa * ssa , const zend_op * rt_opline )
1999
+ static int zend_jit (const zend_op_array * op_array , zend_ssa * ssa , const zend_op * rt_opline )
2000
2000
{
2001
2001
int b , i , end ;
2002
2002
zend_op * opline ;
@@ -3168,7 +3168,7 @@ static ZEND_RESULT_CODE zend_jit(const zend_op_array *op_array, zend_ssa *ssa, c
3168
3168
return FAILURE ;
3169
3169
}
3170
3170
3171
- static ZEND_RESULT_CODE zend_jit_collect_calls (zend_op_array * op_array , zend_script * script )
3171
+ static int zend_jit_collect_calls (zend_op_array * op_array , zend_script * script )
3172
3172
{
3173
3173
zend_func_info * func_info ;
3174
3174
@@ -3215,7 +3215,7 @@ static void zend_jit_cleanup_func_info(zend_op_array *op_array)
3215
3215
}
3216
3216
}
3217
3217
3218
- static ZEND_RESULT_CODE zend_real_jit_func (zend_op_array * op_array , zend_script * script , const zend_op * rt_opline )
3218
+ static int zend_real_jit_func (zend_op_array * op_array , zend_script * script , const zend_op * rt_opline )
3219
3219
{
3220
3220
zend_ssa ssa ;
3221
3221
void * checkpoint ;
@@ -3364,7 +3364,7 @@ void ZEND_FASTCALL zend_jit_hot_func(zend_execute_data *execute_data, const zend
3364
3364
/* JIT-ed code is going to be called by VM */
3365
3365
}
3366
3366
3367
- static ZEND_RESULT_CODE zend_jit_setup_hot_counters (zend_op_array * op_array )
3367
+ static int zend_jit_setup_hot_counters (zend_op_array * op_array )
3368
3368
{
3369
3369
zend_op * opline = op_array -> opcodes ;
3370
3370
zend_jit_op_array_hot_extension * jit_extension ;
@@ -3411,7 +3411,7 @@ static ZEND_RESULT_CODE zend_jit_setup_hot_counters(zend_op_array *op_array)
3411
3411
return SUCCESS ;
3412
3412
}
3413
3413
3414
- static bool zend_needs_manual_jit (const zend_op_array * op_array )
3414
+ static int zend_needs_manual_jit (const zend_op_array * op_array )
3415
3415
{
3416
3416
if (op_array -> doc_comment ) {
3417
3417
const char * s = ZSTR_VAL (op_array -> doc_comment );
@@ -3431,7 +3431,7 @@ static bool zend_needs_manual_jit(const zend_op_array *op_array)
3431
3431
3432
3432
#include "jit/zend_jit_trace.c"
3433
3433
3434
- ZEND_EXT_API ZEND_RESULT_CODE zend_jit_op_array (zend_op_array * op_array , zend_script * script )
3434
+ ZEND_EXT_API int zend_jit_op_array (zend_op_array * op_array , zend_script * script )
3435
3435
{
3436
3436
if (dasm_ptr == NULL ) {
3437
3437
return FAILURE ;
@@ -3493,7 +3493,7 @@ ZEND_EXT_API ZEND_RESULT_CODE zend_jit_op_array(zend_op_array *op_array, zend_sc
3493
3493
}
3494
3494
}
3495
3495
3496
- ZEND_EXT_API ZEND_RESULT_CODE zend_jit_script (zend_script * script )
3496
+ ZEND_EXT_API int zend_jit_script (zend_script * script )
3497
3497
{
3498
3498
void * checkpoint ;
3499
3499
zend_call_graph call_graph ;
@@ -3526,7 +3526,7 @@ ZEND_EXT_API ZEND_RESULT_CODE zend_jit_script(zend_script *script)
3526
3526
JIT_G (trigger ) == ZEND_JIT_ON_DOC_COMMENT ) {
3527
3527
3528
3528
if (JIT_G (trigger ) == ZEND_JIT_ON_DOC_COMMENT ) {
3529
- bool do_jit = 0 ;
3529
+ int do_jit = 0 ;
3530
3530
for (i = 0 ; i < call_graph .op_arrays_count ; i ++ ) {
3531
3531
if (zend_needs_manual_jit (call_graph .op_arrays [i ])) {
3532
3532
do_jit = 1 ;
@@ -3683,7 +3683,7 @@ ZEND_EXT_API void zend_jit_protect(void)
3683
3683
#endif
3684
3684
}
3685
3685
3686
- static bool zend_jit_make_stubs (void )
3686
+ static int zend_jit_make_stubs (void )
3687
3687
{
3688
3688
dasm_State * dasm_state = NULL ;
3689
3689
uint32_t i ;
@@ -3729,7 +3729,7 @@ static void zend_jit_globals_ctor(zend_jit_globals *jit_globals)
3729
3729
zend_jit_trace_init_caches ();
3730
3730
}
3731
3731
3732
- static ZEND_RESULT_CODE zend_jit_parse_config_num (zend_long jit )
3732
+ static int zend_jit_parse_config_num (zend_long jit )
3733
3733
{
3734
3734
if (jit == 0 ) {
3735
3735
JIT_G (on ) = 0 ;
@@ -3760,7 +3760,7 @@ static ZEND_RESULT_CODE zend_jit_parse_config_num(zend_long jit)
3760
3760
return SUCCESS ;
3761
3761
}
3762
3762
3763
- ZEND_EXT_API ZEND_RESULT_CODE zend_jit_config (zend_string * jit , int stage )
3763
+ ZEND_EXT_API int zend_jit_config (zend_string * jit , int stage )
3764
3764
{
3765
3765
zend_ulong num ;
3766
3766
@@ -3816,7 +3816,7 @@ ZEND_EXT_API ZEND_RESULT_CODE zend_jit_config(zend_string *jit, int stage)
3816
3816
return FAILURE ;
3817
3817
}
3818
3818
3819
- ZEND_EXT_API ZEND_RESULT_CODE zend_jit_debug_config (zend_long old_val , zend_long new_val , int stage )
3819
+ ZEND_EXT_API int zend_jit_debug_config (zend_long old_val , zend_long new_val , int stage )
3820
3820
{
3821
3821
if (stage != ZEND_INI_STAGE_STARTUP ) {
3822
3822
if (((old_val ^ new_val ) & ZEND_JIT_DEBUG_PERSISTENT ) != 0 ) {
@@ -3847,7 +3847,7 @@ ZEND_EXT_API void zend_jit_init(void)
3847
3847
#endif
3848
3848
}
3849
3849
3850
- ZEND_EXT_API ZEND_RESULT_CODE zend_jit_startup (void * buf , size_t size , zend_bool reattached )
3850
+ ZEND_EXT_API int zend_jit_startup (void * buf , size_t size , zend_bool reattached )
3851
3851
{
3852
3852
int ret ;
3853
3853
0 commit comments