Skip to content

Commit 1a99a96

Browse files
Apply Nicolas's static cache improvements
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
1 parent c29db11 commit 1a99a96

28 files changed

Lines changed: 2187 additions & 3074 deletions

ext/opcache/opcache_arginfo.h

Lines changed: 1 addition & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/opcache/tests/fpm/static_cache_fpm_volatile_cache_direct_cache_safe_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
FPM: OPcache direct cache subclasses survive requests, safe serializer overrides stay direct, and wakeup hooks fallback
2+
FPM: OPcache direct cache subclasses survive requests, safe serializer overrides stay direct, and custom hook state is preserved
33
--EXTENSIONS--
44
opcache
55
spl
@@ -174,7 +174,7 @@ $tester->request(query: 'action=seed')->expectBody(
174174
$tester->request(query: 'action=fetch')->expectBody(
175175
"2026-06-15 09:30:00.123456 Europe/Paris,launch:7\n" .
176176
"metric,LabelIterator,10,20\n" .
177-
"2026-06-15 10:45:00.654321 UTC,fallback,0\n" .
177+
"2026-06-15 10:45:00.654321 UTC,fallback,1\n" .
178178
"2026-06-15 12:15:00.987654 UTC,fallback,1"
179179
);
180180

ext/opcache/tests/fpm/static_cache_fpm_volatile_static_tracking_shared_reference_cell_001.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,15 @@ method#1=method-B,seed-updated,1,child-updated,1,2,same,same,same,same
307307
blob@cross=same,same
308308
blob#0=blob-A,seed-updated,1,child-updated,1,2,same,same,same,same
309309
blob#1=blob-B,seed-updated,1,child-updated,1,2,same,same,same,same
310-
blob@cross=copy,copy
310+
blob@cross=same,same
311311
blob#0=blob-A,seed-updated,1,child-updated,1,2,same,same,same,same
312312
blob#1=blob-B,seed-updated,1,child-updated,1,2,same,same,same,same
313-
blob@cross=copy,copy
313+
blob@cross=same,same
314314
blob#0=blob-A,mutated-again,2,child-mutated-again,2,3,same,same,same,same
315-
blob#1=blob-B,seed-updated,1,child-updated,1,2,same,same,same,same
316-
blob@cross=copy,copy
315+
blob#1=blob-B,mutated-again,2,child-mutated-again,2,2,same,same,same,same
316+
blob@cross=same,same
317317
blob#0=blob-A,mutated-again,2,child-mutated-again,2,3,same,same,same,same
318-
blob#1=blob-B,seed-updated,1,child-updated,1,2,same,same,same,same
318+
blob#1=blob-B,mutated-again,2,child-mutated-again,2,2,same,same,same,same
319319
--CLEAN--
320320
<?php
321321
require_once __DIR__ . '/tester.inc';

ext/opcache/tests/static_cache_attribute_store_type_introspection_001.phpt

Lines changed: 0 additions & 84 deletions
This file was deleted.

ext/opcache/tests/static_cache_explicit_cache_request_local_safe_direct_slot_001.phpt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,29 @@ run_safe_direct_slot_scenario('stable');
111111
?>
112112
--EXPECT--
113113
bool(true)
114-
volatile-date-same-object=no
115-
volatile-date-shared-peer=no
114+
volatile-date-same-object=yes
115+
volatile-date-shared-peer=yes
116116
volatile-date-clone-calls=0
117117
volatile-date-second=2026-01-01:volatile-stored
118118
volatile-date-second-is-first=no
119119
volatile-date-clone-calls=0
120120
bool(true)
121-
volatile-collection-same-object=no
122-
volatile-collection-shared-peer=no
121+
volatile-collection-same-object=yes
122+
volatile-collection-shared-peer=yes
123123
volatile-collection-clone-calls=0
124124
volatile-collection-second=volatile-collection-stored:1
125125
volatile-collection-second-is-first=no
126126
volatile-collection-clone-calls=0
127127
stable-stored
128-
stable-date-same-object=no
129-
stable-date-shared-peer=no
128+
stable-date-same-object=yes
129+
stable-date-shared-peer=yes
130130
stable-date-clone-calls=0
131131
stable-date-second=2026-01-01:stable-stored
132132
stable-date-second-is-first=no
133133
stable-date-clone-calls=0
134134
stable-stored
135-
stable-collection-same-object=no
136-
stable-collection-shared-peer=no
135+
stable-collection-same-object=yes
136+
stable-collection-shared-peer=yes
137137
stable-collection-clone-calls=0
138138
stable-collection-second=stable-collection-stored:1
139139
stable-collection-second-is-first=no

ext/opcache/tests/static_cache_explicit_cache_signatures_001.phpt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ foreach ([
6262
'OPcache\\StaticCacheInterface::clear' => [],
6363
'OPcache\\StaticCacheInterface::lock' => ['lease'],
6464
'OPcache\\StaticCacheInterface::unlock' => [],
65-
'OPcache\\StaticCacheInterface::getCacheStoreType' => [],
6665
'OPcache\\StaticCacheInterface::info' => [],
67-
'OPcache\\StaticCacheInterface::getCacheStoreTypeByProperty' => [],
68-
'OPcache\\StaticCacheInterface::getCacheStoreTypeByMethod' => [],
6966
'OPcache\\VolatileCache::getInstance' => ['pool_name'],
7067
'OPcache\\VolatileCache::fetch' => ['default'],
7168
'OPcache\\VolatileCache::fetchMultiple' => ['default'],
@@ -77,10 +74,7 @@ foreach ([
7774
'OPcache\\VolatileCache::clear' => [],
7875
'OPcache\\VolatileCache::lock' => ['lease'],
7976
'OPcache\\VolatileCache::unlock' => [],
80-
'OPcache\\VolatileCache::getCacheStoreType' => [],
8177
'OPcache\\VolatileCache::info' => [],
82-
'OPcache\\VolatileCache::getCacheStoreTypeByProperty' => [],
83-
'OPcache\\VolatileCache::getCacheStoreTypeByMethod' => [],
8478
'OPcache\\StableCache::getInstance' => ['pool_name'],
8579
'OPcache\\StableCache::fetch' => ['default'],
8680
'OPcache\\StableCache::fetchMultiple' => ['default'],
@@ -96,10 +90,7 @@ foreach ([
9690
'OPcache\\StableCache::unlock' => [],
9791
'OPcache\\StableCache::increment' => ['step'],
9892
'OPcache\\StableCache::decrement' => ['step'],
99-
'OPcache\\StableCache::getCacheStoreType' => [],
10093
'OPcache\\StableCache::info' => [],
101-
'OPcache\\StableCache::getCacheStoreTypeByProperty' => [],
102-
'OPcache\\StableCache::getCacheStoreTypeByMethod' => [],
10394
] as $method => $parameters) {
10495
$reflection = ReflectionMethod::createFromMethodName($method);
10596
$parts = [$method];
@@ -133,10 +124,7 @@ OPcache\StaticCacheInterface::deleteMultiple static=0 params=1/1 return=bool
133124
OPcache\StaticCacheInterface::clear static=0 params=0/0 return=bool
134125
OPcache\StaticCacheInterface::lock $lease=int static=0 params=1/2 return=bool
135126
OPcache\StaticCacheInterface::unlock static=0 params=1/1 return=bool
136-
OPcache\StaticCacheInterface::getCacheStoreType static=0 params=1/1 return=OPcache\CacheStoreType
137127
OPcache\StaticCacheInterface::info static=1 params=0/0 return=OPcache\StaticCacheInfo
138-
OPcache\StaticCacheInterface::getCacheStoreTypeByProperty static=1 params=2/2 return=OPcache\CacheStoreType
139-
OPcache\StaticCacheInterface::getCacheStoreTypeByMethod static=1 params=3/3 return=OPcache\CacheStoreType
140128
OPcache\VolatileCache::getInstance $pool_name=string static=1 params=1/1 return=static
141129
OPcache\VolatileCache::fetch $default=null|bool|int|float|string|array|object static=0 params=1/2 return=null|bool|int|float|string|array|object
142130
OPcache\VolatileCache::fetchMultiple $default=?array static=0 params=1/2 return=array|false
@@ -148,10 +136,7 @@ OPcache\VolatileCache::deleteMultiple static=0 params=1/1 return=bool
148136
OPcache\VolatileCache::clear static=0 params=0/0 return=bool
149137
OPcache\VolatileCache::lock $lease=int static=0 params=1/2 return=bool
150138
OPcache\VolatileCache::unlock static=0 params=1/1 return=bool
151-
OPcache\VolatileCache::getCacheStoreType static=0 params=1/1 return=OPcache\CacheStoreType
152139
OPcache\VolatileCache::info static=1 params=0/0 return=OPcache\StaticCacheInfo
153-
OPcache\VolatileCache::getCacheStoreTypeByProperty static=1 params=2/2 return=OPcache\CacheStoreType
154-
OPcache\VolatileCache::getCacheStoreTypeByMethod static=1 params=3/3 return=OPcache\CacheStoreType
155140
OPcache\StableCache::getInstance $pool_name=string static=1 params=1/1 return=static
156141
OPcache\StableCache::fetch $default=null|bool|int|float|string|array|object static=0 params=1/2 return=null|bool|int|float|string|array|object
157142
OPcache\StableCache::fetchMultiple $default=?array static=0 params=1/2 return=array|false
@@ -167,7 +152,4 @@ OPcache\StableCache::lock $lease=int static=0 params=1/2 return=bool
167152
OPcache\StableCache::unlock static=0 params=1/1 return=bool
168153
OPcache\StableCache::increment $step=int static=0 params=1/2 return=int|false
169154
OPcache\StableCache::decrement $step=int static=0 params=1/2 return=int|false
170-
OPcache\StableCache::getCacheStoreType static=0 params=1/1 return=OPcache\CacheStoreType
171155
OPcache\StableCache::info static=1 params=0/0 return=OPcache\StaticCacheInfo
172-
OPcache\StableCache::getCacheStoreTypeByProperty static=1 params=2/2 return=OPcache\CacheStoreType
173-
OPcache\StableCache::getCacheStoreTypeByMethod static=1 params=3/3 return=OPcache\CacheStoreType

0 commit comments

Comments
 (0)