Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91654 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91506 invoked from network); 14 Mar 2016 12:23:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2016 12:23:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.178 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.178 mail-yw0-f178.google.com Received: from [209.85.161.178] ([209.85.161.178:34780] helo=mail-yw0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/F1-10845-82DA6E65 for ; Mon, 14 Mar 2016 07:23:06 -0500 Received: by mail-yw0-f178.google.com with SMTP id h129so164431827ywb.1 for ; Mon, 14 Mar 2016 05:23:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=nps25n40aVTW6YPAAI7Sr9fscYA9XD4aRvJr7h8iAE0=; b=kYS6qmmoY/Hn8ArqVYMVBAxrLCJSDUevwvqN7WthW0ksCdf25VIf0qQh5Xdgu+v4No K6a63hy/FyHWAdnSP728+WZSl9PLLnxBudW5UKQN2rXVpWi+RKzer5RriMP967T4n7TW d5iP0RQvDYw+LTQXhO3zqD4GGnWa3EQp3s1k9jHLeJy7W2L/eKLBr5jd7npyIu22hzj9 6LCgVBfTwzO8xhCkgH5XbWoPHlobZJRlW+NCoLtwnRvpfeHygkWOlBk2L8rOloxvhPX+ Nmf8ccezNE1HaU35CzPf+Mtg0esYBZR0tDVjc/shyWOFPPWmEO1MWfiPSSSI9guBdFT/ 7ahQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=nps25n40aVTW6YPAAI7Sr9fscYA9XD4aRvJr7h8iAE0=; b=EMuOgJuVJLzLQq1ec51D7L1D8933GQNiBD0vUDUyDNtzvFWf+sN735N829vftT5D4h BY1YDvejG9OMTtOYraWjuepBWV9xdD7JHu5GCWE+LRdXkh9/cVDkp7C10gx1EwVTk9jg 79GU1U2BI8kjXjr9ni8ibYYSJ5u2JdyxdB0pHbEthQcBFzrWLXDVaHXbE0qlrHekVqqR fhoNDzuWvzRXsEBl8VsDw/Ie1W7QZVNAQJv4QW+Ved0q22klVvcuq3yP0ZJ+6JbdbDiE tC/rY1T7FK35GRUouPAsbDOCDcfRBd8H/Uu2MGjWSNr+3MTQCBQitFSc1hO2AmftBtTC RYRw== X-Gm-Message-State: AD7BkJJbrR0bmLFD/z+oW1VLxfj1BNjD+wrNVc8P75RSluJCI3i74g900ZZNmOP1QlRQ2q7Fq0Koap+ndvBVMg== MIME-Version: 1.0 X-Received: by 10.13.242.198 with SMTP id b189mr11907467ywf.139.1457958182206; Mon, 14 Mar 2016 05:23:02 -0700 (PDT) Received: by 10.129.148.70 with HTTP; Mon, 14 Mar 2016 05:23:02 -0700 (PDT) In-Reply-To: <56E6A761.8070005@zend.com> References: <56E6A761.8070005@zend.com> Date: Mon, 14 Mar 2016 13:23:02 +0100 Message-ID: To: Dmitry Stogov Cc: Xinchen Hui , Bob Weinand , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=94eb2c0356ec8c4601052e0157cd Subject: Re: Remove useless opcode handlers From: nikita.ppv@gmail.com (Nikita Popov) --94eb2c0356ec8c4601052e0157cd Content-Type: text/plain; charset=UTF-8 On Mon, Mar 14, 2016 at 12:58 PM, Dmitry Stogov wrote: > > > On 03/14/2016 02:29 PM, Nikita Popov wrote: > > On Mon, Mar 14, 2016 at 11:56 AM, Dmitry Stogov wrote: > >> Please take a quick look and let me know if you see any problems. >> >> >> https://gist.github.com/dstogov/23cc318dd3e411904e10 >> >> >> I'm going to commit this tomorrow. >> >> >> Thanks. Dmitry. >> > ZEND_ADD is not commutative for array operands. > > > Unfortunately, you are right :( > > ZEND_MUL may not be commutative if operator overloading is involved (e.g. > matrix multiplication is not abelian). > > > Right again. > > The NO_CONST_CONST cases are problematic: Opcache currently, in my eyes > incorrectly, evaluates constant expressions even if they throw notices > (currently I think mostly by suppressing them). If we do not evaluate > these, we may end up with CONST_CONST operations. (This is not a huge > problem just now because constant folding in opcache is limited -- however > with full constant propagation this leads to many test failures.) > > > The patch adds NO_CONST_CONST handling to opcache. All tests are passed, I > also didn't see any problems running ~10 real-life apps. > > The opcodes affected by the last point (limited to those included in your > patch) are SUB, MUL, POW, CONCAT (array operands) and BW_NOT (various). > However with Andrea's invalid numeric string RFC more will fall in this > category (evaluable but throwing). > > > I didn't get what is wrong with SUB, MUL, etc, because they are evaluated > at compile-time > Anyway, I see - the patch can't be committed in current state. > Thanks for review. > What I mean is, for example: var_dump(~(bool)true); echo "Done\n"; Will throw an exception without opcache, will result in no output (and no *visible* error) with opcache. My point here is that const-operand-only cases might be necessary to handle error cases like this. Nikita --94eb2c0356ec8c4601052e0157cd--