diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-02-25 01:52:35 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-02-25 01:52:35 +0300 |
commit | 5f278e4d3a97ea0777e471424b52110386f1742e (patch) | |
tree | 563bad3a3e206e7b867ae411bc7abbed236129f9 /Zend/zend_execute.h | |
parent | dcb96c2e037e5198932385b573baea9a9dbf3252 (diff) | |
download | php-git-5f278e4d3a97ea0777e471424b52110386f1742e.tar.gz |
Use cache_slot offsets instead of indexes (simplify run-time instructions)
Diffstat (limited to 'Zend/zend_execute.h')
-rw-r--r-- | Zend/zend_execute.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 0fdf76453d..4298f6bdd6 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -256,21 +256,25 @@ ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS); ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table); void zend_free_compiled_variables(zend_execute_data *execute_data); +#define CACHE_ADDR(num) \ + ((void**)((char*)EX_RUN_TIME_CACHE() + (num))) + #define CACHED_PTR(num) \ - EX_RUN_TIME_CACHE()[(num)] + ((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0] #define CACHE_PTR(num, ptr) do { \ - EX_RUN_TIME_CACHE()[(num)] = (ptr); \ + ((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0] = (ptr); \ } while (0) #define CACHED_POLYMORPHIC_PTR(num, ce) \ - ((EX_RUN_TIME_CACHE()[(num)] == (ce)) ? \ - EX_RUN_TIME_CACHE()[(num) + 1] : \ + ((((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0] == (void*)(ce)) ? \ + ((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[1] : \ NULL) #define CACHE_POLYMORPHIC_PTR(num, ce, ptr) do { \ - EX_RUN_TIME_CACHE()[(num)] = (ce); \ - EX_RUN_TIME_CACHE()[(num) + 1] = (ptr); \ + void **slot = (void**)((char*)EX_RUN_TIME_CACHE() + (num)); \ + slot[0] = (ce); \ + slot[1] = (ptr); \ } while (0) #define CACHED_PTR_EX(slot) \ |