@@ -1283,6 +1283,39 @@ void zend_update_parent_ce(zend_class_entry *ce)
1283
1283
}
1284
1284
}
1285
1285
1286
+ static void zend_accel_persist_jit_op_array (zend_op_array * op_array , zend_class_entry * ce )
1287
+ {
1288
+ if (op_array -> type == ZEND_USER_FUNCTION ) {
1289
+ if (op_array -> scope == ce
1290
+ && !(op_array -> fn_flags & ZEND_ACC_ABSTRACT )
1291
+ && !(op_array -> fn_flags & ZEND_ACC_TRAIT_CLONE )) {
1292
+ zend_jit_op_array (op_array , ZCG (current_persistent_script ) ? & ZCG (current_persistent_script )-> script : NULL );
1293
+ for (uint32_t i = 0 ; i < op_array -> num_dynamic_func_defs ; i ++ ) {
1294
+ zend_jit_op_array (op_array -> dynamic_func_defs [i ], ZCG (current_persistent_script ) ? & ZCG (current_persistent_script )-> script : NULL );
1295
+ }
1296
+ }
1297
+ }
1298
+ }
1299
+
1300
+ static void zend_accel_persist_link_func_info (zend_op_array * op_array , zend_class_entry * ce )
1301
+ {
1302
+ if (op_array -> type == ZEND_USER_FUNCTION
1303
+ && !(op_array -> fn_flags & ZEND_ACC_ABSTRACT )) {
1304
+ if ((op_array -> scope != ce
1305
+ || (op_array -> fn_flags & ZEND_ACC_TRAIT_CLONE ))
1306
+ && (JIT_G (trigger ) == ZEND_JIT_ON_FIRST_EXEC
1307
+ || JIT_G (trigger ) == ZEND_JIT_ON_PROF_REQUEST
1308
+ || JIT_G (trigger ) == ZEND_JIT_ON_HOT_COUNTERS
1309
+ || JIT_G (trigger ) == ZEND_JIT_ON_HOT_TRACE )) {
1310
+ void * jit_extension = zend_shared_alloc_get_xlat_entry (op_array -> opcodes );
1311
+
1312
+ if (jit_extension ) {
1313
+ ZEND_SET_FUNC_INFO (op_array , jit_extension );
1314
+ }
1315
+ }
1316
+ }
1317
+ }
1318
+
1286
1319
static void zend_accel_persist_class_table (HashTable * class_table )
1287
1320
{
1288
1321
Bucket * p ;
@@ -1309,44 +1342,48 @@ static void zend_accel_persist_class_table(HashTable *class_table)
1309
1342
if (JIT_G (on ) && JIT_G (opt_level ) <= ZEND_JIT_LEVEL_OPT_FUNCS &&
1310
1343
!ZCG (current_persistent_script )-> corrupted ) {
1311
1344
zend_op_array * op_array ;
1345
+ zend_property_info * prop ;
1312
1346
1313
1347
ZEND_HASH_MAP_FOREACH_BUCKET (class_table , p ) {
1314
1348
if (EXPECTED (Z_TYPE (p -> val ) != IS_ALIAS_PTR )) {
1315
1349
ce = Z_PTR (p -> val );
1316
1350
ZEND_HASH_MAP_FOREACH_PTR (& ce -> function_table , op_array ) {
1317
- if (op_array -> type == ZEND_USER_FUNCTION ) {
1318
- if (op_array -> scope == ce
1319
- && !(op_array -> fn_flags & ZEND_ACC_ABSTRACT )
1320
- && !(op_array -> fn_flags & ZEND_ACC_TRAIT_CLONE )) {
1321
- zend_jit_op_array (op_array , ZCG (current_persistent_script ) ? & ZCG (current_persistent_script )-> script : NULL );
1322
- for (uint32_t i = 0 ; i < op_array -> num_dynamic_func_defs ; i ++ ) {
1323
- zend_jit_op_array (op_array -> dynamic_func_defs [i ], ZCG (current_persistent_script ) ? & ZCG (current_persistent_script )-> script : NULL );
1351
+ zend_accel_persist_jit_op_array (op_array , ce );
1352
+ } ZEND_HASH_FOREACH_END ();
1353
+
1354
+ if (ce -> num_hooked_props > 0 ) {
1355
+ ZEND_HASH_MAP_FOREACH_PTR (& ce -> properties_info , prop ) {
1356
+ if (prop -> hooks ) {
1357
+ for (uint32_t i = 0 ; i < ZEND_PROPERTY_HOOK_COUNT ; i ++ ) {
1358
+ if (prop -> hooks [i ]) {
1359
+ op_array = & prop -> hooks [i ]-> op_array ;
1360
+ zend_accel_persist_jit_op_array (op_array , ce );
1361
+ }
1324
1362
}
1325
1363
}
1326
- }
1327
- } ZEND_HASH_FOREACH_END ();
1364
+ } ZEND_HASH_FOREACH_END ();
1365
+ }
1328
1366
}
1329
1367
} ZEND_HASH_FOREACH_END ();
1330
1368
ZEND_HASH_MAP_FOREACH_BUCKET (class_table , p ) {
1331
1369
if (EXPECTED (Z_TYPE (p -> val ) != IS_ALIAS_PTR )) {
1332
1370
ce = Z_PTR (p -> val );
1333
1371
ZEND_HASH_MAP_FOREACH_PTR (& ce -> function_table , op_array ) {
1334
- if (op_array -> type == ZEND_USER_FUNCTION
1335
- && !(op_array -> fn_flags & ZEND_ACC_ABSTRACT )) {
1336
- if ((op_array -> scope != ce
1337
- || (op_array -> fn_flags & ZEND_ACC_TRAIT_CLONE ))
1338
- && (JIT_G (trigger ) == ZEND_JIT_ON_FIRST_EXEC
1339
- || JIT_G (trigger ) == ZEND_JIT_ON_PROF_REQUEST
1340
- || JIT_G (trigger ) == ZEND_JIT_ON_HOT_COUNTERS
1341
- || JIT_G (trigger ) == ZEND_JIT_ON_HOT_TRACE )) {
1342
- void * jit_extension = zend_shared_alloc_get_xlat_entry (op_array -> opcodes );
1343
-
1344
- if (jit_extension ) {
1345
- ZEND_SET_FUNC_INFO (op_array , jit_extension );
1372
+ zend_accel_persist_link_func_info (op_array , ce );
1373
+ } ZEND_HASH_FOREACH_END ();
1374
+
1375
+ if (ce -> num_hooked_props > 0 ) {
1376
+ ZEND_HASH_MAP_FOREACH_PTR (& ce -> properties_info , prop ) {
1377
+ if (prop -> hooks ) {
1378
+ for (uint32_t i = 0 ; i < ZEND_PROPERTY_HOOK_COUNT ; i ++ ) {
1379
+ if (prop -> hooks [i ]) {
1380
+ op_array = & prop -> hooks [i ]-> op_array ;
1381
+ zend_accel_persist_link_func_info (op_array , ce );
1382
+ }
1346
1383
}
1347
1384
}
1348
- }
1349
- } ZEND_HASH_FOREACH_END ();
1385
+ } ZEND_HASH_FOREACH_END ();
1386
+ }
1350
1387
}
1351
1388
} ZEND_HASH_FOREACH_END ();
1352
1389
}
0 commit comments