All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.truffle.js.nodes.array.JSArrayDeleteRangeNodeGen Maven / Gradle / Ivy

// CheckStyle: start generated
package com.oracle.truffle.js.nodes.array;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.DSLSupport;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.DSLSupport.SpecializationDataNode;
import com.oracle.truffle.api.dsl.InlineSupport.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.js.nodes.control.DeletePropertyNode;
import com.oracle.truffle.js.runtime.JSContext;
import com.oracle.truffle.js.runtime.array.ScriptArray;
import com.oracle.truffle.js.runtime.objects.JSDynamicObject;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;

/**
 * Debug Info: 
 *   Specialization {@link JSArrayDeleteRangeNode#denseArray}
 *     Activation probability: 0.48333
 *     With/without class size: 13/4 bytes
 *   Specialization {@link JSArrayDeleteRangeNode#sparseArray}
 *     Activation probability: 0.33333
 *     With/without class size: 10/4 bytes
 *   Specialization {@link JSArrayDeleteRangeNode#doUncached}
 *     Activation probability: 0.18333
 *     With/without class size: 6/0 bytes
 * 
*/ @GeneratedBy(JSArrayDeleteRangeNode.class) @SuppressWarnings("javadoc") public final class JSArrayDeleteRangeNodeGen extends JSArrayDeleteRangeNode { static final ReferenceField DENSE_ARRAY_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "denseArray_cache", DenseArrayData.class); static final ReferenceField SPARSE_ARRAY_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "sparseArray_cache", SparseArrayData.class); /** * State Info:
     *   0: SpecializationActive {@link JSArrayDeleteRangeNode#denseArray}
     *   1: SpecializationActive {@link JSArrayDeleteRangeNode#doUncached}
     *   2: SpecializationActive {@link JSArrayDeleteRangeNode#sparseArray}
     * 
*/ @CompilationFinal private int state_0_; /** * Source Info:
     *   Specialization: {@link JSArrayDeleteRangeNode#denseArray}
     *   Parameter: {@link DeletePropertyNode} deletePropertyNode
*/ @Child private DeletePropertyNode deletePropertyNode; /** * Source Info:
     *   Specialization: {@link JSArrayDeleteRangeNode#sparseArray}
     *   Parameter: {@link JSArrayNextElementIndexNode} nextElementIndexNode
*/ @Child private JSArrayNextElementIndexNode nextElementIndexNode; @UnsafeAccessedField @CompilationFinal private DenseArrayData denseArray_cache; @UnsafeAccessedField @CompilationFinal private SparseArrayData sparseArray_cache; private JSArrayDeleteRangeNodeGen(JSContext context, boolean orThrow) { super(context, orThrow); } @ExplodeLoop @Override public void execute(JSDynamicObject arg0Value, ScriptArray arg1Value, long arg2Value, long arg3Value) { int state_0 = this.state_0_; if (state_0 != 0 /* is SpecializationActive[JSArrayDeleteRangeNode.denseArray(JSDynamicObject, ScriptArray, long, long, ScriptArray, DeletePropertyNode)] || SpecializationActive[JSArrayDeleteRangeNode.sparseArray(JSDynamicObject, ScriptArray, long, long, ScriptArray, DeletePropertyNode, JSArrayNextElementIndexNode)] || SpecializationActive[JSArrayDeleteRangeNode.doUncached(JSDynamicObject, ScriptArray, long, long, DeletePropertyNode, JSArrayNextElementIndexNode)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSArrayDeleteRangeNode.denseArray(JSDynamicObject, ScriptArray, long, long, ScriptArray, DeletePropertyNode)] */) { DenseArrayData s0_ = this.denseArray_cache; while (s0_ != null) { { DeletePropertyNode deletePropertyNode_ = this.deletePropertyNode; if (deletePropertyNode_ != null) { if ((s0_.cachedArrayType_.isInstance(arg1Value))) { assert DSLSupport.assertIdempotence((!(s0_.cachedArrayType_.isHolesType()))); denseArray(arg0Value, arg1Value, arg2Value, arg3Value, s0_.cachedArrayType_, deletePropertyNode_); return; } } } s0_ = s0_.next_; } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[JSArrayDeleteRangeNode.sparseArray(JSDynamicObject, ScriptArray, long, long, ScriptArray, DeletePropertyNode, JSArrayNextElementIndexNode)] */) { SparseArrayData s1_ = this.sparseArray_cache; while (s1_ != null) { { DeletePropertyNode deletePropertyNode_1 = this.deletePropertyNode; if (deletePropertyNode_1 != null) { JSArrayNextElementIndexNode nextElementIndexNode_ = this.nextElementIndexNode; if (nextElementIndexNode_ != null) { if ((s1_.cachedArrayType_.isInstance(arg1Value))) { assert DSLSupport.assertIdempotence((s1_.cachedArrayType_.isHolesType())); sparseArray(arg0Value, arg1Value, arg2Value, arg3Value, s1_.cachedArrayType_, deletePropertyNode_1, nextElementIndexNode_); return; } } } } s1_ = s1_.next_; } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSArrayDeleteRangeNode.doUncached(JSDynamicObject, ScriptArray, long, long, DeletePropertyNode, JSArrayNextElementIndexNode)] */) { { DeletePropertyNode deletePropertyNode_2 = this.deletePropertyNode; if (deletePropertyNode_2 != null) { JSArrayNextElementIndexNode nextElementIndexNode_1 = this.nextElementIndexNode; if (nextElementIndexNode_1 != null) { doUncached(arg0Value, arg1Value, arg2Value, arg3Value, deletePropertyNode_2, nextElementIndexNode_1); return; } } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); executeAndSpecialize(arg0Value, arg1Value, arg2Value, arg3Value); return; } private void executeAndSpecialize(JSDynamicObject arg0Value, ScriptArray arg1Value, long arg2Value, long arg3Value) { int state_0 = this.state_0_; if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[JSArrayDeleteRangeNode.doUncached(JSDynamicObject, ScriptArray, long, long, DeletePropertyNode, JSArrayNextElementIndexNode)] */) { while (true) { int count0_ = 0; DenseArrayData s0_ = DENSE_ARRAY_CACHE_UPDATER.getVolatile(this); DenseArrayData s0_original = s0_; while (s0_ != null) { { DeletePropertyNode deletePropertyNode_ = this.deletePropertyNode; if (deletePropertyNode_ != null) { if ((s0_.cachedArrayType_.isInstance(arg1Value))) { assert DSLSupport.assertIdempotence((!(s0_.cachedArrayType_.isHolesType()))); break; } } } count0_++; s0_ = s0_.next_; } if (s0_ == null) { { ScriptArray cachedArrayType__ = (arg1Value); if ((cachedArrayType__.isInstance(arg1Value)) && (!(cachedArrayType__.isHolesType())) && count0_ < (5)) { s0_ = new DenseArrayData(s0_original); s0_.cachedArrayType_ = cachedArrayType__; DeletePropertyNode deletePropertyNode_; DeletePropertyNode deletePropertyNode__shared = this.deletePropertyNode; if (deletePropertyNode__shared != null) { deletePropertyNode_ = deletePropertyNode__shared; } else { deletePropertyNode_ = this.insert((DeletePropertyNode.create(orThrow))); if (deletePropertyNode_ == null) { throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.deletePropertyNode == null) { this.deletePropertyNode = deletePropertyNode_; } if (!DENSE_ARRAY_CACHE_UPDATER.compareAndSet(this, s0_original, s0_)) { continue; } state_0 = state_0 | 0b1 /* add SpecializationActive[JSArrayDeleteRangeNode.denseArray(JSDynamicObject, ScriptArray, long, long, ScriptArray, DeletePropertyNode)] */; this.state_0_ = state_0; } } } if (s0_ != null) { denseArray(arg0Value, arg1Value, arg2Value, arg3Value, s0_.cachedArrayType_, this.deletePropertyNode); return; } break; } } if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[JSArrayDeleteRangeNode.doUncached(JSDynamicObject, ScriptArray, long, long, DeletePropertyNode, JSArrayNextElementIndexNode)] */) { while (true) { int count1_ = 0; SparseArrayData s1_ = SPARSE_ARRAY_CACHE_UPDATER.getVolatile(this); SparseArrayData s1_original = s1_; while (s1_ != null) { { DeletePropertyNode deletePropertyNode_1 = this.deletePropertyNode; if (deletePropertyNode_1 != null) { JSArrayNextElementIndexNode nextElementIndexNode_ = this.nextElementIndexNode; if (nextElementIndexNode_ != null) { if ((s1_.cachedArrayType_.isInstance(arg1Value))) { assert DSLSupport.assertIdempotence((s1_.cachedArrayType_.isHolesType())); break; } } } } count1_++; s1_ = s1_.next_; } if (s1_ == null) { { ScriptArray cachedArrayType__1 = (arg1Value); if ((cachedArrayType__1.isInstance(arg1Value)) && (cachedArrayType__1.isHolesType()) && count1_ < (5)) { s1_ = new SparseArrayData(s1_original); s1_.cachedArrayType_ = cachedArrayType__1; DeletePropertyNode deletePropertyNode_1; DeletePropertyNode deletePropertyNode_1_shared = this.deletePropertyNode; if (deletePropertyNode_1_shared != null) { deletePropertyNode_1 = deletePropertyNode_1_shared; } else { deletePropertyNode_1 = this.insert((DeletePropertyNode.create(orThrow))); if (deletePropertyNode_1 == null) { throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.deletePropertyNode == null) { this.deletePropertyNode = deletePropertyNode_1; } JSArrayNextElementIndexNode nextElementIndexNode_; JSArrayNextElementIndexNode nextElementIndexNode__shared = this.nextElementIndexNode; if (nextElementIndexNode__shared != null) { nextElementIndexNode_ = nextElementIndexNode__shared; } else { nextElementIndexNode_ = this.insert((JSArrayNextElementIndexNode.create(context))); if (nextElementIndexNode_ == null) { throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.nextElementIndexNode == null) { this.nextElementIndexNode = nextElementIndexNode_; } if (!SPARSE_ARRAY_CACHE_UPDATER.compareAndSet(this, s1_original, s1_)) { continue; } state_0 = state_0 | 0b100 /* add SpecializationActive[JSArrayDeleteRangeNode.sparseArray(JSDynamicObject, ScriptArray, long, long, ScriptArray, DeletePropertyNode, JSArrayNextElementIndexNode)] */; this.state_0_ = state_0; } } } if (s1_ != null) { sparseArray(arg0Value, arg1Value, arg2Value, arg3Value, s1_.cachedArrayType_, this.deletePropertyNode, this.nextElementIndexNode); return; } break; } } DeletePropertyNode deletePropertyNode_2; DeletePropertyNode deletePropertyNode_2_shared = this.deletePropertyNode; if (deletePropertyNode_2_shared != null) { deletePropertyNode_2 = deletePropertyNode_2_shared; } else { deletePropertyNode_2 = this.insert((DeletePropertyNode.create(orThrow))); if (deletePropertyNode_2 == null) { throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.deletePropertyNode == null) { VarHandle.storeStoreFence(); this.deletePropertyNode = deletePropertyNode_2; } JSArrayNextElementIndexNode nextElementIndexNode_1; JSArrayNextElementIndexNode nextElementIndexNode_1_shared = this.nextElementIndexNode; if (nextElementIndexNode_1_shared != null) { nextElementIndexNode_1 = nextElementIndexNode_1_shared; } else { nextElementIndexNode_1 = this.insert((JSArrayNextElementIndexNode.create(context))); if (nextElementIndexNode_1 == null) { throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.nextElementIndexNode == null) { VarHandle.storeStoreFence(); this.nextElementIndexNode = nextElementIndexNode_1; } this.denseArray_cache = null; this.sparseArray_cache = null; state_0 = state_0 & 0xfffffffa /* remove SpecializationActive[JSArrayDeleteRangeNode.denseArray(JSDynamicObject, ScriptArray, long, long, ScriptArray, DeletePropertyNode)], SpecializationActive[JSArrayDeleteRangeNode.sparseArray(JSDynamicObject, ScriptArray, long, long, ScriptArray, DeletePropertyNode, JSArrayNextElementIndexNode)] */; state_0 = state_0 | 0b10 /* add SpecializationActive[JSArrayDeleteRangeNode.doUncached(JSDynamicObject, ScriptArray, long, long, DeletePropertyNode, JSArrayNextElementIndexNode)] */; this.state_0_ = state_0; doUncached(arg0Value, arg1Value, arg2Value, arg3Value, deletePropertyNode_2, nextElementIndexNode_1); return; } @NeverDefault public static JSArrayDeleteRangeNode create(JSContext context, boolean orThrow) { return new JSArrayDeleteRangeNodeGen(context, orThrow); } @GeneratedBy(JSArrayDeleteRangeNode.class) @DenyReplace private static final class DenseArrayData implements SpecializationDataNode { @CompilationFinal final DenseArrayData next_; /** * Source Info:
         *   Specialization: {@link JSArrayDeleteRangeNode#denseArray}
         *   Parameter: {@link ScriptArray} cachedArrayType
*/ @CompilationFinal ScriptArray cachedArrayType_; DenseArrayData(DenseArrayData next_) { this.next_ = next_; } } @GeneratedBy(JSArrayDeleteRangeNode.class) @DenyReplace private static final class SparseArrayData implements SpecializationDataNode { @CompilationFinal final SparseArrayData next_; /** * Source Info:
         *   Specialization: {@link JSArrayDeleteRangeNode#sparseArray}
         *   Parameter: {@link ScriptArray} cachedArrayType
*/ @CompilationFinal ScriptArray cachedArrayType_; SparseArrayData(SparseArrayData next_) { this.next_ = next_; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy