Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92327 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31425 invoked from network); 15 Apr 2016 09:27:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Apr 2016 09:27:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=cornelius.howl@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cornelius.howl@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.45 as permitted sender) X-PHP-List-Original-Sender: cornelius.howl@gmail.com X-Host-Fingerprint: 209.85.218.45 mail-oi0-f45.google.com Received: from [209.85.218.45] ([209.85.218.45:35473] helo=mail-oi0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/10-29891-FE3B0175 for ; Fri, 15 Apr 2016 05:27:11 -0400 Received: by mail-oi0-f45.google.com with SMTP id p188so118656934oih.2 for ; Fri, 15 Apr 2016 02:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=EsH+RskcSh5e15hb5AdbwWBV4eBDeZhDxAmV+4jj4JA=; b=Fev7Sm5+uUDZhwlyFHqSpShr8omGJASz/ZpHFRl9jtW2MMpgrLWyAOuk8CGg6sGJae /u8k/XdvLWbd5t/I8/1KtQoSaJMf9hG50sRVEj+Tp5hsC1GjophwpXEqnyyIIfxKhIRV p2Sg9EBfPeYtUe4VISSZXbGdki8af5uvjj15Ur6skcVAJl4suA1+QyqcbPyH5iBN2mQC v6joHxB75w259Jadtp3AfhH8rCyeaAHi2/Iw/Qpqrwcmm5Xcj2YPjDLbIpSVgqBNAsKw zkrHHp20vgOSQhMswkzmerCKuR8HGfc00iKiwZi1vWOB/AstQHGvc4jlToxo8DU37gl8 EU3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=EsH+RskcSh5e15hb5AdbwWBV4eBDeZhDxAmV+4jj4JA=; b=ag+gU6Zgjg4uYUuucjODBn0wHL5Ecy8uNlWyKuHkY0MOfb+L+doRIphX914GZAqCKt Hxbe+UmFGUOqhgiuXjSYZM0RbnPrP+zqacWU11lEpnzW/KXzmUzK7FQ/eugS76bBERsL YV9AWs4wOuA63lHOM6n3G4GqGWKlnwZ8g5w6DTBfePBpUQHxEMIW1GfXK/etI3jr2YBk zKR35P6r++ypikZpHkiaqXEBw7yBE0RXGTtJ43JGlF3QzEpp3ayA+S6NXeGSYYs0JMF3 JH0Yx+jrD/B1oP0vJ4hno39Hi1+KXq4FyF2N8wDL17QdcV2r9C0Q4MV9Xig0Uz8NgWxw gPPA== X-Gm-Message-State: AOPr4FXYT+flYeBYSlsPbAVx/DJMfuXTH22PsnOIbUqAzT1fFpgpL8G2gmALE9JJm3vFpyZh66amBvTlpKLvAQ== MIME-Version: 1.0 X-Received: by 10.202.83.75 with SMTP id h72mr9691002oib.121.1460712429289; Fri, 15 Apr 2016 02:27:09 -0700 (PDT) Received: by 10.157.7.194 with HTTP; Fri, 15 Apr 2016 02:27:09 -0700 (PDT) Date: Fri, 15 Apr 2016 17:27:09 +0800 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113de8e4778e200530829de6 Subject: optimization for function call without paremters From: cornelius.howl@gmail.com (Lin Yo-An) --001a113de8e4778e200530829de6 Content-Type: text/plain; charset=UTF-8 Hi Dmitry, I found that INIT_FCALL doesn't use opline->result.var and DO_ICALL doesn't use op1 or op2. The original purpose of separating these two op was for sending parameters. However, if a function doesn't need parameters and it's an internal function, I think the operation could be merged into INIT_FCALL. So I guess we can do this below to reduce one bytecode for each function call without parameters: if (opline->extended_value == 0) { // call the function directly and store the value in the result. } Your thoughts? Best Regards, Yo-An Lin --001a113de8e4778e200530829de6--