@@ -236,39 +236,26 @@ static PHP_METHOD(V8Isolate, SetTimeLimit) {
236236 }
237237
238238 php_v8_isolate_limits_set_time_limit (php_v8_isolate, time_limit_in_seconds);
239-
240- zend_update_property_double (this_ce, getThis (), ZEND_STRL (" time_limit" ), time_limit_in_seconds);
241- zend_update_property_bool (this_ce, getThis (), ZEND_STRL (" time_limit_hit" ), 0 );
242239}
243240
244241static PHP_METHOD (V8Isolate, GetTimeLimit) {
245- zval rv;
246-
247- zval *prop = NULL ;
248242 if (zend_parse_parameters_none () == FAILURE) {
249243 return ;
250244 }
251245
252246 PHP_V8_ISOLATE_FETCH_WITH_CHECK (getThis (), php_v8_isolate);
253247
254- prop = zend_read_property (this_ce, getThis (), ZEND_STRL (" time_limit" ), 0 , &rv);
255-
256- RETVAL_ZVAL (prop, 1 , 0 );
248+ RETVAL_DOUBLE (php_v8_isolate->limits .time_limit );
257249}
258250
259251static PHP_METHOD (V8Isolate, IsTimeLimitHit) {
260- zval rv;
261-
262- zval *prop = NULL ;
263252 if (zend_parse_parameters_none () == FAILURE) {
264253 return ;
265254 }
266255
267256 PHP_V8_ISOLATE_FETCH_WITH_CHECK (getThis (), php_v8_isolate);
268257
269- prop = zend_read_property (this_ce, getThis (), ZEND_STRL (" time_limit_hit" ), 0 , &rv);
270-
271- RETVAL_ZVAL (prop, 1 , 0 );
258+ RETVAL_BOOL (php_v8_isolate->limits .time_limit_hit );
272259}
273260
274261static PHP_METHOD (V8Isolate, SetMemoryLimit) {
@@ -286,39 +273,26 @@ static PHP_METHOD(V8Isolate, SetMemoryLimit) {
286273 }
287274
288275 php_v8_isolate_limits_set_memory_limit (php_v8_isolate, static_cast <size_t >(memory_limit_in_bytes));
289-
290- zend_update_property_long (this_ce, getThis (), ZEND_STRL (" memory_limit" ), memory_limit_in_bytes);
291- zend_update_property_bool (this_ce, getThis (), ZEND_STRL (" memory_limit_hit" ), 0 );
292276}
293277
294278static PHP_METHOD (V8Isolate, GetMemoryLimit) {
295- zval rv;
296-
297- zval *prop = NULL ;
298279 if (zend_parse_parameters_none () == FAILURE) {
299280 return ;
300281 }
301282
302283 PHP_V8_ISOLATE_FETCH_WITH_CHECK (getThis (), php_v8_isolate);
303284
304- prop = zend_read_property (this_ce, getThis (), ZEND_STRL (" memory_limit" ), 0 , &rv);
305-
306- RETVAL_ZVAL (prop, 1 , 0 );
285+ RETURN_LONG (php_v8_isolate->limits .memory_limit );
307286}
308287
309288static PHP_METHOD (V8Isolate, IsMemoryLimitHit) {
310- zval rv;
311-
312- zval *prop = NULL ;
313289 if (zend_parse_parameters_none () == FAILURE) {
314290 return ;
315291 }
316292
317293 PHP_V8_ISOLATE_FETCH_WITH_CHECK (getThis (), php_v8_isolate);
318294
319- prop = zend_read_property (this_ce, getThis (), ZEND_STRL (" memory_limit_hit" ), 0 , &rv);
320-
321- RETVAL_ZVAL (prop, 1 , 0 );
295+ RETVAL_BOOL (php_v8_isolate->limits .memory_limit_hit );
322296}
323297
324298static PHP_METHOD (V8Isolate, GetHeapStatistics) {
@@ -604,12 +578,6 @@ PHP_MINIT_FUNCTION (php_v8_isolate) {
604578 this_ce = zend_register_internal_class (&ce);
605579 this_ce->create_object = php_v8_isolate_ctor;
606580
607- zend_declare_property_double (this_ce, ZEND_STRL (" time_limit" ), 0.0 , ZEND_ACC_PRIVATE);
608- zend_declare_property_bool (this_ce, ZEND_STRL (" time_limit_hit" ), 0 , ZEND_ACC_PRIVATE);
609-
610- zend_declare_property_long (this_ce, ZEND_STRL (" memory_limit" ), 0 , ZEND_ACC_PRIVATE);
611- zend_declare_property_bool (this_ce, ZEND_STRL (" memory_limit_hit" ), 0 , ZEND_ACC_PRIVATE);
612-
613581 memcpy (&php_v8_isolate_object_handlers, zend_get_std_object_handlers (), sizeof (zend_object_handlers));
614582
615583 php_v8_isolate_object_handlers.offset = XtOffsetOf (php_v8_isolate_t , std);
0 commit comments