• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP gen_executor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中gen_executor函数的典型用法代码示例。如果您正苦于以下问题:PHP gen_executor函数的具体用法?PHP gen_executor怎么用?PHP gen_executor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了gen_executor函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: gen_vm


//.........这里部分代码省略.........
    out($f, "# pragma warning(once : 4101)\n");
    if (ZEND_VM_SPEC) {
        // Suppress (<non-zero constant> || <expression>) warnings on windows
        out($f, "# pragma warning(once : 6235)\n");
        // Suppress (<zero> && <expression>) warnings on windows
        out($f, "# pragma warning(once : 6237)\n");
        // Suppress (<non-zero constant> && <expression>) warnings on windows
        out($f, "# pragma warning(once : 6239)\n");
        // Suppress (<expression> && <non-zero constant>) warnings on windows
        out($f, "# pragma warning(once : 6240)\n");
        // Suppress (<non-zero constant> || <non-zero constant>) warnings on windows
        out($f, "# pragma warning(once : 6285)\n");
        // Suppress (<non-zero constant> || <expression>) warnings on windows
        out($f, "# pragma warning(once : 6286)\n");
        // Suppress constant with constant comparison warnings on windows
        out($f, "# pragma warning(once : 6326)\n");
    }
    out($f, "#endif\n");
    // Support for ZEND_USER_OPCODE
    out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
    for ($i = 0; $i < 255; ++$i) {
        out($f, "\t(user_opcode_handler_t)NULL,\n");
    }
    out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
    out($f, "static zend_uchar zend_user_opcodes[256] = {");
    for ($i = 0; $i < 255; ++$i) {
        if ($i % 16 == 1) {
            out($f, "\n\t");
        }
        out($f, "{$i},");
    }
    out($f, "255\n};\n\n");
    // Generate specialized executor
    gen_executor($f, $skl, ZEND_VM_SPEC, ZEND_VM_KIND, "execute", "zend_init_opcodes_handlers");
    // Generate zend_vm_get_opcode_handler() function
    out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n");
    out($f, "{\n");
    if (!ZEND_VM_SPEC) {
        out($f, "\treturn zend_opcode_handlers[opcode];\n");
    } else {
        out($f, "\t\tstatic const int zend_vm_decode[] = {\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 0              */\n");
        out($f, "\t\t\t_CONST_CODE,  /* 1 = IS_CONST   */\n");
        out($f, "\t\t\t_TMP_CODE,    /* 2 = IS_TMP_VAR */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 3              */\n");
        out($f, "\t\t\t_VAR_CODE,    /* 4 = IS_VAR     */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 5              */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 6              */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 7              */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 8 = IS_UNUSED  */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 9              */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 10             */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 11             */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 12             */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 13             */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 14             */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 15             */\n");
        out($f, "\t\t\t_CV_CODE      /* 16 = IS_CV     */\n");
        out($f, "\t\t};\n");
        out($f, "\t\treturn zend_opcode_handlers[opcode * 25 + zend_vm_decode[op->op1_type] * 5 + zend_vm_decode[op->op2_type]];\n");
    }
    out($f, "}\n\n");
    // Generate zend_vm_get_opcode_handler() function
    out($f, "ZEND_API void zend_vm_set_opcode_handler(zend_op* op)\n");
    out($f, "{\n");
    out($f, "\top->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op);\n");
开发者ID:sutandang,项目名称:php-src,代码行数:67,代码来源:zend_vm_gen.php


示例2: gen_vm


