]> granicus.if.org Git - php/commitdiff
Micro-optimization
authorDmitry Stogov <dmitry@zend.com>
Thu, 5 May 2016 13:19:59 +0000 (16:19 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 5 May 2016 13:19:59 +0000 (16:19 +0300)
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 791b6feceacf477afcbb53b9dd9b6178446b22dc..6694a183c548a0cdb1d80c939b68b61e17d49b00 100644 (file)
@@ -290,7 +290,7 @@ ZEND_VM_HANDLER(8, ZEND_CONCAT, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;
index 273b2cb55567ed88efa63e9966e16441b1035171..0911a61806a9643d113d77bb3d04a53f2abfcd83 100644 (file)
@@ -4295,7 +4295,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CONST_HANDLE
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;
@@ -8187,7 +8187,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CV_HANDLER(Z
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;
@@ -10060,7 +10060,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_TMPVAR_HANDL
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;
@@ -36347,7 +36347,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CONST_HANDLER(Z
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;
@@ -43001,7 +43001,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;
@@ -46675,7 +46675,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_TMPVAR_HANDLER(
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;
@@ -50594,7 +50594,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_CONST_HANDL
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;
@@ -52996,7 +52996,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_CV_HANDLER(
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;
@@ -54160,7 +54160,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_HAND
                            !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
                            size_t len = ZSTR_LEN(op1_str);
 
-                               str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
+                               str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
                                memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
                                ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
                                break;