/src/php-src/Zend/Optimizer/zend_inference.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | +----------------------------------------------------------------------+ |
3 | | | Zend Engine, e-SSA based Type & Range Inference | |
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 | | |
19 | | #ifndef ZEND_INFERENCE_H |
20 | | #define ZEND_INFERENCE_H |
21 | | |
22 | | #include "zend_optimizer.h" |
23 | | #include "zend_ssa.h" |
24 | | #include "zend_bitset.h" |
25 | | |
26 | | /* Bitmask for type inference (zend_ssa_var_info.type) */ |
27 | | #include "zend_type_info.h" |
28 | | |
29 | | #include <stdint.h> |
30 | | |
31 | 0 | #define MAY_BE_PACKED_GUARD (1<<27) /* needs packed array guard */ |
32 | | #define MAY_BE_CLASS_GUARD (1<<27) /* needs class guard */ |
33 | 1.11M | #define MAY_BE_GUARD (1<<28) /* needs type guard */ |
34 | | |
35 | | #define MAY_HAVE_DTOR \ |
36 | 4.34k | (MAY_BE_OBJECT|MAY_BE_RESOURCE \ |
37 | 4.34k | |MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE) |
38 | | |
39 | | #define DEFINE_SSA_OP_HAS_RANGE(opN) \ |
40 | | static zend_always_inline bool _ssa_##opN##_has_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ |
41 | 229k | { \ |
42 | 229k | if (opline->opN##_type == IS_CONST) { \ |
43 | 24.8k | zval *zv = CRT_CONSTANT(opline->opN); \ |
44 | 24.8k | return (Z_TYPE_P(zv) == IS_LONG); \ |
45 | 205k | } else { \ |
46 | 205k | return (opline->opN##_type != IS_UNUSED && \ |
47 | 205k | ssa->var_info && \ |
48 | 205k | ssa_op->opN##_use >= 0 && \ |
49 | 205k | ssa->var_info[ssa_op->opN##_use].has_range); \ |
50 | 205k | } \ |
51 | 229k | return 0; \ |
52 | 229k | } \ Unexecuted instantiation: dce.c:_ssa_op1_has_range Unexecuted instantiation: dce.c:_ssa_op2_has_range Unexecuted instantiation: dfa_pass.c:_ssa_op1_has_range Unexecuted instantiation: dfa_pass.c:_ssa_op2_has_range Unexecuted instantiation: escape_analysis.c:_ssa_op1_has_range Unexecuted instantiation: escape_analysis.c:_ssa_op2_has_range Unexecuted instantiation: sccp.c:_ssa_op1_has_range Unexecuted instantiation: sccp.c:_ssa_op2_has_range Unexecuted instantiation: zend_call_graph.c:_ssa_op1_has_range Unexecuted instantiation: zend_call_graph.c:_ssa_op2_has_range Unexecuted instantiation: zend_dump.c:_ssa_op1_has_range Unexecuted instantiation: zend_dump.c:_ssa_op2_has_range Unexecuted instantiation: zend_func_info.c:_ssa_op1_has_range Unexecuted instantiation: zend_func_info.c:_ssa_op2_has_range zend_inference.c:_ssa_op1_has_range Line | Count | Source | 41 | 119k | { \ | 42 | 119k | if (opline->opN##_type == IS_CONST) { \ | 43 | 7.90k | zval *zv = CRT_CONSTANT(opline->opN); \ | 44 | 7.90k | return (Z_TYPE_P(zv) == IS_LONG); \ | 45 | 111k | } else { \ | 46 | 111k | return (opline->opN##_type != IS_UNUSED && \ | 47 | 111k | ssa->var_info && \ | 48 | 111k | ssa_op->opN##_use >= 0 && \ | 49 | 111k | ssa->var_info[ssa_op->opN##_use].has_range); \ | 50 | 111k | } \ | 51 | 119k | return 0; \ | 52 | 119k | } \ |
zend_inference.c:_ssa_op2_has_range Line | Count | Source | 41 | 110k | { \ | 42 | 110k | if (opline->opN##_type == IS_CONST) { \ | 43 | 16.9k | zval *zv = CRT_CONSTANT(opline->opN); \ | 44 | 16.9k | return (Z_TYPE_P(zv) == IS_LONG); \ | 45 | 93.4k | } else { \ | 46 | 93.4k | return (opline->opN##_type != IS_UNUSED && \ | 47 | 93.4k | ssa->var_info && \ | 48 | 93.4k | ssa_op->opN##_use >= 0 && \ | 49 | 93.4k | ssa->var_info[ssa_op->opN##_use].has_range); \ | 50 | 93.4k | } \ | 51 | 110k | return 0; \ | 52 | 110k | } \ |
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_has_range Unexecuted instantiation: zend_optimizer.c:_ssa_op2_has_range Unexecuted instantiation: zend_ssa.c:_ssa_op1_has_range Unexecuted instantiation: zend_ssa.c:_ssa_op2_has_range |
53 | | |
54 | | #define DEFINE_SSA_OP_MIN_RANGE(opN) \ |
55 | | static zend_always_inline zend_long _ssa_##opN##_min_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ |
56 | 167k | { \ |
57 | 167k | if (opline->opN##_type == IS_CONST) { \ |
58 | 15.1k | zval *zv = CRT_CONSTANT(opline->opN); \ |
59 | 15.1k | if (Z_TYPE_P(zv) == IS_LONG) { \ |
60 | 15.1k | return Z_LVAL_P(zv); \ |
61 | 15.1k | } \ |
62 | 152k | } else if (opline->opN##_type != IS_UNUSED && \ |
63 | 152k | ssa->var_info && \ |
64 | 152k | ssa_op->opN##_use >= 0 && \ |
65 | 152k | ssa->var_info[ssa_op->opN##_use].has_range) { \ |
66 | 152k | return ssa->var_info[ssa_op->opN##_use].range.min; \ |
67 | 152k | } \ |
68 | 167k | return ZEND_LONG_MIN; \ |
69 | 167k | } \ Unexecuted instantiation: dce.c:_ssa_op1_min_range Unexecuted instantiation: dce.c:_ssa_op2_min_range Unexecuted instantiation: dfa_pass.c:_ssa_op1_min_range Unexecuted instantiation: dfa_pass.c:_ssa_op2_min_range Unexecuted instantiation: escape_analysis.c:_ssa_op1_min_range Unexecuted instantiation: escape_analysis.c:_ssa_op2_min_range Unexecuted instantiation: sccp.c:_ssa_op1_min_range Unexecuted instantiation: sccp.c:_ssa_op2_min_range Unexecuted instantiation: zend_call_graph.c:_ssa_op1_min_range Unexecuted instantiation: zend_call_graph.c:_ssa_op2_min_range Unexecuted instantiation: zend_dump.c:_ssa_op1_min_range Unexecuted instantiation: zend_dump.c:_ssa_op2_min_range Unexecuted instantiation: zend_func_info.c:_ssa_op1_min_range Unexecuted instantiation: zend_func_info.c:_ssa_op2_min_range zend_inference.c:_ssa_op1_min_range Line | Count | Source | 56 | 82.2k | { \ | 57 | 82.2k | if (opline->opN##_type == IS_CONST) { \ | 58 | 3.33k | zval *zv = CRT_CONSTANT(opline->opN); \ | 59 | 3.33k | if (Z_TYPE_P(zv) == IS_LONG) { \ | 60 | 3.33k | return Z_LVAL_P(zv); \ | 61 | 3.33k | } \ | 62 | 78.9k | } else if (opline->opN##_type != IS_UNUSED && \ | 63 | 78.9k | ssa->var_info && \ | 64 | 78.9k | ssa_op->opN##_use >= 0 && \ | 65 | 78.9k | ssa->var_info[ssa_op->opN##_use].has_range) { \ | 66 | 78.9k | return ssa->var_info[ssa_op->opN##_use].range.min; \ | 67 | 78.9k | } \ | 68 | 82.2k | return ZEND_LONG_MIN; \ | 69 | 82.2k | } \ |
zend_inference.c:_ssa_op2_min_range Line | Count | Source | 56 | 85.2k | { \ | 57 | 85.2k | if (opline->opN##_type == IS_CONST) { \ | 58 | 11.8k | zval *zv = CRT_CONSTANT(opline->opN); \ | 59 | 11.8k | if (Z_TYPE_P(zv) == IS_LONG) { \ | 60 | 11.8k | return Z_LVAL_P(zv); \ | 61 | 11.8k | } \ | 62 | 73.4k | } else if (opline->opN##_type != IS_UNUSED && \ | 63 | 73.4k | ssa->var_info && \ | 64 | 73.4k | ssa_op->opN##_use >= 0 && \ | 65 | 73.4k | ssa->var_info[ssa_op->opN##_use].has_range) { \ | 66 | 73.4k | return ssa->var_info[ssa_op->opN##_use].range.min; \ | 67 | 73.4k | } \ | 68 | 85.2k | return ZEND_LONG_MIN; \ | 69 | 85.2k | } \ |
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_min_range Unexecuted instantiation: zend_optimizer.c:_ssa_op2_min_range Unexecuted instantiation: zend_ssa.c:_ssa_op1_min_range Unexecuted instantiation: zend_ssa.c:_ssa_op2_min_range |
70 | | |
71 | | #define DEFINE_SSA_OP_MAX_RANGE(opN) \ |
72 | | static zend_always_inline zend_long _ssa_##opN##_max_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ |
73 | 167k | { \ |
74 | 167k | if (opline->opN##_type == IS_CONST) { \ |
75 | 14.7k | zval *zv = CRT_CONSTANT(opline->opN); \ |
76 | 14.7k | if (Z_TYPE_P(zv) == IS_LONG) { \ |
77 | 14.7k | return Z_LVAL_P(zv); \ |
78 | 14.7k | } \ |
79 | 152k | } else if (opline->opN##_type != IS_UNUSED && \ |
80 | 152k | ssa->var_info && \ |
81 | 152k | ssa_op->opN##_use >= 0 && \ |
82 | 152k | ssa->var_info[ssa_op->opN##_use].has_range) { \ |
83 | 152k | return ssa->var_info[ssa_op->opN##_use].range.max; \ |
84 | 152k | } \ |
85 | 167k | return ZEND_LONG_MAX; \ |
86 | 167k | } \ Unexecuted instantiation: dce.c:_ssa_op1_max_range Unexecuted instantiation: dce.c:_ssa_op2_max_range Unexecuted instantiation: dfa_pass.c:_ssa_op1_max_range Unexecuted instantiation: dfa_pass.c:_ssa_op2_max_range Unexecuted instantiation: escape_analysis.c:_ssa_op1_max_range Unexecuted instantiation: escape_analysis.c:_ssa_op2_max_range Unexecuted instantiation: sccp.c:_ssa_op1_max_range Unexecuted instantiation: sccp.c:_ssa_op2_max_range Unexecuted instantiation: zend_call_graph.c:_ssa_op1_max_range Unexecuted instantiation: zend_call_graph.c:_ssa_op2_max_range Unexecuted instantiation: zend_dump.c:_ssa_op1_max_range Unexecuted instantiation: zend_dump.c:_ssa_op2_max_range Unexecuted instantiation: zend_func_info.c:_ssa_op1_max_range Unexecuted instantiation: zend_func_info.c:_ssa_op2_max_range zend_inference.c:_ssa_op1_max_range Line | Count | Source | 73 | 82.2k | { \ | 74 | 82.2k | if (opline->opN##_type == IS_CONST) { \ | 75 | 3.33k | zval *zv = CRT_CONSTANT(opline->opN); \ | 76 | 3.33k | if (Z_TYPE_P(zv) == IS_LONG) { \ | 77 | 3.33k | return Z_LVAL_P(zv); \ | 78 | 3.33k | } \ | 79 | 78.9k | } else if (opline->opN##_type != IS_UNUSED && \ | 80 | 78.9k | ssa->var_info && \ | 81 | 78.9k | ssa_op->opN##_use >= 0 && \ | 82 | 78.9k | ssa->var_info[ssa_op->opN##_use].has_range) { \ | 83 | 78.9k | return ssa->var_info[ssa_op->opN##_use].range.max; \ | 84 | 78.9k | } \ | 85 | 82.2k | return ZEND_LONG_MAX; \ | 86 | 82.2k | } \ |
zend_inference.c:_ssa_op2_max_range Line | Count | Source | 73 | 84.8k | { \ | 74 | 84.8k | if (opline->opN##_type == IS_CONST) { \ | 75 | 11.4k | zval *zv = CRT_CONSTANT(opline->opN); \ | 76 | 11.4k | if (Z_TYPE_P(zv) == IS_LONG) { \ | 77 | 11.4k | return Z_LVAL_P(zv); \ | 78 | 11.4k | } \ | 79 | 73.4k | } else if (opline->opN##_type != IS_UNUSED && \ | 80 | 73.4k | ssa->var_info && \ | 81 | 73.4k | ssa_op->opN##_use >= 0 && \ | 82 | 73.4k | ssa->var_info[ssa_op->opN##_use].has_range) { \ | 83 | 73.4k | return ssa->var_info[ssa_op->opN##_use].range.max; \ | 84 | 73.4k | } \ | 85 | 84.8k | return ZEND_LONG_MAX; \ | 86 | 84.8k | } \ |
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_max_range Unexecuted instantiation: zend_optimizer.c:_ssa_op2_max_range Unexecuted instantiation: zend_ssa.c:_ssa_op1_max_range Unexecuted instantiation: zend_ssa.c:_ssa_op2_max_range |
87 | | |
88 | | #define DEFINE_SSA_OP_RANGE_UNDERFLOW(opN) \ |
89 | | static zend_always_inline char _ssa_##opN##_range_underflow(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ |
90 | 151k | { \ |
91 | 151k | if (opline->opN##_type == IS_CONST) { \ |
92 | 10.7k | zval *zv = CRT_CONSTANT(opline->opN); \ |
93 | 10.7k | if (Z_TYPE_P(zv) == IS_LONG) { \ |
94 | 10.7k | return 0; \ |
95 | 10.7k | } \ |
96 | 140k | } else if (opline->opN##_type != IS_UNUSED && \ |
97 | 140k | ssa->var_info && \ |
98 | 140k | ssa_op->opN##_use >= 0 && \ |
99 | 140k | ssa->var_info[ssa_op->opN##_use].has_range) { \ |
100 | 140k | return ssa->var_info[ssa_op->opN##_use].range.underflow; \ |
101 | 140k | } \ |
102 | 151k | return 1; \ |
103 | 151k | } \ Unexecuted instantiation: dce.c:_ssa_op1_range_underflow Unexecuted instantiation: dce.c:_ssa_op2_range_underflow Unexecuted instantiation: dfa_pass.c:_ssa_op1_range_underflow Unexecuted instantiation: dfa_pass.c:_ssa_op2_range_underflow Unexecuted instantiation: escape_analysis.c:_ssa_op1_range_underflow Unexecuted instantiation: escape_analysis.c:_ssa_op2_range_underflow Unexecuted instantiation: sccp.c:_ssa_op1_range_underflow Unexecuted instantiation: sccp.c:_ssa_op2_range_underflow Unexecuted instantiation: zend_call_graph.c:_ssa_op1_range_underflow Unexecuted instantiation: zend_call_graph.c:_ssa_op2_range_underflow Unexecuted instantiation: zend_dump.c:_ssa_op1_range_underflow Unexecuted instantiation: zend_dump.c:_ssa_op2_range_underflow Unexecuted instantiation: zend_func_info.c:_ssa_op1_range_underflow Unexecuted instantiation: zend_func_info.c:_ssa_op2_range_underflow zend_inference.c:_ssa_op1_range_underflow Line | Count | Source | 90 | 95.6k | { \ | 91 | 95.6k | if (opline->opN##_type == IS_CONST) { \ | 92 | 3.58k | zval *zv = CRT_CONSTANT(opline->opN); \ | 93 | 3.58k | if (Z_TYPE_P(zv) == IS_LONG) { \ | 94 | 3.58k | return 0; \ | 95 | 3.58k | } \ | 96 | 92.0k | } else if (opline->opN##_type != IS_UNUSED && \ | 97 | 92.0k | ssa->var_info && \ | 98 | 92.0k | ssa_op->opN##_use >= 0 && \ | 99 | 92.0k | ssa->var_info[ssa_op->opN##_use].has_range) { \ | 100 | 92.0k | return ssa->var_info[ssa_op->opN##_use].range.underflow; \ | 101 | 92.0k | } \ | 102 | 95.6k | return 1; \ | 103 | 95.6k | } \ |
zend_inference.c:_ssa_op2_range_underflow Line | Count | Source | 90 | 55.6k | { \ | 91 | 55.6k | if (opline->opN##_type == IS_CONST) { \ | 92 | 7.13k | zval *zv = CRT_CONSTANT(opline->opN); \ | 93 | 7.13k | if (Z_TYPE_P(zv) == IS_LONG) { \ | 94 | 7.13k | return 0; \ | 95 | 7.13k | } \ | 96 | 48.5k | } else if (opline->opN##_type != IS_UNUSED && \ | 97 | 48.5k | ssa->var_info && \ | 98 | 48.5k | ssa_op->opN##_use >= 0 && \ | 99 | 48.5k | ssa->var_info[ssa_op->opN##_use].has_range) { \ | 100 | 48.5k | return ssa->var_info[ssa_op->opN##_use].range.underflow; \ | 101 | 48.5k | } \ | 102 | 55.6k | return 1; \ | 103 | 55.6k | } \ |
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_range_underflow Unexecuted instantiation: zend_optimizer.c:_ssa_op2_range_underflow Unexecuted instantiation: zend_ssa.c:_ssa_op1_range_underflow Unexecuted instantiation: zend_ssa.c:_ssa_op2_range_underflow |
104 | | |
105 | | #define DEFINE_SSA_OP_RANGE_OVERFLOW(opN) \ |
106 | | static zend_always_inline char _ssa_##opN##_range_overflow(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ |
107 | 126k | { \ |
108 | 126k | if (opline->opN##_type == IS_CONST) { \ |
109 | 10.4k | zval *zv = CRT_CONSTANT(opline->opN); \ |
110 | 10.4k | if (Z_TYPE_P(zv) == IS_LONG) { \ |
111 | 10.4k | return 0; \ |
112 | 10.4k | } \ |
113 | 116k | } else if (opline->opN##_type != IS_UNUSED && \ |
114 | 116k | ssa->var_info && \ |
115 | 116k | ssa_op->opN##_use >= 0 && \ |
116 | 116k | ssa->var_info[ssa_op->opN##_use].has_range) { \ |
117 | 116k | return ssa->var_info[ssa_op->opN##_use].range.overflow; \ |
118 | 116k | } \ |
119 | 126k | return 1; \ |
120 | 126k | } \ Unexecuted instantiation: dce.c:_ssa_op1_range_overflow Unexecuted instantiation: dce.c:_ssa_op2_range_overflow Unexecuted instantiation: dfa_pass.c:_ssa_op1_range_overflow Unexecuted instantiation: dfa_pass.c:_ssa_op2_range_overflow Unexecuted instantiation: escape_analysis.c:_ssa_op1_range_overflow Unexecuted instantiation: escape_analysis.c:_ssa_op2_range_overflow Unexecuted instantiation: sccp.c:_ssa_op1_range_overflow Unexecuted instantiation: sccp.c:_ssa_op2_range_overflow Unexecuted instantiation: zend_call_graph.c:_ssa_op1_range_overflow Unexecuted instantiation: zend_call_graph.c:_ssa_op2_range_overflow Unexecuted instantiation: zend_dump.c:_ssa_op1_range_overflow Unexecuted instantiation: zend_dump.c:_ssa_op2_range_overflow Unexecuted instantiation: zend_func_info.c:_ssa_op1_range_overflow Unexecuted instantiation: zend_func_info.c:_ssa_op2_range_overflow zend_inference.c:_ssa_op1_range_overflow Line | Count | Source | 107 | 72.8k | { \ | 108 | 72.8k | if (opline->opN##_type == IS_CONST) { \ | 109 | 3.31k | zval *zv = CRT_CONSTANT(opline->opN); \ | 110 | 3.31k | if (Z_TYPE_P(zv) == IS_LONG) { \ | 111 | 3.31k | return 0; \ | 112 | 3.31k | } \ | 113 | 69.5k | } else if (opline->opN##_type != IS_UNUSED && \ | 114 | 69.5k | ssa->var_info && \ | 115 | 69.5k | ssa_op->opN##_use >= 0 && \ | 116 | 69.5k | ssa->var_info[ssa_op->opN##_use].has_range) { \ | 117 | 69.5k | return ssa->var_info[ssa_op->opN##_use].range.overflow; \ | 118 | 69.5k | } \ | 119 | 72.8k | return 1; \ | 120 | 72.8k | } \ |
zend_inference.c:_ssa_op2_range_overflow Line | Count | Source | 107 | 53.5k | { \ | 108 | 53.5k | if (opline->opN##_type == IS_CONST) { \ | 109 | 7.11k | zval *zv = CRT_CONSTANT(opline->opN); \ | 110 | 7.11k | if (Z_TYPE_P(zv) == IS_LONG) { \ | 111 | 7.11k | return 0; \ | 112 | 7.11k | } \ | 113 | 46.4k | } else if (opline->opN##_type != IS_UNUSED && \ | 114 | 46.4k | ssa->var_info && \ | 115 | 46.4k | ssa_op->opN##_use >= 0 && \ | 116 | 46.4k | ssa->var_info[ssa_op->opN##_use].has_range) { \ | 117 | 46.4k | return ssa->var_info[ssa_op->opN##_use].range.overflow; \ | 118 | 46.4k | } \ | 119 | 53.5k | return 1; \ | 120 | 53.5k | } \ |
Unexecuted instantiation: zend_optimizer.c:_ssa_op1_range_overflow Unexecuted instantiation: zend_optimizer.c:_ssa_op2_range_overflow Unexecuted instantiation: zend_ssa.c:_ssa_op1_range_overflow Unexecuted instantiation: zend_ssa.c:_ssa_op2_range_overflow |
121 | | |
122 | | DEFINE_SSA_OP_HAS_RANGE(op1) |
123 | | DEFINE_SSA_OP_MIN_RANGE(op1) |
124 | | DEFINE_SSA_OP_MAX_RANGE(op1) |
125 | | DEFINE_SSA_OP_RANGE_UNDERFLOW(op1) |
126 | | DEFINE_SSA_OP_RANGE_OVERFLOW(op1) |
127 | | DEFINE_SSA_OP_HAS_RANGE(op2) |
128 | | DEFINE_SSA_OP_MIN_RANGE(op2) |
129 | | DEFINE_SSA_OP_MAX_RANGE(op2) |
130 | | DEFINE_SSA_OP_RANGE_UNDERFLOW(op2) |
131 | | DEFINE_SSA_OP_RANGE_OVERFLOW(op2) |
132 | | |
133 | 187k | #define OP1_HAS_RANGE() (_ssa_op1_has_range (op_array, ssa, opline, ssa_op)) |
134 | 82.2k | #define OP1_MIN_RANGE() (_ssa_op1_min_range (op_array, ssa, opline, ssa_op)) |
135 | 82.2k | #define OP1_MAX_RANGE() (_ssa_op1_max_range (op_array, ssa, opline, ssa_op)) |
136 | 151k | #define OP1_RANGE_UNDERFLOW() (_ssa_op1_range_underflow (op_array, ssa, opline, ssa_op)) |
137 | 123k | #define OP1_RANGE_OVERFLOW() (_ssa_op1_range_overflow (op_array, ssa, opline, ssa_op)) |
138 | 111k | #define OP2_HAS_RANGE() (_ssa_op2_has_range (op_array, ssa, opline, ssa_op)) |
139 | 85.2k | #define OP2_MIN_RANGE() (_ssa_op2_min_range (op_array, ssa, opline, ssa_op)) |
140 | 84.8k | #define OP2_MAX_RANGE() (_ssa_op2_max_range (op_array, ssa, opline, ssa_op)) |
141 | 106k | #define OP2_RANGE_UNDERFLOW() (_ssa_op2_range_underflow (op_array, ssa, opline, ssa_op)) |
142 | 91.8k | #define OP2_RANGE_OVERFLOW() (_ssa_op2_range_overflow (op_array, ssa, opline, ssa_op)) |
143 | | |
144 | | BEGIN_EXTERN_C() |
145 | | ZEND_API uint32_t ZEND_FASTCALL zend_array_type_info(const zval *zv); |
146 | | END_EXTERN_C() |
147 | | |
148 | 1.03M | static zend_always_inline uint32_t _const_op_type(const zval *zv) { |
149 | 1.03M | if (Z_TYPE_P(zv) == IS_CONSTANT_AST) { |
150 | 1.13k | return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY; |
151 | 1.03M | } else if (Z_TYPE_P(zv) == IS_ARRAY) { |
152 | 14.0k | return zend_array_type_info(zv); |
153 | 1.02M | } else { |
154 | 1.02M | uint32_t tmp = (1 << Z_TYPE_P(zv)); |
155 | | |
156 | 1.02M | if (Z_REFCOUNTED_P(zv)) { |
157 | 80.0k | tmp |= MAY_BE_RC1 | MAY_BE_RCN; |
158 | 943k | } else if (Z_TYPE_P(zv) == IS_STRING) { |
159 | 678k | tmp |= MAY_BE_RCN; |
160 | 678k | } |
161 | 1.02M | return tmp; |
162 | 1.02M | } |
163 | 1.03M | } Unexecuted instantiation: dce.c:_const_op_type dfa_pass.c:_const_op_type Line | Count | Source | 148 | 2.58k | static zend_always_inline uint32_t _const_op_type(const zval *zv) { | 149 | 2.58k | if (Z_TYPE_P(zv) == IS_CONSTANT_AST) { | 150 | 0 | return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY; | 151 | 2.58k | } else if (Z_TYPE_P(zv) == IS_ARRAY) { | 152 | 0 | return zend_array_type_info(zv); | 153 | 2.58k | } else { | 154 | 2.58k | uint32_t tmp = (1 << Z_TYPE_P(zv)); | 155 | | | 156 | 2.58k | if (Z_REFCOUNTED_P(zv)) { | 157 | 282 | tmp |= MAY_BE_RC1 | MAY_BE_RCN; | 158 | 2.30k | } else if (Z_TYPE_P(zv) == IS_STRING) { | 159 | 2.30k | tmp |= MAY_BE_RCN; | 160 | 2.30k | } | 161 | 2.58k | return tmp; | 162 | 2.58k | } | 163 | 2.58k | } |
Unexecuted instantiation: escape_analysis.c:_const_op_type Unexecuted instantiation: sccp.c:_const_op_type Unexecuted instantiation: zend_call_graph.c:_const_op_type Unexecuted instantiation: zend_dump.c:_const_op_type zend_func_info.c:_const_op_type Line | Count | Source | 148 | 528 | static zend_always_inline uint32_t _const_op_type(const zval *zv) { | 149 | 528 | if (Z_TYPE_P(zv) == IS_CONSTANT_AST) { | 150 | 0 | return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY; | 151 | 528 | } else if (Z_TYPE_P(zv) == IS_ARRAY) { | 152 | 0 | return zend_array_type_info(zv); | 153 | 528 | } else { | 154 | 528 | uint32_t tmp = (1 << Z_TYPE_P(zv)); | 155 | | | 156 | 528 | if (Z_REFCOUNTED_P(zv)) { | 157 | 0 | tmp |= MAY_BE_RC1 | MAY_BE_RCN; | 158 | 528 | } else if (Z_TYPE_P(zv) == IS_STRING) { | 159 | 36 | tmp |= MAY_BE_RCN; | 160 | 36 | } | 161 | 528 | return tmp; | 162 | 528 | } | 163 | 528 | } |
zend_inference.c:_const_op_type Line | Count | Source | 148 | 491k | static zend_always_inline uint32_t _const_op_type(const zval *zv) { | 149 | 491k | if (Z_TYPE_P(zv) == IS_CONSTANT_AST) { | 150 | 604 | return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY; | 151 | 490k | } else if (Z_TYPE_P(zv) == IS_ARRAY) { | 152 | 6.61k | return zend_array_type_info(zv); | 153 | 483k | } else { | 154 | 483k | uint32_t tmp = (1 << Z_TYPE_P(zv)); | 155 | | | 156 | 483k | if (Z_REFCOUNTED_P(zv)) { | 157 | 36.7k | tmp |= MAY_BE_RC1 | MAY_BE_RCN; | 158 | 447k | } else if (Z_TYPE_P(zv) == IS_STRING) { | 159 | 313k | tmp |= MAY_BE_RCN; | 160 | 313k | } | 161 | 483k | return tmp; | 162 | 483k | } | 163 | 491k | } |
zend_optimizer.c:_const_op_type Line | Count | Source | 148 | 544k | static zend_always_inline uint32_t _const_op_type(const zval *zv) { | 149 | 544k | if (Z_TYPE_P(zv) == IS_CONSTANT_AST) { | 150 | 532 | return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY; | 151 | 544k | } else if (Z_TYPE_P(zv) == IS_ARRAY) { | 152 | 7.46k | return zend_array_type_info(zv); | 153 | 536k | } else { | 154 | 536k | uint32_t tmp = (1 << Z_TYPE_P(zv)); | 155 | | | 156 | 536k | if (Z_REFCOUNTED_P(zv)) { | 157 | 42.9k | tmp |= MAY_BE_RC1 | MAY_BE_RCN; | 158 | 493k | } else if (Z_TYPE_P(zv) == IS_STRING) { | 159 | 362k | tmp |= MAY_BE_RCN; | 160 | 362k | } | 161 | 536k | return tmp; | 162 | 536k | } | 163 | 544k | } |
Unexecuted instantiation: zend_ssa.c:_const_op_type |
164 | | |
165 | | static zend_always_inline uint32_t get_ssa_var_info(const zend_ssa *ssa, int ssa_var_num) |
166 | 4.03M | { |
167 | 4.03M | if (ssa->var_info && ssa_var_num >= 0) { |
168 | 3.24M | return ssa->var_info[ssa_var_num].type; |
169 | 3.24M | } else { |
170 | 795k | return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; |
171 | 795k | } |
172 | 4.03M | } Line | Count | Source | 166 | 5.61k | { | 167 | 5.61k | if (ssa->var_info && ssa_var_num >= 0) { | 168 | 5.61k | return ssa->var_info[ssa_var_num].type; | 169 | 5.61k | } else { | 170 | 0 | return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; | 171 | 0 | } | 172 | 5.61k | } |
dfa_pass.c:get_ssa_var_info Line | Count | Source | 166 | 27.6k | { | 167 | 27.6k | if (ssa->var_info && ssa_var_num >= 0) { | 168 | 27.6k | return ssa->var_info[ssa_var_num].type; | 169 | 27.6k | } else { | 170 | 0 | return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; | 171 | 0 | } | 172 | 27.6k | } |
escape_analysis.c:get_ssa_var_info Line | Count | Source | 166 | 9.07k | { | 167 | 9.07k | if (ssa->var_info && ssa_var_num >= 0) { | 168 | 9.07k | return ssa->var_info[ssa_var_num].type; | 169 | 9.07k | } else { | 170 | 0 | return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; | 171 | 0 | } | 172 | 9.07k | } |
Unexecuted instantiation: sccp.c:get_ssa_var_info Unexecuted instantiation: zend_call_graph.c:get_ssa_var_info Unexecuted instantiation: zend_dump.c:get_ssa_var_info zend_func_info.c:get_ssa_var_info Line | Count | Source | 166 | 58 | { | 167 | 58 | if (ssa->var_info && ssa_var_num >= 0) { | 168 | 58 | return ssa->var_info[ssa_var_num].type; | 169 | 58 | } else { | 170 | 0 | return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; | 171 | 0 | } | 172 | 58 | } |
zend_inference.c:get_ssa_var_info Line | Count | Source | 166 | 1.80M | { | 167 | 1.80M | if (ssa->var_info && ssa_var_num >= 0) { | 168 | 1.42M | return ssa->var_info[ssa_var_num].type; | 169 | 1.42M | } else { | 170 | 375k | return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; | 171 | 375k | } | 172 | 1.80M | } |
zend_optimizer.c:get_ssa_var_info Line | Count | Source | 166 | 2.19M | { | 167 | 2.19M | if (ssa->var_info && ssa_var_num >= 0) { | 168 | 1.77M | return ssa->var_info[ssa_var_num].type; | 169 | 1.77M | } else { | 170 | 420k | return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; | 171 | 420k | } | 172 | 2.19M | } |
Unexecuted instantiation: zend_ssa.c:get_ssa_var_info |
173 | | |
174 | | #define DEFINE_SSA_OP_INFO(opN) \ |
175 | | static zend_always_inline uint32_t _ssa_##opN##_info(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ |
176 | 4.01M | { \ |
177 | 4.01M | if (opline->opN##_type == IS_CONST) { \ |
178 | 1.03M | return _const_op_type(CRT_CONSTANT(opline->opN)); \ |
179 | 2.97M | } else { \ |
180 | 2.97M | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ |
181 | 2.97M | } \ |
182 | 4.01M | } \ Line | Count | Source | 176 | 4.03k | { \ | 177 | 4.03k | if (opline->opN##_type == IS_CONST) { \ | 178 | 0 | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 4.03k | } else { \ | 180 | 4.03k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 4.03k | } \ | 182 | 4.03k | } \ |
Line | Count | Source | 176 | 1.57k | { \ | 177 | 1.57k | if (opline->opN##_type == IS_CONST) { \ | 178 | 0 | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 1.57k | } else { \ | 180 | 1.57k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 1.57k | } \ | 182 | 1.57k | } \ |
Unexecuted instantiation: dce.c:_ssa_result_info Line | Count | Source | 176 | 7.20k | { \ | 177 | 7.20k | if (opline->opN##_type == IS_CONST) { \ | 178 | 1.42k | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 5.78k | } else { \ | 180 | 5.78k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 5.78k | } \ | 182 | 7.20k | } \ |
Line | Count | Source | 176 | 23.0k | { \ | 177 | 23.0k | if (opline->opN##_type == IS_CONST) { \ | 178 | 1.16k | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 21.9k | } else { \ | 180 | 21.9k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 21.9k | } \ | 182 | 23.0k | } \ |
Unexecuted instantiation: dfa_pass.c:_ssa_result_info escape_analysis.c:_ssa_op1_info Line | Count | Source | 176 | 8.35k | { \ | 177 | 8.35k | if (opline->opN##_type == IS_CONST) { \ | 178 | 0 | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 8.35k | } else { \ | 180 | 8.35k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 8.35k | } \ | 182 | 8.35k | } \ |
escape_analysis.c:_ssa_op2_info Line | Count | Source | 176 | 714 | { \ | 177 | 714 | if (opline->opN##_type == IS_CONST) { \ | 178 | 0 | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 714 | } else { \ | 180 | 714 | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 714 | } \ | 182 | 714 | } \ |
Unexecuted instantiation: escape_analysis.c:_ssa_result_info Unexecuted instantiation: sccp.c:_ssa_op1_info Unexecuted instantiation: sccp.c:_ssa_op2_info Unexecuted instantiation: sccp.c:_ssa_result_info Unexecuted instantiation: zend_call_graph.c:_ssa_op1_info Unexecuted instantiation: zend_call_graph.c:_ssa_op2_info Unexecuted instantiation: zend_call_graph.c:_ssa_result_info Unexecuted instantiation: zend_dump.c:_ssa_op1_info Unexecuted instantiation: zend_dump.c:_ssa_op2_info Unexecuted instantiation: zend_dump.c:_ssa_result_info zend_func_info.c:_ssa_op1_info Line | Count | Source | 176 | 586 | { \ | 177 | 586 | if (opline->opN##_type == IS_CONST) { \ | 178 | 528 | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 528 | } else { \ | 180 | 58 | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 58 | } \ | 182 | 586 | } \ |
Unexecuted instantiation: zend_func_info.c:_ssa_op2_info Unexecuted instantiation: zend_func_info.c:_ssa_result_info zend_inference.c:_ssa_result_info Line | Count | Source | 176 | 35.1k | { \ | 177 | 35.1k | if (opline->opN##_type == IS_CONST) { \ | 178 | 0 | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 35.1k | } else { \ | 180 | 35.1k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 35.1k | } \ | 182 | 35.1k | } \ |
zend_inference.c:_ssa_op1_info Line | Count | Source | 176 | 1.01M | { \ | 177 | 1.01M | if (opline->opN##_type == IS_CONST) { \ | 178 | 132k | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 881k | } else { \ | 180 | 881k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 881k | } \ | 182 | 1.01M | } \ |
zend_inference.c:_ssa_op2_info Line | Count | Source | 176 | 912k | { \ | 177 | 912k | if (opline->opN##_type == IS_CONST) { \ | 178 | 358k | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 554k | } else { \ | 180 | 554k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 554k | } \ | 182 | 912k | } \ |
zend_optimizer.c:_ssa_op1_info Line | Count | Source | 176 | 1.00M | { \ | 177 | 1.00M | if (opline->opN##_type == IS_CONST) { \ | 178 | 217k | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 783k | } else { \ | 180 | 783k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 783k | } \ | 182 | 1.00M | } \ |
zend_optimizer.c:_ssa_op2_info Line | Count | Source | 176 | 1.00M | { \ | 177 | 1.00M | if (opline->opN##_type == IS_CONST) { \ | 178 | 326k | return _const_op_type(CRT_CONSTANT(opline->opN)); \ | 179 | 674k | } else { \ | 180 | 674k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ | 181 | 674k | } \ | 182 | 1.00M | } \ |
Unexecuted instantiation: zend_optimizer.c:_ssa_result_info Unexecuted instantiation: zend_ssa.c:_ssa_op1_info Unexecuted instantiation: zend_ssa.c:_ssa_op2_info Unexecuted instantiation: zend_ssa.c:_ssa_result_info |
183 | | |
184 | | #define DEFINE_SSA_OP_DEF_INFO(opN) \ |
185 | | static zend_always_inline uint32_t _ssa_##opN##_def_info(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ |
186 | 733k | { \ |
187 | 733k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_def : -1); \ |
188 | 733k | } \ Unexecuted instantiation: dce.c:_ssa_op1_def_info Unexecuted instantiation: dce.c:_ssa_op2_def_info Unexecuted instantiation: dce.c:_ssa_result_def_info Unexecuted instantiation: dfa_pass.c:_ssa_op1_def_info Unexecuted instantiation: dfa_pass.c:_ssa_op2_def_info Unexecuted instantiation: dfa_pass.c:_ssa_result_def_info Unexecuted instantiation: escape_analysis.c:_ssa_op1_def_info Unexecuted instantiation: escape_analysis.c:_ssa_op2_def_info Unexecuted instantiation: escape_analysis.c:_ssa_result_def_info Unexecuted instantiation: sccp.c:_ssa_op1_def_info Unexecuted instantiation: sccp.c:_ssa_op2_def_info Unexecuted instantiation: sccp.c:_ssa_result_def_info Unexecuted instantiation: zend_call_graph.c:_ssa_op1_def_info Unexecuted instantiation: zend_call_graph.c:_ssa_op2_def_info Unexecuted instantiation: zend_call_graph.c:_ssa_result_def_info Unexecuted instantiation: zend_dump.c:_ssa_op1_def_info Unexecuted instantiation: zend_dump.c:_ssa_op2_def_info Unexecuted instantiation: zend_dump.c:_ssa_result_def_info Unexecuted instantiation: zend_func_info.c:_ssa_op1_def_info Unexecuted instantiation: zend_func_info.c:_ssa_op2_def_info Unexecuted instantiation: zend_func_info.c:_ssa_result_def_info Unexecuted instantiation: zend_inference.c:_ssa_op1_def_info Unexecuted instantiation: zend_inference.c:_ssa_op2_def_info Unexecuted instantiation: zend_inference.c:_ssa_result_def_info zend_optimizer.c:_ssa_op1_def_info Line | Count | Source | 186 | 6.08k | { \ | 187 | 6.08k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_def : -1); \ | 188 | 6.08k | } \ |
zend_optimizer.c:_ssa_result_def_info Line | Count | Source | 186 | 727k | { \ | 187 | 727k | return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_def : -1); \ | 188 | 727k | } \ |
Unexecuted instantiation: zend_optimizer.c:_ssa_op2_def_info Unexecuted instantiation: zend_ssa.c:_ssa_op1_def_info Unexecuted instantiation: zend_ssa.c:_ssa_op2_def_info Unexecuted instantiation: zend_ssa.c:_ssa_result_def_info |
189 | | |
190 | | |
191 | | DEFINE_SSA_OP_INFO(op1) |
192 | | DEFINE_SSA_OP_INFO(op2) |
193 | | DEFINE_SSA_OP_INFO(result) |
194 | | DEFINE_SSA_OP_DEF_INFO(op1) |
195 | | DEFINE_SSA_OP_DEF_INFO(op2) |
196 | | DEFINE_SSA_OP_DEF_INFO(result) |
197 | | |
198 | 2.01M | #define OP1_INFO() (_ssa_op1_info(op_array, ssa, opline, ssa_op)) |
199 | 1.92M | #define OP2_INFO() (_ssa_op2_info(op_array, ssa, opline, ssa_op)) |
200 | 31.5k | #define OP1_DATA_INFO() (_ssa_op1_info(op_array, ssa, (opline+1), ssa_op ? (ssa_op+1) : NULL)) |
201 | | #define OP2_DATA_INFO() (_ssa_op2_info(op_array, ssa, (opline+1), ssa_op ? (ssa_op+1) : NULL)) |
202 | 35.1k | #define RES_USE_INFO() (_ssa_result_info(op_array, ssa, opline, ssa_op)) |
203 | 6.08k | #define OP1_DEF_INFO() (_ssa_op1_def_info(op_array, ssa, opline, ssa_op)) |
204 | | #define OP2_DEF_INFO() (_ssa_op2_def_info(op_array, ssa, opline, ssa_op)) |
205 | | #define OP1_DATA_DEF_INFO() (_ssa_op1_def_info(op_array, ssa, (opline+1), ssa_op ? (ssa_op+1) : NULL)) |
206 | | #define OP2_DATA_DEF_INFO() (_ssa_op2_def_info(op_array, ssa, (opline+1), ssa_op ? (ssa_op+1) : NULL)) |
207 | 727k | #define RES_INFO() (_ssa_result_def_info(op_array, ssa, opline, ssa_op)) |
208 | | |
209 | 7.77k | static zend_always_inline bool zend_add_will_overflow(zend_long a, zend_long b) { |
210 | 7.77k | return (b > 0 && a > ZEND_LONG_MAX - b) |
211 | 7.77k | || (b < 0 && a < ZEND_LONG_MIN - b); |
212 | 7.77k | } Unexecuted instantiation: dce.c:zend_add_will_overflow Unexecuted instantiation: dfa_pass.c:zend_add_will_overflow Unexecuted instantiation: escape_analysis.c:zend_add_will_overflow Unexecuted instantiation: sccp.c:zend_add_will_overflow Unexecuted instantiation: zend_call_graph.c:zend_add_will_overflow Unexecuted instantiation: zend_dump.c:zend_add_will_overflow Unexecuted instantiation: zend_func_info.c:zend_add_will_overflow zend_inference.c:zend_add_will_overflow Line | Count | Source | 209 | 2.59k | static zend_always_inline bool zend_add_will_overflow(zend_long a, zend_long b) { | 210 | 2.59k | return (b > 0 && a > ZEND_LONG_MAX - b) | 211 | 2.59k | || (b < 0 && a < ZEND_LONG_MIN - b); | 212 | 2.59k | } |
Unexecuted instantiation: zend_optimizer.c:zend_add_will_overflow zend_ssa.c:zend_add_will_overflow Line | Count | Source | 209 | 5.17k | static zend_always_inline bool zend_add_will_overflow(zend_long a, zend_long b) { | 210 | 5.17k | return (b > 0 && a > ZEND_LONG_MAX - b) | 211 | 5.17k | || (b < 0 && a < ZEND_LONG_MIN - b); | 212 | 5.17k | } |
|
213 | 5.25k | static zend_always_inline bool zend_sub_will_overflow(zend_long a, zend_long b) { |
214 | 5.25k | return (b > 0 && a < ZEND_LONG_MIN + b) |
215 | 5.25k | || (b < 0 && a > ZEND_LONG_MAX + b); |
216 | 5.25k | } Unexecuted instantiation: dce.c:zend_sub_will_overflow Unexecuted instantiation: dfa_pass.c:zend_sub_will_overflow Unexecuted instantiation: escape_analysis.c:zend_sub_will_overflow Unexecuted instantiation: sccp.c:zend_sub_will_overflow Unexecuted instantiation: zend_call_graph.c:zend_sub_will_overflow Unexecuted instantiation: zend_dump.c:zend_sub_will_overflow Unexecuted instantiation: zend_func_info.c:zend_sub_will_overflow zend_inference.c:zend_sub_will_overflow Line | Count | Source | 213 | 3.02k | static zend_always_inline bool zend_sub_will_overflow(zend_long a, zend_long b) { | 214 | 3.02k | return (b > 0 && a < ZEND_LONG_MIN + b) | 215 | 3.02k | || (b < 0 && a > ZEND_LONG_MAX + b); | 216 | 3.02k | } |
Unexecuted instantiation: zend_optimizer.c:zend_sub_will_overflow zend_ssa.c:zend_sub_will_overflow Line | Count | Source | 213 | 2.22k | static zend_always_inline bool zend_sub_will_overflow(zend_long a, zend_long b) { | 214 | 2.22k | return (b > 0 && a < ZEND_LONG_MIN + b) | 215 | 2.22k | || (b < 0 && a > ZEND_LONG_MAX + b); | 216 | 2.22k | } |
|
217 | | |
218 | | BEGIN_EXTERN_C() |
219 | | |
220 | | ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ssa); |
221 | | ZEND_API void zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa); |
222 | | ZEND_API zend_result zend_ssa_inference(zend_arena **raena, const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimization_level); |
223 | | |
224 | | ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, int write, int insert); |
225 | | |
226 | | ZEND_API bool zend_inference_propagate_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op* ssa_op, int var, zend_ssa_range *tmp); |
227 | | |
228 | | ZEND_API uint32_t zend_fetch_arg_info_type( |
229 | | const zend_script *script, const zend_arg_info *arg_info, zend_class_entry **pce); |
230 | | ZEND_API void zend_init_func_return_info( |
231 | | const zend_op_array *op_array, const zend_script *script, zend_ssa_var_info *ret); |
232 | | uint32_t zend_get_return_info_from_signature_only( |
233 | | const zend_function *func, const zend_script *script, |
234 | | zend_class_entry **ce, bool *ce_is_instanceof, bool use_tentative_return_info); |
235 | | |
236 | | ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, const zend_ssa *ssa, uint32_t t1, uint32_t t2); |
237 | | ZEND_API bool zend_may_throw(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, const zend_ssa *ssa); |
238 | | |
239 | | ZEND_API zend_result zend_update_type_info( |
240 | | const zend_op_array *op_array, zend_ssa *ssa, const zend_script *script, |
241 | | zend_op *opline, zend_ssa_op *ssa_op, const zend_op **ssa_opcodes, |
242 | | zend_long optimization_level); |
243 | | |
244 | | END_EXTERN_C() |
245 | | |
246 | | #endif /* ZEND_INFERENCE_H */ |