@@ -2869,7 +2869,7 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
2869
2869
return entry;
2870
2870
}
2871
2871
2872
- static int zend_jit_setup_stubs(void)
2872
+ static void zend_jit_setup_stubs(void)
2873
2873
{
2874
2874
zend_jit_ctx jit;
2875
2875
void *entry;
@@ -2888,7 +2888,7 @@ static int zend_jit_setup_stubs(void)
2888
2888
entry = zend_jit_ir_compile(&jit.ctx, &size, zend_jit_stubs[i].name);
2889
2889
if (!entry) {
2890
2890
zend_jit_free_ctx(&jit);
2891
- return 0 ;
2891
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: could not compile stub") ;
2892
2892
}
2893
2893
2894
2894
zend_jit_stub_handlers[i] = entry;
@@ -2920,7 +2920,6 @@ static int zend_jit_setup_stubs(void)
2920
2920
}
2921
2921
zend_jit_free_ctx(&jit);
2922
2922
}
2923
- return 1;
2924
2923
}
2925
2924
2926
2925
#define REGISTER_HELPER(n) \
@@ -3121,7 +3120,7 @@ static void zend_jit_setup_disasm(void)
3121
3120
#endif
3122
3121
}
3123
3122
3124
- static int zend_jit_calc_trace_prologue_size(void)
3123
+ static void zend_jit_calc_trace_prologue_size(void)
3125
3124
{
3126
3125
zend_jit_ctx jit_ctx;
3127
3126
zend_jit_ctx *jit = &jit_ctx;
@@ -3142,11 +3141,10 @@ static int zend_jit_calc_trace_prologue_size(void)
3142
3141
zend_jit_free_ctx(jit);
3143
3142
3144
3143
if (!entry) {
3145
- return 0 ;
3144
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: could not compile prologue") ;
3146
3145
}
3147
3146
3148
3147
zend_jit_trace_prologue_size = size;
3149
- return 1;
3150
3148
}
3151
3149
3152
3150
#if !ZEND_WIN32 && !defined(IR_TARGET_AARCH64)
@@ -3197,12 +3195,11 @@ static zend_never_inline void zend_jit_set_sp_adj_vm(void)
3197
3195
}
3198
3196
#endif
3199
3197
3200
- static int zend_jit_setup(void)
3198
+ static void zend_jit_setup(void)
3201
3199
{
3202
3200
#if defined(IR_TARGET_X86)
3203
3201
if (!zend_cpu_supports_sse2()) {
3204
- zend_error(E_CORE_ERROR, "CPU doesn't support SSE2");
3205
- return FAILURE;
3202
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: CPU doesn't support SSE2");
3206
3203
}
3207
3204
#endif
3208
3205
#if defined(IR_TARGET_X86) || defined(IR_TARGET_X64)
@@ -3235,8 +3232,7 @@ static int zend_jit_setup(void)
3235
3232
offset += sizeof(void*);
3236
3233
}
3237
3234
if (offset >= size) {
3238
- // TODO: error message ???
3239
- return FAILURE;
3235
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: offset >= size");
3240
3236
}
3241
3237
} while(0);
3242
3238
# elif ZEND_WIN32
@@ -3259,8 +3255,7 @@ static int zend_jit_setup(void)
3259
3255
offset += sizeof(void*);
3260
3256
}
3261
3257
if (offset >= size) {
3262
- // TODO: error message ???
3263
- return FAILURE;
3258
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: offset >= size");
3264
3259
}
3265
3260
} while(0);
3266
3261
# elif defined(__APPLE__) && defined(__x86_64__)
@@ -3345,17 +3340,9 @@ static int zend_jit_setup(void)
3345
3340
ZEND_JIT_DEBUG_IR_AFTER_SCCP|ZEND_JIT_DEBUG_IR_AFTER_SCHEDULE|ZEND_JIT_DEBUG_IR_AFTER_REGS);
3346
3341
}
3347
3342
3348
- if (!zend_jit_calc_trace_prologue_size()) {
3349
- JIT_G(debug) = debug;
3350
- return FAILURE;
3351
- }
3352
- if (!zend_jit_setup_stubs()) {
3353
- JIT_G(debug) = debug;
3354
- return FAILURE;
3355
- }
3343
+ zend_jit_calc_trace_prologue_size();
3344
+ zend_jit_setup_stubs();
3356
3345
JIT_G(debug) = debug;
3357
-
3358
- return SUCCESS;
3359
3346
}
3360
3347
3361
3348
static void zend_jit_shutdown_ir(void)
0 commit comments