Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75063 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11670 invoked from network); 24 Jun 2014 19:10:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2014 19:10:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=ericsten@microsoft.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ericsten@microsoft.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain microsoft.com designates 207.46.163.208 as permitted sender) X-PHP-List-Original-Sender: ericsten@microsoft.com X-Host-Fingerprint: 207.46.163.208 mail-bl2lp0208.outbound.protection.outlook.com Received: from [207.46.163.208] ([207.46.163.208:51587] helo=na01-bl2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/CE-39652-D0DC9A35 for ; Tue, 24 Jun 2014 15:10:08 -0400 Received: from BLUPR03MB421.namprd03.prod.outlook.com (10.141.78.140) by BLUPR03MB421.namprd03.prod.outlook.com (10.141.78.140) with Microsoft SMTP Server (TLS) id 15.0.959.24; Tue, 24 Jun 2014 19:08:48 +0000 Received: from BLUPR03MB421.namprd03.prod.outlook.com ([10.141.78.140]) by BLUPR03MB421.namprd03.prod.outlook.com ([10.141.78.140]) with mapi id 15.00.0959.000; Tue, 24 Jun 2014 19:08:48 +0000 To: PHP Internals Thread-Topic: Q: How to handle zend_op_array.scope and zend_op_array.prototype in opcode cache? Thread-Index: Ac+P0wFH3ht7EoAbSu+EG3YCkgzx/Q== Date: Tue, 24 Jun 2014 19:08:48 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2001:4898:80e8:ed31::3] x-microsoft-antispam: BCL:0;PCL:0;RULEID: x-forefront-prvs: 02524402D6 x-forefront-antispam-report: SFV:NSPM;SFS:(6009001)(199002)(189002)(50986999)(74502001)(83072002)(85852003)(86612001)(54356999)(74662001)(76482001)(31966008)(21056001)(87936001)(4396001)(2656002)(95666004)(99286002)(33646001)(99396002)(83322001)(101416001)(76576001)(105586002)(77982001)(79102001)(20776003)(74316001)(81342001)(85306003)(46102001)(92566001)(86362001)(80022001)(81542001)(64706001)(3826002)(24736002);DIR:OUT;SFP:;SCL:1;SRVR:BLUPR03MB421;H:BLUPR03MB421.namprd03.prod.outlook.com;FPR:;MLV:sfv;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.onmicrosoft.com Subject: Q: How to handle zend_op_array.scope and zend_op_array.prototype in opcode cache? From: ericsten@microsoft.com (Eric Stenson) PHP Internals folks-- I'm working on the opcode cache part of Wincache, and I believe that Wincac= he isn't properly handling the scope and prototype fields of the zend_op_ar= ray struct when copying it into shared memory. =20 I tried looking at the Zend Opcache code to figure out what The Right Way(T= M) to handle these fields, and I'm curious about how these fields are used = by the Zend engine. From what I can tell, Zend Opcache has a per-process HashTable where it kee= ps track of which items is has copied into shared memory (xlat_table). It looks like the xlat_table is cleared out before each compilation. When = persisting, Zend persists things in the following order: 1. function_table 2. class_table 3. zend_op_array (for the main zend_op_array produced by compile) My questions: * Is there some guarantee that the scope and prototype on the main zend_op_= array exist in the function_table and class_table for the compilation? * Does the scope and prototype fields really matter for the main zend_op_ar= ray? Wincache has been setting them to NULL since day 1, and everything se= ems to work just fine... * The xlat_table key is a ulong. Zend Opcache uses the pointer of an objec= t as the key. On Windows, a ulong is 32 bits. How does this even work on = an x64 Windows box? Thx! --E.