//.........这里部分代码省略.........
    $code_len = strlen((string) $max_opcode);
    $f = fopen(__DIR__ . "/zend_vm_opcodes.h", "w+") or die("ERROR: Cannot create zend_vm_opcodes.h\n");
    // Insert header
    out($f, $GLOBALS['header_text']);
    foreach ($opcodes as $code => $dsc) {
        $code = str_pad((string) $code, $code_len, " ", STR_PAD_LEFT);
        $op = str_pad($dsc["op"], $max_opcode_len);
        fputs($f, "#define {$op} {$code}\n");
    }
    fclose($f);
    echo "zend_vm_opcodes.h generated successfully.\n";
    // Generate zend_vm_execute.h
    $f = fopen(__DIR__ . "/zend_vm_execute.h", "w+") or die("ERROR: Cannot create zend_vm_execute.h\n");
    $executor_file = realpath(__DIR__ . "/zend_vm_execute.h");
    // Insert header
    out($f, $GLOBALS['header_text']);
    // Suppress free_op1 warnings on Windows
    out($f, "#ifdef ZEND_WIN32\n# pragma warning(once : 4101)\n#endif\n");
    // Support for ZEND_USER_OPCODE
    out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
    for ($i = 0; $i < 255; ++$i) {
        out($f, "\t(user_opcode_handler_t)NULL,\n");
    }
    out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
    out($f, "static zend_uchar zend_user_opcodes[256] = {");
    for ($i = 0; $i < 255; ++$i) {
        if ($i % 16 == 1) {
            out($f, "\n\t");
        }
        out($f, "{$i},");
    }
    out($f, "255\n};\n\n");
    // Generate specialized executor
    gen_executor($f, $skl, ZEND_VM_SPEC, ZEND_VM_KIND, "execute", "zend_init_opcodes_handlers", 0);
    // Generate un-specialized executor
    if (ZEND_VM_OLD_EXECUTOR) {
        out($f, "\n/* Old executor */\n\n");
        out($f, "#undef ZEND_VM_CONTINUE\n\n");
        out($f, "#undef ZEND_VM_RETURN\n\n");
        out($f, "#undef ZEND_VM_ENTER\n\n");
        out($f, "#undef ZEND_VM_LEAVE\n\n");
        out($f, "#undef ZEND_VM_DISPATCH\n\n");
        out($f, "#undef ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL\n\n");
        gen_executor($f, $skl, 0, ZEND_VM_KIND_CALL, "old_execute", "zend_vm_use_old_executor", 1);
    }
    // Generate zend_vm_get_opcode_handler() function
    out($f, "static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op)\n");
    out($f, "{\n");
    if (!ZEND_VM_SPEC) {
        out($f, "\treturn zend_opcode_handlers[opcode];\n");
    } else {
        if (ZEND_VM_OLD_EXECUTOR) {
            out($f, "\tif (zend_vm_old_executor) {\n");
            out($f, "\t\treturn zend_opcode_handlers[opcode];\n");
            out($f, "\t} else {\n");
        }
        out($f, "\t\tstatic const int zend_vm_decode[] = {\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 0              */\n");
        out($f, "\t\t\t_CONST_CODE,  /* 1 = IS_CONST   */\n");
        out($f, "\t\t\t_TMP_CODE,    /* 2 = IS_TMP_VAR */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 3              */\n");
        out($f, "\t\t\t_VAR_CODE,    /* 4 = IS_VAR     */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 5              */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 6              */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 7              */\n");
        out($f, "\t\t\t_UNUSED_CODE, /* 8 = IS_UNUSED  */\n");
开发者ID:rrehbeindoi,项目名称:php-src,代码行数:67,代码来源:zend_vm_gen.php


示例3: gen_vm


//.........这里部分代码省略.........
    out($f, "# pragma warning(disable : 4101)\n");
    if (ZEND_VM_SPEC) {
        // Suppress (<non-zero constant> || <expression>) warnings on windows
        out($f, "# pragma warning(once : 6235)\n");
        // Suppress (<zero> && <expression>) warnings on windows
        out($f, "# pragma warning(once : 6237)\n");
        // Suppress (<non-zero constant> && <expression>) warnings on windows
        out($f, "# pragma warning(once : 6239)\n");
        // Suppress (<expression> && <non-zero constant>) warnings on windows
        out($f, "# pragma warning(once : 6240)\n");
        // Suppress (<non-zero constant> || <non-zero constant>) warnings on windows
        out($f, "# pragma warning(once : 6285)\n");
        // Suppress (<non-zero constant> || <expression>) warnings on windows
        out($f, "# pragma warning(once : 6286)\n");
        // Suppress constant with constant comparison warnings on windows
        out($f, "# pragma warning(once : 6326)\n");
    }
    out($f, "#endif\n");
    // Support for ZEND_USER_OPCODE
    out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
    for ($i = 0; $i < 255; ++$i) {
        out($f, "\t(user_opcode_handler_t)NULL,\n");
    }
    out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
    out($f, "static zend_uchar zend_user_opcodes[256] = {");
    for ($i = 0; $i < 255; ++$i) {
        if ($i % 16 == 1) {
            out($f, "\n\t");
        }
        out($f, "{$i},");
    }
    out($f, "255\n};\n\n");
    // Generate specialized executor
    gen_executor($f, $skl, ZEND_VM_SPEC, ZEND_VM_KIND, "execute", "zend_init_opcodes_handlers");
    // Generate zend_vm_get_opcode_handler() function
    out($f, "static const void *zend_vm_get_opcode_handler_ex(uint32_t spec, const zend_op* op)\n");
    out($f, "{\n");
    if (!ZEND_VM_SPEC) {
        out($f, "\treturn zend_opcode_handlers[spec];\n");
    } else {
        out($f, "\tstatic const int zend_vm_decode[] = {\n");
        out($f, "\t\t_UNUSED_CODE, /* 0              */\n");
        out($f, "\t\t_CONST_CODE,  /* 1 = IS_CONST   */\n");
        out($f, "\t\t_TMP_CODE,    /* 2 = IS_TMP_VAR */\n");
        out($f, "\t\t_UNUSED_CODE, /* 3              */\n");
        out($f, "\t\t_VAR_CODE,    /* 4 = IS_VAR     */\n");
        out($f, "\t\t_UNUSED_CODE, /* 5              */\n");
        out($f, "\t\t_UNUSED_CODE, /* 6              */\n");
        out($f, "\t\t_UNUSED_CODE, /* 7              */\n");
        out($f, "\t\t_UNUSED_CODE, /* 8 = IS_UNUSED  */\n");
        out($f, "\t\t_UNUSED_CODE, /* 9              */\n");
        out($f, "\t\t_UNUSED_CODE, /* 10             */\n");
        out($f, "\t\t_UNUSED_CODE, /* 11             */\n");
        out($f, "\t\t_UNUSED_CODE, /* 12             */\n");
        out($f, "\t\t_UNUSED_CODE, /* 13             */\n");
        out($f, "\t\t_UNUSED_CODE, /* 14             */\n");
        out($f, "\t\t_UNUSED_CODE, /* 15             */\n");
        out($f, "\t\t_CV_CODE      /* 16 = IS_CV     */\n");
        out($f, "\t};\n");
        out($f, "\tuint32_t offset = 0;\n");
        out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
        out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
        if (isset($used_extra_spec["OP_DATA"])) {
            out($f, "\tif (spec & SPEC_RULE_OP_DATA) offset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];\n");
        }
        if (isset($used_extra_spec["RETVAL"])) {
开发者ID:jimjag,项目名称:php-src,代码行数:67,代码来源:zend_vm_gen.php



注:本文中的gen_executor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP gen_executor_code函数代码示例发布时间:2022-05-15
下一篇:
PHP gen_db_date函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap