@@ -489,7 +489,6 @@ static PHP_METHOD(V8Isolate, SetCaptureStackTraceForUncaughtExceptions) {
489489 static_cast <v8::StackTrace::StackTraceOptions>(options & PHP_V8_STACK_TRACE_OPTIONS));
490490}
491491
492-
493492static PHP_METHOD (V8Isolate, IsDead) {
494493 if (zend_parse_parameters_none () == FAILURE) {
495494 return ;
@@ -501,6 +500,17 @@ static PHP_METHOD(V8Isolate, IsDead) {
501500 RETURN_BOOL (isolate->IsDead ());
502501}
503502
503+ static PHP_METHOD (V8Isolate, IsInUse) {
504+ if (zend_parse_parameters_none () == FAILURE) {
505+ return ;
506+ }
507+
508+ PHP_V8_ISOLATE_FETCH_WITH_CHECK (getThis (), php_v8_isolate);
509+ PHP_V8_DECLARE_ISOLATE (php_v8_isolate);
510+
511+ RETURN_BOOL (isolate->IsInUse ());
512+ }
513+
504514
505515ZEND_BEGIN_ARG_INFO_EX (arginfo_v8_isolate___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0 )
506516 ZEND_ARG_OBJ_INFO(0 , snapshot, V8\\StartupData, 1 )
@@ -574,6 +584,10 @@ ZEND_END_ARG_INFO()
574584ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_IsDead, ZEND_RETURN_VALUE, 0 , _IS_BOOL, NULL , 0 )
575585ZEND_END_ARG_INFO()
576586
587+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_IsInUse, ZEND_RETURN_VALUE, 0 , _IS_BOOL, NULL , 0 )
588+ ZEND_END_ARG_INFO()
589+
590+
577591static const zend_function_entry php_v8_isolate_methods[] = {
578592 PHP_ME (V8Isolate, __construct, arginfo_v8_isolate___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
579593
@@ -603,6 +617,7 @@ static const zend_function_entry php_v8_isolate_methods[] = {
603617
604618 PHP_ME (V8Isolate, SetCaptureStackTraceForUncaughtExceptions, arginfo_v8_isolate_SetCaptureStackTraceForUncaughtExceptions, ZEND_ACC_PUBLIC)
605619 PHP_ME (V8Isolate, IsDead, arginfo_v8_isolate_IsDead, ZEND_ACC_PUBLIC)
620+ PHP_ME (V8Isolate, IsInUse, arginfo_v8_isolate_IsInUse, ZEND_ACC_PUBLIC)
606621
607622 PHP_FE_END
608623};
0 commit comments