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

com.oracle.truffle.tck.ComplexNumbersBMessageResolutionForeignFactory Maven / Gradle / Ivy

Go to download

A collection of tests that can certify language implementation to be compliant with most recent requirements of the Truffle infrastructure and tooling.

There is a newer version: 1.0.0-rc7
Show newest version
// CheckStyle: start generated
package com.oracle.truffle.tck;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.interop.TruffleObject;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.tck.ComplexNumbersBMessageResolutionForeign.ComplexNumbersBGetSizeSubNode;
import com.oracle.truffle.tck.ComplexNumbersBMessageResolutionForeign.ComplexNumbersBHasSizeSubNode;
import com.oracle.truffle.tck.ComplexNumbersBMessageResolutionForeign.ComplexNumbersBReadSubNode;
import com.oracle.truffle.tck.ComplexNumbersBMessageResolutionForeign.ComplexNumbersBWriteSubNode;
import java.util.concurrent.locks.Lock;

@GeneratedBy(ComplexNumbersBMessageResolutionForeign.class)
final class ComplexNumbersBMessageResolutionForeignFactory {

    @GeneratedBy(ComplexNumbersBWriteSubNode.class)
    static final class ComplexNumbersBWriteSubNodeGen extends ComplexNumbersBWriteSubNode {

        @CompilationFinal private int state_ = 1;

        private ComplexNumbersBWriteSubNodeGen() {
        }

        @Override
        public Object executeWithTarget(VirtualFrame frameValue, Object arg0Value, Object arg1Value, Object arg2Value) {
            int state = state_;
            if ((state & 0b10) != 0 /* is-active accessWithTarget(VirtualFrame, ComplexNumbersB, Number, TruffleObject) */ && arg0Value instanceof ComplexNumbersB) {
                ComplexNumbersB arg0Value_ = (ComplexNumbersB) arg0Value;
                if (arg1Value instanceof Number) {
                    Number arg1Value_ = (Number) arg1Value;
                    if (arg2Value instanceof TruffleObject) {
                        TruffleObject arg2Value_ = (TruffleObject) arg2Value;
                        return accessWithTarget(frameValue, arg0Value_, arg1Value_, arg2Value_);
                    }
                }
            }
            CompilerDirectives.transferToInterpreterAndInvalidate();
            return executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value);
        }

        private Object executeAndSpecialize(VirtualFrame frameValue, Object arg0Value, Object arg1Value, Object arg2Value) {
            Lock lock = getLock();
            boolean hasLock = true;
            lock.lock();
            try {
                int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
                if (arg0Value instanceof ComplexNumbersB) {
                    ComplexNumbersB arg0Value_ = (ComplexNumbersB) arg0Value;
                    if (arg1Value instanceof Number) {
                        Number arg1Value_ = (Number) arg1Value;
                        if (arg2Value instanceof TruffleObject) {
                            TruffleObject arg2Value_ = (TruffleObject) arg2Value;
                            this.state_ = state | 0b10 /* add-active accessWithTarget(VirtualFrame, ComplexNumbersB, Number, TruffleObject) */;
                            lock.unlock();
                            hasLock = false;
                            return accessWithTarget(frameValue, arg0Value_, arg1Value_, arg2Value_);
                        }
                    }
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                throw new UnsupportedSpecializationException(this, new Node[] {null, null, null}, arg0Value, arg1Value, arg2Value);
            } finally {
                if (hasLock) {
                    lock.unlock();
                }
            }
        }

        @Override
        public NodeCost getCost() {
            int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
            if (state == 0b0) {
                return NodeCost.UNINITIALIZED;
            } else {
                return NodeCost.MONOMORPHIC;
            }
        }

        public static ComplexNumbersBWriteSubNode create() {
            return new ComplexNumbersBWriteSubNodeGen();
        }

    }
    @GeneratedBy(ComplexNumbersBReadSubNode.class)
    static final class ComplexNumbersBReadSubNodeGen extends ComplexNumbersBReadSubNode {

        @CompilationFinal private int state_ = 1;

        private ComplexNumbersBReadSubNodeGen() {
        }

        @Override
        public Object executeWithTarget(VirtualFrame frameValue, Object arg0Value, Object arg1Value) {
            int state = state_;
            if ((state & 0b10) != 0 /* is-active accessWithTarget(ComplexNumbersB, Number) */ && arg0Value instanceof ComplexNumbersB) {
                ComplexNumbersB arg0Value_ = (ComplexNumbersB) arg0Value;
                if (arg1Value instanceof Number) {
                    Number arg1Value_ = (Number) arg1Value;
                    return accessWithTarget(arg0Value_, arg1Value_);
                }
            }
            CompilerDirectives.transferToInterpreterAndInvalidate();
            return executeAndSpecialize(arg0Value, arg1Value);
        }

