Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91091 invoked from network); 1 Aug 2008 14:54:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Aug 2008 14:54:37 -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 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:40496] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/1A-39007-BA323984 for ; Fri, 01 Aug 2008 10:54:37 -0400 Received: from ws.home ([10.1.1.1]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 1 Aug 2008 17:55:14 +0300 Message-ID: <489323A7.8040006@zend.com> Date: Fri, 01 Aug 2008 18:54:31 +0400 User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Stefan Esser CC: Marcus Boerger , PHP Internals List References: <4890CC7A.6060303@sektioneins.de> <416879664.20080801004706@marcus-boerger.de> <4892F46A.1060008@zend.com> <4892F813.6050402@sektioneins.de> <4892FB94.5030107@zend.com> <48930B84.80305@sektioneins.de> In-Reply-To: <48930B84.80305@sektioneins.de> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Aug 2008 14:55:15.0058 (UTC) FILETIME=[9B1EE520:01C8F3E6] Subject: Re: [PHP-DEV] Switch Table Extension for PHP From: dmitry@zend.com (Dmitry Stogov) The whole idea is great, but it'll work without problems only if switch-tables are constructed at compile (or optimization) time. The idea also won't work with variables and unresolved constants as "case" labels (I saw your extension already carries about this limitation). I think the proper way to implement the idea is introducing a new opcode ZEND_SWITCH which has switch table as IS_CONSTANT_ARRAY operand. Thanks. Dmitry. Stefan Esser wrote: > Hi Dmitry, > >> As you set the extended_value in shared memory to point into process >> memory the other process will read it and look into it's own memory, and >> of course it won't find proper switch-table there. > > In case the opcode cache directly uses op_array mapped in shared memory > the extension should result in a slow down because every . However it > SHOULD detect that the extended_value points to an invalid memory > address, because it checks if it points into the memory allocated. The > heap should be random enough to catch this most of the time. > > But yeah I know that there are some (potential) problems ;) That is why > it is experimental. The bigger question is however if the whole idea > fails with some switch() constructs. > > Stefan Esser