Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit af359b4

Browse files
committed
Remove non-used private props from V8\Context
1 parent 41d01fb commit af359b4

25 files changed

+45
-607
lines changed

src/php_v8_context.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ static PHP_METHOD(V8Context, __construct)
9696
PHP_V8_STORE_POINTER_TO_ISOLATE(php_v8_context, php_v8_isolate);
9797
PHP_V8_ENTER_ISOLATE(php_v8_isolate);
9898

99-
if (php_v8_global_template_zv) {
100-
zend_update_property(this_ce, getThis(), ZEND_STRL("global_template"), php_v8_global_template_zv);
101-
}
102-
10399
if (php_v8_global_template_zv && Z_TYPE_P(php_v8_global_template_zv) != IS_NULL) {
104100
PHP_V8_FETCH_OBJECT_TEMPLATE_WITH_CHECK(php_v8_global_template_zv, php_v8_global_template);
105101
PHP_V8_DATA_ISOLATES_CHECK(php_v8_context, php_v8_global_template);
@@ -352,8 +348,6 @@ PHP_MINIT_FUNCTION(php_v8_context)
352348
this_ce->create_object = php_v8_context_ctor;
353349

354350
zend_declare_property_null(this_ce, ZEND_STRL("isolate"), ZEND_ACC_PRIVATE);
355-
zend_declare_property_null(this_ce, ZEND_STRL("global_template"), ZEND_ACC_PRIVATE);
356-
zend_declare_property_null(this_ce, ZEND_STRL("global_object"), ZEND_ACC_PRIVATE);
357351

358352
memcpy(&php_v8_context_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
359353

tests/V8ArrayObject.phpt

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ object(V8\ArrayObject)#6 (2) {
7979
bool(false)
8080
}
8181
["context":"V8\ObjectValue":private]=>
82-
object(V8\Context)#5 (3) {
82+
object(V8\Context)#5 (1) {
8383
["isolate":"V8\Context":private]=>
8484
object(V8\Isolate)#3 (5) {
8585
["snapshot":"V8\Isolate":private]=>
@@ -93,24 +93,6 @@ object(V8\ArrayObject)#6 (2) {
9393
["memory_limit_hit":"V8\Isolate":private]=>
9494
bool(false)
9595
}
96-
["global_template":"V8\Context":private]=>
97-
object(V8\ObjectTemplate)#4 (1) {
98-
["isolate":"V8\Template":private]=>
99-
object(V8\Isolate)#3 (5) {
100-
["snapshot":"V8\Isolate":private]=>
101-
NULL
102-
["time_limit":"V8\Isolate":private]=>
103-
float(0)
104-
["time_limit_hit":"V8\Isolate":private]=>
105-
bool(false)
106-
["memory_limit":"V8\Isolate":private]=>
107-
int(0)
108-
["memory_limit_hit":"V8\Isolate":private]=>
109-
bool(false)
110-
}
111-
}
112-
["global_object":"V8\Context":private]=>
113-
NULL
11496
}
11597
}
11698

@@ -261,7 +243,7 @@ V8\ArrayObject(V8\Value)->ToObject():
261243
bool(false)
262244
}
263245
["context":"V8\ObjectValue":private]=>
264-
object(V8\Context)#5 (3) {
246+
object(V8\Context)#5 (1) {
265247
["isolate":"V8\Context":private]=>
266248
object(V8\Isolate)#3 (5) {
267249
["snapshot":"V8\Isolate":private]=>
@@ -275,24 +257,6 @@ V8\ArrayObject(V8\Value)->ToObject():
275257
["memory_limit_hit":"V8\Isolate":private]=>
276258
bool(false)
277259
}
278-
["global_template":"V8\Context":private]=>
279-
object(V8\ObjectTemplate)#4 (1) {
280-
["isolate":"V8\Template":private]=>
281-
object(V8\Isolate)#3 (5) {
282-
["snapshot":"V8\Isolate":private]=>
283-
NULL
284-
["time_limit":"V8\Isolate":private]=>
285-
float(0)
286-
["time_limit_hit":"V8\Isolate":private]=>
287-
bool(false)
288-
["memory_limit":"V8\Isolate":private]=>
289-
int(0)
290-
["memory_limit_hit":"V8\Isolate":private]=>
291-
bool(false)
292-
}
293-
}
294-
["global_object":"V8\Context":private]=>
295-
NULL
296260
}
297261
}
298262
V8\ArrayObject(V8\Value)->ToInteger():

