zend_dfg.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Zend Engine, DFG - Data Flow Graph |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | https://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Dmitry Stogov <dmitry@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef ZEND_DFG_H
  19. #define ZEND_DFG_H
  20. #include "zend_bitset.h"
  21. #include "zend_cfg.h"
  22. typedef struct _zend_dfg {
  23. int vars;
  24. uint32_t size;
  25. zend_bitset tmp;
  26. zend_bitset def;
  27. zend_bitset use;
  28. zend_bitset in;
  29. zend_bitset out;
  30. } zend_dfg;
  31. #define DFG_BITSET(set, set_size, block_num) \
  32. ((set) + ((block_num) * (set_size)))
  33. #define DFG_SET(set, set_size, block_num, var_num) \
  34. zend_bitset_incl(DFG_BITSET(set, set_size, block_num), (var_num))
  35. #define DFG_ISSET(set, set_size, block_num, var_num) \
  36. zend_bitset_in(DFG_BITSET(set, set_size, block_num), (var_num))
  37. BEGIN_EXTERN_C()
  38. int zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg *dfg, uint32_t build_flags);
  39. ZEND_API void zend_dfg_add_use_def_op(const zend_op_array *op_array, const zend_op *opline, uint32_t build_flags, zend_bitset use, zend_bitset def);
  40. END_EXTERN_C()
  41. #endif /* ZEND_DFG_H */