@@ -1607,39 +1607,22 @@ static zend_always_inline void _object_properties_init(zend_object *object, zend
1607
1607
if (class_type -> default_properties_count ) {
1608
1608
zval * src = CE_DEFAULT_PROPERTIES_TABLE (class_type );
1609
1609
zval * dst = object -> properties_table ;
1610
- #if 0
1611
- if (false && !(class_type -> ce_flags & ZEND_ACC_HAS_RC_PROPS )) {//TODO: disabled; also actually this may replace the internal class thing?
1612
- // printf("fast path %s\n", class_type->name->val);
1613
- memcpy (dst , src , sizeof (zval ) * class_type -> default_properties_count );
1614
- // zval *end = src + class_type->default_properties_count;
1615
- // do {
1616
- // ZVAL_COPY_VALUE_PROP(dst, src);
1617
- // src++;
1618
- // dst++;
1619
- // } while (src != end);
1610
+ #if 1
1611
+ zval * end = src + class_type -> default_properties_count ;
1612
+ if (UNEXPECTED (class_type -> type == ZEND_INTERNAL_CLASS )) {
1613
+ do {
1614
+ ZVAL_COPY_OR_DUP_PROP (dst , src );
1615
+ src ++ ;
1616
+ dst ++ ;
1617
+ } while (src != end );
1620
1618
} else {
1621
- // printf("slow path %s\n", class_type->name->val);
1622
- // zval *end = src + class_type->default_properties_count;
1623
-
1624
- if (UNEXPECTED (class_type -> type == ZEND_INTERNAL_CLASS )) {
1625
- // do {
1626
- // ZVAL_COPY_OR_DUP_PROP(dst, src);
1627
- // src++;
1628
- // dst++;
1629
- // } while (src != end);
1630
- // TODO: assertion?
1631
- /* zend_declare_typed_property() disallows refcounted default property values in internal classes */
1632
- memcpy (dst , src , sizeof (zval ) * class_type -> default_properties_count );
1633
- } else {
1634
- zval * end = src + class_type -> default_properties_count ;
1635
- do {
1636
- ZVAL_COPY_PROP (dst , src );
1637
- src ++ ;
1638
- dst ++ ;
1639
- } while (src != end );
1640
- }
1619
+ do {
1620
+ ZVAL_COPY_PROP (dst , src );
1621
+ src ++ ;
1622
+ dst ++ ;
1623
+ } while (src != end );
1641
1624
}
1642
- #endif
1625
+ #else
1643
1626
if (EXPECTED (class_type -> ce_flags & ZEND_ACC_HAS_RC_PROPS )) {
1644
1627
zval * end = src + class_type -> default_properties_count ;
1645
1628
do {
@@ -1652,6 +1635,7 @@ static zend_always_inline void _object_properties_init(zend_object *object, zend
1652
1635
/* zend_declare_typed_property() disallows refcounted default property values in internal classes */
1653
1636
memcpy (dst , src , sizeof (zval ) * class_type -> default_properties_count );
1654
1637
}
1638
+ #endif
1655
1639
}
1656
1640
}
1657
1641
/* }}} */
0 commit comments