tests/V8BooleanObject.phpt

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ object(V8\BooleanObject)#8 (2) {
7272
bool(false)
7373
}
7474
["context":"V8\ObjectValue":private]=>
75-
object(V8\Context)#7 (3) {
75+
object(V8\Context)#7 (1) {
7676
["isolate":"V8\Context":private]=>
7777
object(V8\Isolate)#3 (5) {
7878
["snapshot":"V8\Isolate":private]=>
@@ -86,24 +86,6 @@ object(V8\BooleanObject)#8 (2) {
8686
["memory_limit_hit":"V8\Isolate":private]=>
8787
bool(false)
8888
}
89-
["global_template":"V8\Context":private]=>
90-
object(V8\ObjectTemplate)#4 (1) {
91-
["isolate":"V8\Template":private]=>
92-
object(V8\Isolate)#3 (5) {
93-
["snapshot":"V8\Isolate":private]=>
94-
NULL
95-
["time_limit":"V8\Isolate":private]=>
96-
float(0)
97-
["time_limit_hit":"V8\Isolate":private]=>
98-
bool(false)
99-
["memory_limit":"V8\Isolate":private]=>
100-
int(0)
101-
["memory_limit_hit":"V8\Isolate":private]=>
102-
bool(false)
103-
}
104-
}
105-
["global_object":"V8\Context":private]=>
106-
NULL
10789
}
10890
}
10991

tests/V8Context_reference_lifecycle.phpt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ $helper->dump($obj->GetContext());
4545
$obj = null;
4646
?>
4747
--EXPECT--
48-
object(Context)#4 (3) {
48+
object(Context)#4 (1) {
4949
["isolate":"V8\Context":private]=>
5050
object(V8\Isolate)#3 (5) {
5151
["snapshot":"V8\Isolate":private]=>
@@ -59,17 +59,13 @@ object(Context)#4 (3) {
5959
["memory_limit_hit":"V8\Isolate":private]=>
6060
bool(false)
6161
}
62-
["global_template":"V8\Context":private]=>
63-
NULL
64-
["global_object":"V8\Context":private]=>
65-
NULL
6662
}
6763

6864
Context dies now
6965

7066
Previous context should be dead, creating zval for object from old context
7167

72-
object(Context)#6 (3) {
68+
object(Context)#6 (1) {
7369
["isolate":"V8\Context":private]=>
7470
object(V8\Isolate)#3 (5) {
7571
["snapshot":"V8\Isolate":private]=>
@@ -83,9 +79,5 @@ object(Context)#6 (3) {
8379
["memory_limit_hit":"V8\Isolate":private]=>
8480
bool(false)
8581
}
86-
["global_template":"V8\Context":private]=>
87-
NULL
88-
["global_object":"V8\Context":private]=>
89-
NULL
9082
}
9183
Context dies now

