Skip to content

Commit 139da4b

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Removed ability to compile PHP without EX(run_time_cache). ZEND_EX_USE_RUN_TIME_CACHE was always defined.
2 parents a522fae + f9e8015 commit 139da4b

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 {
@@ -487,9 +485,7 @@ struct _zend_execute_data {
487485
zval This; /* this + call_info + num_args */
488486
zend_execute_data *prev_execute_data;
489487
zend_array *symbol_table;
490-
#if ZEND_EX_USE_RUN_TIME_CACHE
491488
void **run_time_cache; /* cache op_array->run_time_cache */
492-
#endif
493489
};
494490

495491
#define ZEND_CALL_HAS_THIS IS_OBJECT_EX
@@ -681,25 +677,6 @@ struct _zend_execute_data {
681677
#define ZEND_OP_ARRAY_EXTENSION(op_array, handle) \
682678
((void**)RUN_TIME_CACHE(op_array))[handle]
683679

684-
#if ZEND_EX_USE_RUN_TIME_CACHE
685-
686-
# define EX_RUN_TIME_CACHE() \
687-
EX(run_time_cache)
688-
689-
# define EX_LOAD_RUN_TIME_CACHE(op_array) do { \
690-
EX(run_time_cache) = RUN_TIME_CACHE(op_array); \
691-
} while (0)
692-
693-
#else
694-
695-
# define EX_RUN_TIME_CACHE() \
696-
RUN_TIME_CACHE(&EX(func)->op_array)
697-
698-
# define EX_LOAD_RUN_TIME_CACHE(op_array) do { \
699-
} while (0)
700-
701-
#endif
702-
703680
#define IS_UNUSED 0 /* Unused operand */
704681
#define IS_CONST (1<<0)
705682
#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
@@ -363,22 +363,22 @@ ZEND_API void zend_free_compiled_variables(zend_execute_data *execute_data);
363363
ZEND_API void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num);
364364

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

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

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

375375
#define CACHED_POLYMORPHIC_PTR(num, ce) \
376-
(EXPECTED(((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0] == (void*)(ce)) ? \
377-
((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[1] : \
376+
(EXPECTED(((void**)((char*)EX(run_time_cache) + (num)))[0] == (void*)(ce)) ? \
377+
((void**)((char*)EX(run_time_cache) + (num)))[1] : \
378378
NULL)
379379

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

0 commit comments

Comments
 (0)