Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89153 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74962 invoked from network); 10 Nov 2015 19:28:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2015 19:28:34 -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.213.181 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.181 mail-ig0-f181.google.com Received: from [209.85.213.181] ([209.85.213.181:35996] helo=mail-ig0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/76-21426-06542465 for ; Tue, 10 Nov 2015 14:28:34 -0500 Received: by igcph11 with SMTP id ph11so57371477igc.1 for ; Tue, 10 Nov 2015 11:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zend_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5+HxzqR6MO+m/4MlWH0Vb+9c6cCC/dw4NFDitXnCo74=; b=D0qiuHCt/TKmQEnqAETQjNmkQRvWwaxoYW2ien4eOFmGK28iFrYXtcMen30zmyD3fv jKldhoJ2aVxfDmjTs/U+OoJPMt1Prk+Im6X4TWmD+xm2D67u3QEE2OazaJnxS5VboeEX w/M9BkY99KuIxbuWidvUh3miYRk5EH1+jI3De9QKb2fJvpwFKfWpH0K+dZ8ZJyW8+Geo QeYbpMgdAR6sct+qddUzwibWMLCXeM9nLIJhmWUciD8qjz5rsVaCTDNtDsgXU2B+WyoU o/Q1iNfHTOoVzpwjZf+UaRIkm2TXFW4T1KNPQqWcghHuTpEXvjgpY5zIOcSE5eMAvDOZ YCfA== 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=5+HxzqR6MO+m/4MlWH0Vb+9c6cCC/dw4NFDitXnCo74=; b=X7YDFUFcxC/r2LEnHJKyCa0s9HDQQ7eVkwuComyFRrHzFrpMUfkHUUks+IDIiU+XvN e/rSi47F5JTHZrWE84H0AOVtJfgFD1/Jwk4fqFi/pZXSelk1vifqIT0c5ZnAZZ0lgIAt LcTABRg2ccuv3ooVtqm5EjL5QTPeBDsyXEVMd7XVUhy0ccgCl8mcJAS2yJL4C5VliHC4 JZ/VZ87/okUxLnwaKVMXmSthoQeCz/1Ah8qPs6PBZof1k3CO3okiN3GoMHg0MQmK/jY1 iyM6tPExcAXlezz0UjuFEpOPwgJiuCjvaTAtJCCh/rFN0CoKuKZbGiX/bD2ZoO0drOEc d7oA== X-Gm-Message-State: ALoCoQkNiEfizOkeb+EMAeNf3ovV16KB5iY7WAaQEXr6HqiRAB2QkGKJdHqqWThVQMlKL5YptBuTt6EAtPhuT50QSBulC26wPKwVrZKVA8/2uVNfHYLlqe4MXP/QnE5DRSEvTbiaN2IO4L3G4l2BVMQz/lThVyEasNAQSitAZX9UTSAQakYodEY= MIME-Version: 1.0 X-Received: by 10.50.65.101 with SMTP id w5mr28784624igs.3.1447183710163; Tue, 10 Nov 2015 11:28:30 -0800 (PST) Received: by 10.50.73.166 with HTTP; Tue, 10 Nov 2015 11:28:30 -0800 (PST) In-Reply-To: References: Date: Tue, 10 Nov 2015 22:28:30 +0300 Message-ID: To: Nikita Popov Cc: Xinchen Hui , Bob Weinand , PHP Internals Content-Type: multipart/alternative; boundary=047d7b3a9c76f83517052434b6c3 Subject: Re: Safe Temporary Cleanup on Exception (Variable Liveness) From: dmitry@zend.com (Dmitry Stogov) --047d7b3a9c76f83517052434b6c3 Content-Type: text/plain; charset=UTF-8 I've committed unrelated and obvious parts (without semantic changes). The updated and extended patch now is much more clean https://gist.github.com/dstogov/43eaa3f3b68583877322 Anyway, it's still incomplete. Thanks. Dmitry. On Tue, Nov 10, 2015 at 2:29 PM, Dmitry Stogov wrote: > > > On Tue, Nov 10, 2015 at 1:42 PM, Nikita Popov > wrote: > >> On Tue, Nov 10, 2015 at 10:53 AM, Dmitry Stogov wrote: >> >>> Hi, >>> >>> Please take a look into >>> https://gist.github.com/dstogov/43eaa3f3b68583877322 >>> >>> This is variation on Bob's idea about variable liveness. >>> The patch is incomplete. Liveness construction is still naive. However, >>> all tests are passed. >>> >>> Ranges are represented by start/end/variable cartages. (I suppose this >>> representation is more compact, than in the original proposal). >>> In general, it's possible to use few ranges for the same variable, if >>> its whole live range is not linear. (this is not implemented yet). >>> >>> Related ideas and tests are welcome. >>> >>> Thanks. Dmitry. >>> >> >> One leak this does not cover yet is a discarded delayed return value: >> >> function test() { >> try { >> $a = [1, 2, 3]; >> return $a + []; >> } finally { >> throw new Exception; >> } >> } >> >> try { >> test(); >> } catch (Exception $e) {} >> >> This case is a bit tricky because it violates the usual invariant that >> all temporaries have well-defined liveness ranges (either alive or not, no >> maybe). We'd have to change that first. >> > > I see the problem. We can't statically define live-ranges for finally > code, because we don't know where it's going to be called from. > May be we may reconstruct this at run-time. > > Thanks. Dmitry, > > > >> >> Nikita >> >> > --047d7b3a9c76f83517052434b6c3--