@@ -140,14 +140,12 @@ void zend_accel_move_user_classes(HashTable *src, uint32_t count, zend_script *s
140
140
src -> pDestructor = orig_dtor ;
141
141
}
142
142
143
- static void zend_accel_function_hash_copy (HashTable * target , HashTable * source )
143
+ static zend_always_inline void _zend_accel_function_hash_copy (HashTable * target , HashTable * source , bool call_observers )
144
144
{
145
145
zend_function * function1 , * function2 ;
146
146
Bucket * p , * end ;
147
147
zval * t ;
148
148
149
- bool call_observers = zend_observer_function_declared_observed ;
150
-
151
149
zend_hash_extend (target , target -> nNumUsed + source -> nNumUsed , 0 );
152
150
p = source -> arData ;
153
151
end = p + source -> nNumUsed ;
@@ -164,6 +162,7 @@ static void zend_accel_function_hash_copy(HashTable *target, HashTable *source)
164
162
}
165
163
}
166
164
target -> nInternalPointer = 0 ;
165
+
167
166
return ;
168
167
169
168
failure :
@@ -183,13 +182,21 @@ static void zend_accel_function_hash_copy(HashTable *target, HashTable *source)
183
182
}
184
183
}
185
184
186
- static void zend_accel_class_hash_copy (HashTable * target , HashTable * source )
185
+ static zend_always_inline void zend_accel_function_hash_copy (HashTable * target , HashTable * source )
186
+ {
187
+ _zend_accel_function_hash_copy (target , source , 0 );
188
+ }
189
+
190
+ static zend_never_inline void zend_accel_function_hash_copy_notify (HashTable * target , HashTable * source )
191
+ {
192
+ _zend_accel_function_hash_copy (target , source , 1 );
193
+ }
194
+
195
+ static zend_always_inline void _zend_accel_class_hash_copy (HashTable * target , HashTable * source , bool call_observers )
187
196
{
188
197
Bucket * p , * end ;
189
198
zval * t ;
190
199
191
- bool call_observers = zend_observer_class_linked_observed ;
192
-
193
200
zend_hash_extend (target , target -> nNumUsed + source -> nNumUsed , 0 );
194
201
p = source -> arData ;
195
202
end = p + source -> nNumUsed ;
@@ -238,6 +245,16 @@ static void zend_accel_class_hash_copy(HashTable *target, HashTable *source)
238
245
target -> nInternalPointer = 0 ;
239
246
}
240
247
248
+ static zend_always_inline void zend_accel_class_hash_copy (HashTable * target , HashTable * source )
249
+ {
250
+ _zend_accel_class_hash_copy (target , source , 0 );
251
+ }
252
+
253
+ static zend_never_inline void zend_accel_class_hash_copy_notify (HashTable * target , HashTable * source )
254
+ {
255
+ _zend_accel_class_hash_copy (target , source , 1 );
256
+ }
257
+
241
258
void zend_accel_build_delayed_early_binding_list (zend_persistent_script * persistent_script )
242
259
{
243
260
zend_op_array * op_array = & persistent_script -> script .main_op_array ;
@@ -377,11 +394,19 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
377
394
}
378
395
379
396
if (zend_hash_num_elements (& persistent_script -> script .function_table ) > 0 ) {
380
- zend_accel_function_hash_copy (CG (function_table ), & persistent_script -> script .function_table );
397
+ if (EXPECTED (!zend_observer_function_declared_observed )) {
398
+ zend_accel_function_hash_copy (CG (function_table ), & persistent_script -> script .function_table );
399
+ } else {
400
+ zend_accel_function_hash_copy_notify (CG (function_table ), & persistent_script -> script .function_table );
401
+ }
381
402
}
382
403
383
404
if (zend_hash_num_elements (& persistent_script -> script .class_table ) > 0 ) {
384
- zend_accel_class_hash_copy (CG (class_table ), & persistent_script -> script .class_table );
405
+ if (EXPECTED (!zend_observer_class_linked_observed )) {
406
+ zend_accel_class_hash_copy (CG (class_table ), & persistent_script -> script .class_table );
407
+ } else {
408
+ zend_accel_class_hash_copy_notify (CG (class_table ), & persistent_script -> script .class_table );
409
+ }
385
410
}
386
411
387
412
if (persistent_script -> num_early_bindings ) {
0 commit comments