Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85765 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16736 invoked from network); 10 Apr 2015 08:10:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Apr 2015 08:10:58 -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.216.54 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.216.54 mail-vn0-f54.google.com Received: from [209.85.216.54] ([209.85.216.54:41722] helo=mail-vn0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/62-28833-19587255 for ; Fri, 10 Apr 2015 04:10:58 -0400 Received: by vnbg190 with SMTP id g190so3708941vnb.8 for ; Fri, 10 Apr 2015 01:10:55 -0700 (PDT) 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=/DDtnUGlIyKdP8JfeuioIcQiT8HXn71hLPwQ28QY0n8=; b=K1LRpFU6Uc1AfjLmPElME65l+8K4AbIo0kXkr/Tb6d+QoxZoGs2Vg1fgpiM6CstiEH lkJORmUn7L9KG9wKpzGdd9REa5of3KEhw5AvKvXY7Se95WLgllN7b4uN8eF2EFgZslsQ F72fUEpN236MFsB2SF4ZO/JRSeZx53KgO2fe6fKzui1D5elQwD8cmeuqiK8dPA6KhzPd t6LNsN1cAwX1+B3Axo6HDrwvFpC9NcHLxms+N9oMqgVWKcP02yidL0dkoicFSej2oOc5 NiGc57CjlkzJ7lbvXch8opJWFn5ND7cPlysqbJ2Cnl2ygGfBP9EKflS4NMoETLetBK1M agFg== X-Gm-Message-State: ALoCoQmJGJcGhaVxhj+uYJ8FYz0ZhOgu//e5gnDDZ2DyQWFDf1ojY51ewldMLHbuxOdcJvLtl3XRZrwumetXtyDJp6Kc1LhNgmsPo53QUeoO85AzeoU6mOKw/64/5gdwj9SdP/4vkgmqGlDSeavfDfJSGZ9f+07QUg== MIME-Version: 1.0 X-Received: by 10.52.157.72 with SMTP id wk8mr370955vdb.12.1428653455560; Fri, 10 Apr 2015 01:10:55 -0700 (PDT) Received: by 10.52.248.36 with HTTP; Fri, 10 Apr 2015 01:10:55 -0700 (PDT) In-Reply-To: References: Date: Fri, 10 Apr 2015 11:10:55 +0300 Message-ID: To: Paul Dragoonis Cc: Xinchen Hui , Nikita Popov , PHP Internals Content-Type: multipart/alternative; boundary=089e016338eeb9e9f205135a4dea Subject: Re: [PHP-DEV] _call() and __callstatic() improvement From: dmitry@zend.com (Dmitry Stogov) --089e016338eeb9e9f205135a4dea Content-Type: text/plain; charset=UTF-8 On Fri, Apr 10, 2015 at 7:26 AM, Paul Dragoonis wrote: > Hi Dmitry, > > Although I recommend against the usage of __call/__callStatic from a > quality assurance perspective (part of my job), it's reassuring to know > that these methods have received more attention in terms of stability and > stack handling. > > After reviewing the code I'd still like to better understand the use of > the term trampoline and when it's appropriate to > use zend_get_call_trampoline_func() over the > existing zend_get_user_call_function() approach. > In our approach, "trampline" is a special opcode, that substitute existing "fake" stack frame with a frame to __call() function, similar to tail-call. Thanks. Dmitry. > > Many thanks, > Paul > > On Fri, Apr 10, 2015 at 12:20 AM, Dmitry Stogov wrote: > >> Hi, >> >> Please review the patch. >> It improves implementation of magic __call() and __callstatic() methods >> using bytecode function with trampoline instead of internal C function. >> >> https://github.com/php/php-src/pull/1234 >> >> The patch is more or less obvious. >> I'm going to commit it tomorrow evening. >> >> Xinchen, you may also try to add support for Closure::invoke() (as a >> separate patch). >> >> Thanks. Dmitry. >> > > --089e016338eeb9e9f205135a4dea--