From: Dmitry Stogov Date: Mon, 27 Apr 2015 11:16:29 +0000 (+0300) Subject: Pass class_entry through IS_VAR to avoid hash lookup in ZEND_NEW. X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~149^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8acd7f49dafa9b9743d2921b3f3e49503d9fe342;p=php Pass class_entry through IS_VAR to avoid hash lookup in ZEND_NEW. --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c4170673cb..ddd1346d81 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3246,13 +3246,13 @@ void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */ } else if (class_ast->kind == ZEND_AST_CLASS) { uint32_t dcl_opnum = get_next_op_number(CG(active_op_array)); zend_class_entry *ce = zend_compile_class_decl(class_ast); - class_node.op_type = IS_CONST; - ZVAL_STR_COPY(&class_node.u.constant, ce->name); /* jump over anon class declaration */ opline = &CG(active_op_array)->opcodes[dcl_opnum]; if (opline->opcode == ZEND_FETCH_CLASS) { opline++; } + class_node.op_type = opline->result_type; + class_node.u.op.var = opline->result.var; opline->op1.opline_num = get_next_op_number(CG(active_op_array)); } else { zend_compile_class_ref(&class_node, class_ast, 1);