        private Object executeAndSpecialize(Object arg0Value, Object arg1Value) {
            Lock lock = getLock();
            boolean hasLock = true;
            lock.lock();
            try {
                int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
                if (arg0Value instanceof ComplexNumbersB) {
                    ComplexNumbersB arg0Value_ = (ComplexNumbersB) arg0Value;
                    if (arg1Value instanceof Number) {
                        Number arg1Value_ = (Number) arg1Value;
                        this.state_ = state | 0b10 /* add-active accessWithTarget(ComplexNumbersB, Number) */;
                        lock.unlock();
                        hasLock = false;
                        return accessWithTarget(arg0Value_, arg1Value_);
                    }
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                throw new UnsupportedSpecializationException(this, new Node[] {null, null}, arg0Value, arg1Value);
            } finally {
                if (hasLock) {
                    lock.unlock();
                }
            }
        }

        @Override
        public NodeCost getCost() {
            int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
            if (state == 0b0) {
                return NodeCost.UNINITIALIZED;
            } else {
                return NodeCost.MONOMORPHIC;
            }
        }

        public static ComplexNumbersBReadSubNode create() {
            return new ComplexNumbersBReadSubNodeGen();
        }

    }
    @GeneratedBy(ComplexNumbersBGetSizeSubNode.class)
    static final class ComplexNumbersBGetSizeSubNodeGen extends ComplexNumbersBGetSizeSubNode {

        @CompilationFinal private int state_ = 1;

        private ComplexNumbersBGetSizeSubNodeGen() {
        }

        @Override
        public Object executeWithTarget(VirtualFrame frameValue, Object arg0Value) {
            int state = state_;
            if ((state & 0b10) != 0 /* is-active accessWithTarget(ComplexNumbersB) */ && arg0Value instanceof ComplexNumbersB) {
                ComplexNumbersB arg0Value_ = (ComplexNumbersB) arg0Value;
                return accessWithTarget(arg0Value_);
            }
            CompilerDirectives.transferToInterpreterAndInvalidate();
            return executeAndSpecialize(arg0Value);
        }

        private Object executeAndSpecialize(Object arg0Value) {
            Lock lock = getLock();
            boolean hasLock = true;
            lock.lock();
            try {
                int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
                if (arg0Value instanceof ComplexNumbersB) {
                    ComplexNumbersB arg0Value_ = (ComplexNumbersB) arg0Value;
                    this.state_ = state | 0b10 /* add-active accessWithTarget(ComplexNumbersB) */;
                    lock.unlock();
                    hasLock = false;
                    return accessWithTarget(arg0Value_);
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                throw new UnsupportedSpecializationException(this, new Node[] {null}, arg0Value);
            } finally {
                if (hasLock) {
                    lock.unlock();
                }
            }
        }

        @Override
        public NodeCost getCost() {
            int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
            if (state == 0b0) {
                return NodeCost.UNINITIALIZED;
            } else {
                return NodeCost.MONOMORPHIC;
            }
        }

        public static ComplexNumbersBGetSizeSubNode create() {
            return new ComplexNumbersBGetSizeSubNodeGen();
        }

    }
    @GeneratedBy(ComplexNumbersBHasSizeSubNode.class)
    static final class ComplexNumbersBHasSizeSubNodeGen extends ComplexNumbersBHasSizeSubNode {

        @CompilationFinal private int state_ = 1;

        private ComplexNumbersBHasSizeSubNodeGen() {
        }

        @Override
        public Object executeWithTarget(VirtualFrame frameValue, Object arg0Value) {
            int state = state_;
            if ((state & 0b10) != 0 /* is-active accessWithTarget(ComplexNumbersB) */ && arg0Value instanceof ComplexNumbersB) {
                ComplexNumbersB arg0Value_ = (ComplexNumbersB) arg0Value;
                return accessWithTarget(arg0Value_);
            }
            CompilerDirectives.transferToInterpreterAndInvalidate();
            return executeAndSpecialize(arg0Value);
        }

        private Object executeAndSpecialize(Object arg0Value) {
            Lock lock = getLock();
            boolean hasLock = true;
            lock.lock();
            try {
                int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
                if (arg0Value instanceof ComplexNumbersB) {
                    ComplexNumbersB arg0Value_ = (ComplexNumbersB) arg0Value;
                    this.state_ = state | 0b10 /* add-active accessWithTarget(ComplexNumbersB) */;
                    lock.unlock();
                    hasLock = false;
                    return accessWithTarget(arg0Value_);
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                throw new UnsupportedSpecializationException(this, new Node[] {null}, arg0Value);
            } finally {
                if (hasLock) {
                    lock.unlock();
                }
            }
        }

        @Override
        public NodeCost getCost() {
            int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
            if (state == 0b0) {
                return NodeCost.UNINITIALIZED;
            } else {
                return NodeCost.MONOMORPHIC;
            }
        }

        public static ComplexNumbersBHasSizeSubNode create() {
            return new ComplexNumbersBHasSizeSubNodeGen();
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy