Re: [VOTE] Scalar Type Hints
| From: | Dmitry Stogov | Date: | Sun, 15 Feb 2015 19:18:34 +0000 |
| Subject: | Re: [VOTE] Scalar Type Hints | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82738@lists.php.net to get a copy of this message | ||
Currently we perform checks in RECV opcode handlers.
Andrea's patch just adds a flag in zend_execute_data that tells what kind
of checks should be performed in the function.
With JIT it's difficult to generate any checks on call-site, because the
actual function may by unknown at compile-time (and even may be changed on
next request).
Thanks. Dmitry.
On Sun, Feb 15, 2015 at 9:50 PM, Nikita Popov <nikita.ppv@gmail.com> wrote:
> On Sun, Feb 15, 2015 at 7:43 PM, Dmitry Stogov <dmitry@zend.com> wrote:
>
>> Hi Anthony,
>>
>> If you are working on JIT, you should understand that declare() switch to
>> strict typing can't improve anything, because it works on caller side and
>> in each function you now will have to generate code for both weak and
>> strict checks.
>>
>
> Why do these checks have to be generated in the function, instead of
> performing checks/casts at the call-site? Naively I would assume this to
> perform better, because you can make use of type-information around the
> call-site to elide checks/casts. Or does this have adverse effects due to
> larger code size or something like that?
>
> Nikita
>