Class JSVirtualMachine

  • All Implemented Interfaces:
    NSObject

    public class JSVirtualMachine
    extends NSObject
    [@interface] An instance of JSVirtualMachine represents a single JavaScript "object space" or set of execution resources. Thread safety is supported by locking the virtual machine, with concurrent JavaScript execution supported by allocating separate instances of JSVirtualMachine. A virtual machine may need to run deferred tasks on a run loop, such as garbage collection or resolving WebAssembly compilations. By default, a virtual machine will use the run loop of the thread it was initialized on. Currently, there is no API to change a JSVirtualMachine's run loop once it has been initialized.
    • Constructor Detail

      • JSVirtualMachine

        protected JSVirtualMachine​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • addManagedReferenceWithOwner

        public void addManagedReferenceWithOwner​(java.lang.Object object,
                                                 java.lang.Object owner)
        [@methodgroup] Memory Management Notify the JSVirtualMachine of an external object relationship. Allows clients of JSVirtualMachine to make the JavaScript runtime aware of arbitrary external Objective-C object graphs. The runtime can then use this information to retain any JavaScript values that are referenced from somewhere in said object graph. For correct behavior clients must make their external object graphs reachable from within the JavaScript runtime. If an Objective-C object is reachable from within the JavaScript runtime, all managed references transitively reachable from it as recorded using -addManagedReference:withOwner: will be scanned by the garbage collector.
        Parameters:
        object - The object that the owner points to.
        owner - The object that owns the pointed to object.
      • init

        public JSVirtualMachine init()
        [@methodgroup] Creating New Virtual Machines Create a new JSVirtualMachine.
        Overrides:
        init in class NSObject
      • removeManagedReferenceWithOwner

        public void removeManagedReferenceWithOwner​(java.lang.Object object,
                                                    java.lang.Object owner)
        Notify the JSVirtualMachine that a previous object relationship no longer exists. The JavaScript runtime will continue to scan any references that were reported to it by -addManagedReference:withOwner: until those references are removed.
        Parameters:
        object - The object that was formerly owned.
        owner - The former owner.