tests/V8DateObject.phpt

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ object(V8\DateObject)#8 (2) {
130130
bool(false)
131131
}
132132
["context":"V8\ObjectValue":private]=>
133-
object(V8\Context)#7 (3) {
133+
object(V8\Context)#7 (1) {
134134
["isolate":"V8\Context":private]=>
135135
object(V8\Isolate)#3 (5) {
136136
["snapshot":"V8\Isolate":private]=>
@@ -144,24 +144,6 @@ object(V8\DateObject)#8 (2) {
144144
["memory_limit_hit":"V8\Isolate":private]=>
145145
bool(false)
146146
}
147-
["global_template":"V8\Context":private]=>
148-
object(V8\ObjectTemplate)#4 (1) {
149-
["isolate":"V8\Template":private]=>
150-
object(V8\Isolate)#3 (5) {
151-
["snapshot":"V8\Isolate":private]=>
152-
NULL
153-
["time_limit":"V8\Isolate":private]=>
154-
float(0)
155-
["time_limit_hit":"V8\Isolate":private]=>
156-
bool(false)
157-
["memory_limit":"V8\Isolate":private]=>
158-
int(0)
159-
["memory_limit_hit":"V8\Isolate":private]=>
160-
bool(false)
161-
}
162-
}
163-
["global_object":"V8\Context":private]=>
164-
NULL
165147
}
166148
}
167149

tests/V8Exception_GetStackTrace.phpt

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ V8\StackTrace->AsArray():
148148
bool(false)
149149
}
150150
["context":"V8\ObjectValue":private]=>
151-
object(V8\Context)#8 (3) {
151+
object(V8\Context)#8 (1) {
152152
["isolate":"V8\Context":private]=>
153153
object(V8\Isolate)#3 (5) {
154154
["snapshot":"V8\Isolate":private]=>
@@ -162,24 +162,6 @@ V8\StackTrace->AsArray():
162162
["memory_limit_hit":"V8\Isolate":private]=>
163163
bool(false)
164164
}
165-
["global_template":"V8\Context":private]=>
166-
object(V8\ObjectTemplate)#7 (1) {
167-
["isolate":"V8\Template":private]=>
168-
object(V8\Isolate)#3 (5) {
169-
["snapshot":"V8\Isolate":private]=>
170-
NULL
171-
["time_limit":"V8\Isolate":private]=>
172-
float(0)
173-
["time_limit_hit":"V8\Isolate":private]=>
174-
bool(false)
175-
["memory_limit":"V8\Isolate":private]=>
176-
int(0)
177-
["memory_limit_hit":"V8\Isolate":private]=>
178-
bool(false)
179-
}
180-
}
181-
["global_object":"V8\Context":private]=>
182-
NULL
183165
}
184166
}
185167

tests/V8ExceptionsTryCatchException.phpt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ object(V8\Exceptions\TryCatchException)#5 (10) {
6060
bool(false)
6161
}
6262
["context":"V8\Exceptions\TryCatchException":private]=>
63-
object(V8\Context)#3 (3) {
63+
object(V8\Context)#3 (1) {
6464
["isolate":"V8\Context":private]=>
6565
object(V8\Isolate)#2 (5) {
6666
["snapshot":"V8\Isolate":private]=>
@@ -74,10 +74,6 @@ object(V8\Exceptions\TryCatchException)#5 (10) {
7474
["memory_limit_hit":"V8\Isolate":private]=>
7575
bool(false)
7676
}
77-
["global_template":"V8\Context":private]=>
78-
NULL
79-
["global_object":"V8\Context":private]=>
80-
NULL
8177
}
8278
["try_catch":"V8\Exceptions\TryCatchException":private]=>
8379
object(V8\TryCatch)#4 (7) {
@@ -95,7 +91,7 @@ object(V8\Exceptions\TryCatchException)#5 (10) {
9591
bool(false)
9692
}
9793
["context":"V8\TryCatch":private]=>
98-
object(V8\Context)#3 (3) {
94+
object(V8\Context)#3 (1) {
9995
["isolate":"V8\Context":private]=>
10096
object(V8\Isolate)#2 (5) {
10197
["snapshot":"V8\Isolate":private]=>
@@ -109,10 +105,6 @@ object(V8\Exceptions\TryCatchException)#5 (10) {
109105
["memory_limit_hit":"V8\Isolate":private]=>
110106
bool(false)
111107
}
112-
["global_template":"V8\Context":private]=>
113-
NULL
114-
["global_object":"V8\Context":private]=>
115-
NULL
116108
}
117109
["exception":"V8\TryCatch":private]=>
118110
NULL

0 commit comments

Comments
 (0)