File tree Expand file tree Collapse file tree 3 files changed +1998
-1576
lines changed Expand file tree Collapse file tree 3 files changed +1998
-1576
lines changed Original file line number Diff line number Diff line change @@ -2215,11 +2215,40 @@ static zend_always_inline zend_generator *zend_get_running_generator(zend_execut
2215
2215
#define ZEND_VM_INC_OPCODE () \
2216
2216
OPLINE++
2217
2217
2218
- #define ZEND_VM_REPEATABLE_OPCODE \
2219
- do {
2220
2218
2221
- #define ZEND_VM_REPEAT_OPCODE (_opcode ) \
2219
+ #ifndef VM_SMART_OPCODES
2220
+ # define VM_SMART_OPCODES 1
2221
+ #endif
2222
+
2223
+ #if VM_SMART_OPCODES
2224
+ # define ZEND_VM_REPEATABLE_OPCODE \
2225
+ do {
2226
+ # define ZEND_VM_REPEAT_OPCODE (_opcode ) \
2222
2227
} while (UNEXPECTED(OPLINE->opcode == _opcode))
2228
+ # define ZEND_VM_SMART_BRANCH (_result , _check ) do { \
2229
+ int __result; \
2230
+ if (EXPECTED((opline+1)->opcode == ZEND_JMPZ)) { \
2231
+ __result = (_result); \
2232
+ } else if (EXPECTED((opline+1)->opcode == ZEND_JMPNZ)) { \
2233
+ __result = !(_result); \
2234
+ } else { \
2235
+ break; \
2236
+ } \
2237
+ if ((_check) && UNEXPECTED(EG(exception))) { \
2238
+ HANDLE_EXCEPTION(); \
2239
+ } \
2240
+ if (__result) { \
2241
+ ZEND_VM_SET_NEXT_OPCODE(opline + 2); \
2242
+ } else { \
2243
+ ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline + 1, (opline+1)->op2)); \
2244
+ } \
2245
+ ZEND_VM_CONTINUE(); \
2246
+ } while (0)
2247
+ #else
2248
+ # define ZEND_VM_REPEATABLE_OPCODE
2249
+ # define ZEND_VM_REPEAT_OPCODE (_opcode )
2250
+ # define ZEND_VM_SMART_BRANCH (_result , _check )
2251
+ #endif
2223
2252
2224
2253
#ifdef __GNUC__
2225
2254
# define ZEND_VM_GUARD (name ) __asm__("#" #name)
You can’t perform that action at this time.
0 commit comments