@@ -2869,7 +2869,7 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
28692869	return entry;
28702870}
28712871
2872- static int  zend_jit_setup_stubs(void)
2872+ static void  zend_jit_setup_stubs(void)
28732873{
28742874	zend_jit_ctx jit;
28752875	void *entry;
@@ -2888,7 +2888,7 @@ static int zend_jit_setup_stubs(void)
28882888		entry = zend_jit_ir_compile(&jit.ctx, &size, zend_jit_stubs[i].name);
28892889		if (!entry) {
28902890			zend_jit_free_ctx(&jit);
2891- 			return 0 ;
2891+ 			zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: could not compile stub") ;
28922892		}
28932893
28942894		zend_jit_stub_handlers[i] = entry;
@@ -2920,7 +2920,6 @@ static int zend_jit_setup_stubs(void)
29202920		}
29212921		zend_jit_free_ctx(&jit);
29222922	}
2923- 	return 1;
29242923}
29252924
29262925#define REGISTER_HELPER(n)  \
@@ -3121,7 +3120,7 @@ static void zend_jit_setup_disasm(void)
31213120#endif
31223121}
31233122
3124- static int  zend_jit_calc_trace_prologue_size(void)
3123+ static void  zend_jit_calc_trace_prologue_size(void)
31253124{
31263125	zend_jit_ctx jit_ctx;
31273126	zend_jit_ctx *jit = &jit_ctx;
@@ -3142,11 +3141,10 @@ static int zend_jit_calc_trace_prologue_size(void)
31423141	zend_jit_free_ctx(jit);
31433142
31443143	if (!entry) {
3145- 		return 0 ;
3144+ 		zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: could not compile prologue") ;
31463145	}
31473146
31483147	zend_jit_trace_prologue_size = size;
3149- 	return 1;
31503148}
31513149
31523150#if !ZEND_WIN32 && !defined(IR_TARGET_AARCH64)
@@ -3197,12 +3195,11 @@ static zend_never_inline void zend_jit_set_sp_adj_vm(void)
31973195}
31983196#endif
31993197
3200- static int  zend_jit_setup(void)
3198+ static void  zend_jit_setup(void)
32013199{
32023200#if defined(IR_TARGET_X86)
32033201	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");
32063203	}
32073204#endif
32083205#if defined(IR_TARGET_X86) || defined(IR_TARGET_X64)
@@ -3235,8 +3232,7 @@ static int zend_jit_setup(void)
32353232			offset += sizeof(void*);
32363233		}
32373234		if (offset >= size) {
3238- 			// TODO: error message ???
3239- 			return FAILURE;
3235+ 			zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: offset >= size");
32403236		}
32413237	} while(0);
32423238# elif ZEND_WIN32
@@ -3259,8 +3255,7 @@ static int zend_jit_setup(void)
32593255			offset += sizeof(void*);
32603256		}
32613257		if (offset >= size) {
3262- 			// TODO: error message ???
3263- 			return FAILURE;
3258+ 			zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: offset >= size");
32643259		}
32653260	} while(0);
32663261# elif defined(__APPLE__) && defined(__x86_64__)
@@ -3345,17 +3340,9 @@ static int zend_jit_setup(void)
33453340			ZEND_JIT_DEBUG_IR_AFTER_SCCP|ZEND_JIT_DEBUG_IR_AFTER_SCHEDULE|ZEND_JIT_DEBUG_IR_AFTER_REGS);
33463341	}
33473342
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();
33563345	JIT_G(debug) = debug;
3357- 
3358- 	return SUCCESS;
33593346}
33603347
33613348static void zend_jit_shutdown_ir(void)
0 commit comments