Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82976 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73808 invoked from network); 17 Feb 2015 15:51:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 15:51:53 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.173 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.173 mail-vc0-f173.google.com Received: from [209.85.220.173] ([209.85.220.173:44399] helo=mail-vc0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/71-19463-79363E45 for ; Tue, 17 Feb 2015 10:51:52 -0500 Received: by mail-vc0-f173.google.com with SMTP id hy4so12875652vcb.4 for ; Tue, 17 Feb 2015 07:51:49 -0800 (PST) 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:content-type; bh=vsE6YVew9xSyzB1Cr5Vw55cKu+r4/K3H6nD8kppAJMA=; b=Qx4pUuQIkpCn0U0uetT4IH/KUE+QoQy2GSy/ffiPefrahqfGjZAwMgNrCB1o25lZdJ +mIUEwR6E4yR7+hlzNosdj2Jj0AxB7aR3Kc066L65djm9HMv52EjWhSAgZ8v693EvLJo BmrT32qWACXX3Pti+/wzQqP4osfNMMSydxNnoCnDHdWmHPxfnoIao3ysX4eGY+4Y1ctN kMY/wGPuAnD1dHVf3ZzYLDa/bp67pxs+IN0cXTETA3PIY+Nai7GEmESQrbmpeRo30ekD DhPOz04XE0IMyZlulZWPODqFnP/j/Cyb634towH8g8e5rUL5n5RF5oLK1Mosqv6SGH6x P1ew== X-Gm-Message-State: ALoCoQkFRDBuWPbkcdvyOR6ZDUCOmGCkhcPdBT0UpgfHJCD4ZSr4lo837+fU7ZMli1ZNH/3tlHaQ5CGig0lwAGVvbnQxDPL0QGGpwnf1QXw0jVd2z8t21CpE1fyi8UExb1BpxbpBhj9Mi++PkoFrwyzPwut9fX25sQ== MIME-Version: 1.0 X-Received: by 10.52.162.72 with SMTP id xy8mr16255569vdb.12.1424188309331; Tue, 17 Feb 2015 07:51:49 -0800 (PST) Received: by 10.52.74.73 with HTTP; Tue, 17 Feb 2015 07:51:49 -0800 (PST) In-Reply-To: References: <54E1C24B.6010806@googlemail.com> Date: Tue, 17 Feb 2015 19:51:49 +0400 Message-ID: To: Nikita Popov Cc: Joe Watkins , Crypto Compress , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=089e01628326457985050f4aae7c Subject: Re: [PHP-DEV] RFC: Expectations From: dmitry@zend.com (Dmitry Stogov) --089e01628326457985050f4aae7c Content-Type: text/plain; charset=UTF-8 On Tue, Feb 17, 2015 at 5:11 PM, Nikita Popov wrote: > On Mon, Feb 16, 2015 at 4:47 PM, Dmitry Stogov wrote: > >> Hi Nikita, >> >> it looks like a part of old implementation is not trivial with new AST >> compiler. >> >> previously we translated assert(condition) into assert(condition, >> "assert(condition)"). >> actually we just captured a part of input buffer and added missing string >> argument. >> >> Is there a simple way to do the same now? >> > > Not very simple, but we could store pointers/offsets to the start and end > of the fcall in the ast node, similar to what is done with lex_pos for > declarations: http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_ast.h#177 > > It would be nice if we could have precise offset information for all nodes > (this is particularly valuable if the ast is exposed to userland), but that > would increase memory usage during compilation, not sure if it's worthwhile. > > >> It's possible to convert AST into string using recursive pretty-printer. >> It's not a simple task itself, but it may be reused for other things. >> > I went by this way... :) It must be ready soo. > >> Joe, the rest (including zero-cost assert) is implemented at >> https://github.com/php/php-src/pull/1088/files >> 9 related tests are failed for now. >> > > As this is implemented right now, it would require writing \assert() in > order to be zero-cost. Maybe we should disallow redefinition of assert as a > namespaced function, so we can always optimize this? > good catch. Thanks. > > Nikita > --089e01628326457985050f4aae7c--