Skip to content

Commit f9e8015

Browse files
committed
Removed ability to compile PHP without EX(run_time_cache). ZEND_EX_USE_RUN_TIME_CACHE was always defined.
1 parent a94bee3 commit f9e8015

File tree

3 files changed

+8
-31
lines changed

3 files changed

+8
-31
lines changed

Zend/zend_compile.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ typedef struct _zend_op zend_op;
5555
#if SIZEOF_SIZE_T == 4
5656
# define ZEND_USE_ABS_JMP_ADDR 1
5757
# define ZEND_USE_ABS_CONST_ADDR 1
58-
# define ZEND_EX_USE_RUN_TIME_CACHE 1
5958
#else
6059
# define ZEND_USE_ABS_JMP_ADDR 0
6160
# define ZEND_USE_ABS_CONST_ADDR 0
62-
# define ZEND_EX_USE_RUN_TIME_CACHE 1
6361
#endif
6462

6563
typedef union _znode_op {
@@ -491,9 +489,7 @@ struct _zend_execute_data {
491489
zval This; /* this + call_info + num_args */
492490
zend_execute_data *prev_execute_data;
493491
zend_array *symbol_table;
494-
#if ZEND_EX_USE_RUN_TIME_CACHE
495492
void **run_time_cache; /* cache op_array->run_time_cache */
496-
#endif
497493
};
498494

499495
#define ZEND_CALL_HAS_THIS IS_OBJECT_EX
@@ -685,25 +681,6 @@ struct _zend_execute_data {
685681
#define ZEND_OP_ARRAY_EXTENSION(op_array, handle) \
686682
((void**)RUN_TIME_CACHE(op_array))[handle]
687683

688-
#if ZEND_EX_USE_RUN_TIME_CACHE
689-
690-
# define EX_RUN_TIME_CACHE() \
691-
EX(run_time_cache)
692-
693-
# define EX_LOAD_RUN_TIME_CACHE(op_array) do { \
694-
EX(run_time_cache) = RUN_TIME_CACHE(op_array); \
695-
} while (0)
696-
697-
#else
698-
699-
# define EX_RUN_TIME_CACHE() \
700-
RUN_TIME_CACHE(&EX(func)->op_array)
701-
702-
# define EX_LOAD_RUN_TIME_CACHE(op_array) do { \
703-
} while (0)
704-
705-
#endif
706-
707684
#define IS_UNUSED 0 /* Unused operand */
708685
#define IS_CONST (1<<0)
709686
#define IS_TMP_VAR (1<<1)

Zend/zend_execute.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3368,7 +3368,7 @@ static zend_always_inline void i_init_func_execute_data(zend_op_array *op_array,
33683368
/* Initialize CV variables (skip arguments) */
33693369
zend_init_cvs(num_args, op_array->last_var EXECUTE_DATA_CC);
33703370

3371-
EX_LOAD_RUN_TIME_CACHE(op_array);
3371+
EX(run_time_cache) = RUN_TIME_CACHE(op_array);
33723372

33733373
EG(current_execute_data) = execute_data;
33743374
#if defined(ZEND_VM_IP_GLOBAL_REG) && ((ZEND_VM_KIND == ZEND_VM_KIND_CALL) || (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID))
@@ -3444,7 +3444,7 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
34443444
ZEND_MAP_PTR_SET(op_array->run_time_cache, ptr);
34453445
memset(ptr, 0, op_array->cache_size);
34463446
}
3447-
EX_LOAD_RUN_TIME_CACHE(op_array);
3447+
EX(run_time_cache) = RUN_TIME_CACHE(op_array);
34483448

34493449
EG(current_execute_data) = execute_data;
34503450
}

Zend/zend_execute.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,22 +365,22 @@ ZEND_API void zend_cleanup_unfinished_execution(zend_execute_data *execute_data,
365365
ZEND_API int ZEND_FASTCALL zend_do_fcall_overloaded(zend_execute_data *call, zval *ret);
366366

367367
#define CACHE_ADDR(num) \
368-
((void**)((char*)EX_RUN_TIME_CACHE() + (num)))
368+
((void**)((char*)EX(run_time_cache) + (num)))
369369

370370
#define CACHED_PTR(num) \
371-
((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0]
371+
((void**)((char*)EX(run_time_cache) + (num)))[0]
372372

373373
#define CACHE_PTR(num, ptr) do { \
374-
((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0] = (ptr); \
374+
((void**)((char*)EX(run_time_cache) + (num)))[0] = (ptr); \
375375
} while (0)
376376

377377
#define CACHED_POLYMORPHIC_PTR(num, ce) \
378-
(EXPECTED(((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0] == (void*)(ce)) ? \
379-
((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[1] : \
378+
(EXPECTED(((void**)((char*)EX(run_time_cache) + (num)))[0] == (void*)(ce)) ? \
379+
((void**)((char*)EX(run_time_cache) + (num)))[1] : \
380380
NULL)
381381

382382
#define CACHE_POLYMORPHIC_PTR(num, ce, ptr) do { \
383-
void **slot = (void**)((char*)EX_RUN_TIME_CACHE() + (num)); \
383+
void **slot = (void**)((char*)EX(run_time_cache) + (num)); \
384384
slot[0] = (ce); \
385385
slot[1] = (ptr); \
386386
} while (0)

0 commit comments

Comments
 (0)