Search in sources :

Example 1 with AtomicsObject

use of com.github.anba.es6draft.runtime.objects.atomics.AtomicsObject in project es6draft by anba.

the class Realm method initializeAtomicsModule.

/**
 * <h1>Extension: Shared Memory and Atomics</h1>
 *
 * @param realm
 *            the realm instance
 */
private static void initializeAtomicsModule(Realm realm) {
    EnumMap<Intrinsics, OrdinaryObject> intrinsics = realm.intrinsics;
    // allocation phase
    AtomicsObject atomicsObject = new AtomicsObject(realm);
    SharedArrayBufferConstructor sharedArrayBufferConstructor = new SharedArrayBufferConstructor(realm);
    SharedArrayBufferPrototype sharedArrayBufferPrototype = new SharedArrayBufferPrototype(realm);
    // registration phase
    intrinsics.put(Intrinsics.Atomics, atomicsObject);
    intrinsics.put(Intrinsics.SharedArrayBuffer, sharedArrayBufferConstructor);
    intrinsics.put(Intrinsics.SharedArrayBufferPrototype, sharedArrayBufferPrototype);
    // initialization phase
    atomicsObject.initialize(realm);
    sharedArrayBufferConstructor.initialize(realm);
    sharedArrayBufferPrototype.initialize(realm);
}
Also used : SharedArrayBufferPrototype(com.github.anba.es6draft.runtime.objects.atomics.SharedArrayBufferPrototype) Intrinsics(com.github.anba.es6draft.runtime.types.Intrinsics) OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) SharedArrayBufferConstructor(com.github.anba.es6draft.runtime.objects.atomics.SharedArrayBufferConstructor) AtomicsObject(com.github.anba.es6draft.runtime.objects.atomics.AtomicsObject)

Aggregations

AtomicsObject (com.github.anba.es6draft.runtime.objects.atomics.AtomicsObject)1 SharedArrayBufferConstructor (com.github.anba.es6draft.runtime.objects.atomics.SharedArrayBufferConstructor)1 SharedArrayBufferPrototype (com.github.anba.es6draft.runtime.objects.atomics.SharedArrayBufferPrototype)1 Intrinsics (com.github.anba.es6draft.runtime.types.Intrinsics)1 OrdinaryObject (com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)1