Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39545 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24850 invoked from network); 1 Aug 2008 16:44:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Aug 2008 16:44:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.94.239.7 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.7 mail.jdi-ict.nl Linux 2.6 Received: from [82.94.239.7] ([82.94.239.7:34929] helo=mail.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/A0-39007-36D33984 for ; Fri, 01 Aug 2008 12:44:20 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id m71GiG8N024967; Fri, 1 Aug 2008 18:44:16 +0200 Date: Fri, 1 Aug 2008 18:44:16 +0200 (CEST) X-X-Sender: derick@kossu.ez.no To: Dmitry Stogov cc: Stefan Esser , Marcus Boerger , PHP Internals List In-Reply-To: <489323A7.8040006@zend.com> Message-ID: 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> <489323A7.8040006@zend.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Subject: Re: [PHP-DEV] Switch Table Extension for PHP From: derick@php.net (Derick Rethans) On Fri, 1 Aug 2008, Dmitry Stogov wrote: > 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. Doesn't this make more sense to do in an optimizer? I thought the general idea was that we don't try to make the compiler do all the heavy optimizations.. as there are many more we could do here. regards, Derick -- HEAD before 5_3!: http://tinyurl.com/6d2esb http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org