org.truffleruby.language.objects.ImmutableClassNodeGen Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ruby-language Show documentation
Show all versions of ruby-language Show documentation
Core module of Ruby on Truffle
The newest version!
// CheckStyle: start generated
package org.truffleruby.language.objects;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.dsl.InlineSupport.InlineTarget;
import com.oracle.truffle.api.dsl.InlineSupport.RequiredField;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.UnadoptableNode;
import org.truffleruby.core.CoreLibrary;
import org.truffleruby.core.encoding.RubyEncoding;
import org.truffleruby.core.klass.RubyClass;
import org.truffleruby.core.numeric.RubyBignum;
import org.truffleruby.core.range.RubyIntOrLongRange;
import org.truffleruby.core.regexp.RubyRegexp;
import org.truffleruby.core.string.ImmutableRubyString;
import org.truffleruby.core.symbol.RubySymbol;
import org.truffleruby.language.Nil;
import org.truffleruby.language.NoImplicitCastsToLong;
/**
* Debug Info:
* Specialization {@link ImmutableClassNode#metaClassInt}
* Activation probability: 0.14679
* With/without class size: 5/0 bytes
* Specialization {@link ImmutableClassNode#metaClassImmutableString}
* Activation probability: 0.13526
* With/without class size: 5/0 bytes
* Specialization {@link ImmutableClassNode#metaClassSymbol}
* Activation probability: 0.12372
* With/without class size: 5/0 bytes
* Specialization {@link ImmutableClassNode#metaClassNil}
* Activation probability: 0.11218
* With/without class size: 5/0 bytes
* Specialization {@link ImmutableClassNode#metaClassTrue}
* Activation probability: 0.10064
* With/without class size: 5/0 bytes
* Specialization {@link ImmutableClassNode#metaClassFalse}
* Activation probability: 0.08910
* With/without class size: 5/0 bytes
* Specialization {@link ImmutableClassNode#metaClassLong}
* Activation probability: 0.07756
* With/without class size: 4/0 bytes
* Specialization {@link ImmutableClassNode#metaClassEncoding}
* Activation probability: 0.06603
* With/without class size: 4/0 bytes
* Specialization {@link ImmutableClassNode#metaClassRegexp}
* Activation probability: 0.05449
* With/without class size: 4/0 bytes
* Specialization {@link ImmutableClassNode#metaClassRange}
* Activation probability: 0.04295
* With/without class size: 4/0 bytes
* Specialization {@link ImmutableClassNode#metaClassDouble}
* Activation probability: 0.03141
* With/without class size: 4/0 bytes
* Specialization {@link ImmutableClassNode#metaClassBignum}
* Activation probability: 0.01987
* With/without class size: 4/0 bytes
*
*/
@GeneratedBy(ImmutableClassNode.class)
@SuppressWarnings("javadoc")
public final class ImmutableClassNodeGen {
private static final Uncached UNCACHED = new Uncached();
@TruffleBoundary
private static UnsupportedSpecializationException newUnsupportedSpecializationException3(Node thisNode_, Object arg0Value, Object arg1Value, Object arg2Value) {
return new UnsupportedSpecializationException(thisNode_, null, arg0Value, arg1Value, arg2Value);
}
@NeverDefault
public static ImmutableClassNode getUncached() {
return ImmutableClassNodeGen.UNCACHED;
}
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
*/
@NeverDefault
public static ImmutableClassNode inline(@RequiredField(bits = 12, value = StateField.class) InlineTarget target) {
return new ImmutableClassNodeGen.Inlined(target);
}
@GeneratedBy(ImmutableClassNode.class)
@DenyReplace
private static final class Inlined extends ImmutableClassNode implements UnadoptableNode {
/**
* State Info:
* 0: SpecializationActive {@link ImmutableClassNode#metaClassInt}
* 1: SpecializationActive {@link ImmutableClassNode#metaClassImmutableString}
* 2: SpecializationActive {@link ImmutableClassNode#metaClassSymbol}
* 3: SpecializationActive {@link ImmutableClassNode#metaClassNil}
* 4: SpecializationActive {@link ImmutableClassNode#metaClassTrue}
* 5: SpecializationActive {@link ImmutableClassNode#metaClassFalse}
* 6: SpecializationActive {@link ImmutableClassNode#metaClassLong}
* 7: SpecializationActive {@link ImmutableClassNode#metaClassEncoding}
* 8: SpecializationActive {@link ImmutableClassNode#metaClassRegexp}
* 9: SpecializationActive {@link ImmutableClassNode#metaClassRange}
* 10: SpecializationActive {@link ImmutableClassNode#metaClassDouble}
* 11: SpecializationActive {@link ImmutableClassNode#metaClassBignum}
*
*/
private final StateField state_0_;
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(ImmutableClassNode.class);
this.state_0_ = target.getState(0, 12);
}
@Override
protected RubyClass execute(Node arg0Value, Object arg1Value, CoreLibrary arg2Value) {
int state_0 = this.state_0_.get(arg0Value);
if (state_0 != 0 /* is SpecializationActive[ImmutableClassNode.metaClassInt(int, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassImmutableString(ImmutableRubyString, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassSymbol(RubySymbol, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassNil(Nil, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassTrue(boolean, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassFalse(boolean, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassLong(long, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassEncoding(RubyEncoding, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassRegexp(RubyRegexp, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassRange(RubyIntOrLongRange, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassDouble(double, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassBignum(RubyBignum, CoreLibrary)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassInt(int, CoreLibrary)] */ && arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
return ImmutableClassNode.metaClassInt(arg1Value_, arg2Value);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassImmutableString(ImmutableRubyString, CoreLibrary)] */ && arg1Value instanceof ImmutableRubyString) {
ImmutableRubyString arg1Value_ = (ImmutableRubyString) arg1Value;
return ImmutableClassNode.metaClassImmutableString(arg1Value_, arg2Value);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassSymbol(RubySymbol, CoreLibrary)] */ && arg1Value instanceof RubySymbol) {
RubySymbol arg1Value_ = (RubySymbol) arg1Value;
return ImmutableClassNode.metaClassSymbol(arg1Value_, arg2Value);
}
if ((state_0 & 0b1000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassNil(Nil, CoreLibrary)] */ && NoImplicitCastsToLong.isNil(arg1Value)) {
Nil arg1Value_ = NoImplicitCastsToLong.asNil(arg1Value);
return ImmutableClassNode.metaClassNil(arg1Value_, arg2Value);
}
if ((state_0 & 0b110000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassTrue(boolean, CoreLibrary)] || SpecializationActive[ImmutableClassNode.metaClassFalse(boolean, CoreLibrary)] */ && arg1Value instanceof Boolean) {
boolean arg1Value_ = (boolean) arg1Value;
if ((state_0 & 0b10000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassTrue(boolean, CoreLibrary)] */) {
if ((arg1Value_)) {
return ImmutableClassNode.metaClassTrue(arg1Value_, arg2Value);
}
}
if ((state_0 & 0b100000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassFalse(boolean, CoreLibrary)] */) {
if ((!(arg1Value_))) {
return ImmutableClassNode.metaClassFalse(arg1Value_, arg2Value);
}
}
}
if ((state_0 & 0b1000000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassLong(long, CoreLibrary)] */ && arg1Value instanceof Long) {
long arg1Value_ = (long) arg1Value;
return ImmutableClassNode.metaClassLong(arg1Value_, arg2Value);
}
if ((state_0 & 0b10000000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassEncoding(RubyEncoding, CoreLibrary)] */ && arg1Value instanceof RubyEncoding) {
RubyEncoding arg1Value_ = (RubyEncoding) arg1Value;
return ImmutableClassNode.metaClassEncoding(arg1Value_, arg2Value);
}
if ((state_0 & 0b100000000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassRegexp(RubyRegexp, CoreLibrary)] */ && arg1Value instanceof RubyRegexp) {
RubyRegexp arg1Value_ = (RubyRegexp) arg1Value;
return ImmutableClassNode.metaClassRegexp(arg1Value_, arg2Value);
}
if ((state_0 & 0b1000000000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassRange(RubyIntOrLongRange, CoreLibrary)] */ && arg1Value instanceof RubyIntOrLongRange) {
RubyIntOrLongRange arg1Value_ = (RubyIntOrLongRange) arg1Value;
return ImmutableClassNode.metaClassRange(arg1Value_, arg2Value);
}
if ((state_0 & 0b10000000000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassDouble(double, CoreLibrary)] */ && arg1Value instanceof Double) {
double arg1Value_ = (double) arg1Value;
return ImmutableClassNode.metaClassDouble(arg1Value_, arg2Value);
}
if ((state_0 & 0b100000000000) != 0 /* is SpecializationActive[ImmutableClassNode.metaClassBignum(RubyBignum, CoreLibrary)] */ && arg1Value instanceof RubyBignum) {
RubyBignum arg1Value_ = (RubyBignum) arg1Value;
return ImmutableClassNode.metaClassBignum(arg1Value_, arg2Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
private RubyClass executeAndSpecialize(Node arg0Value, Object arg1Value, CoreLibrary arg2Value) {
int state_0 = this.state_0_.get(arg0Value);
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[ImmutableClassNode.metaClassInt(int, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassInt(arg1Value_, arg2Value);
}
if (arg1Value instanceof ImmutableRubyString) {
ImmutableRubyString arg1Value_ = (ImmutableRubyString) arg1Value;
state_0 = state_0 | 0b10 /* add SpecializationActive[ImmutableClassNode.metaClassImmutableString(ImmutableRubyString, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassImmutableString(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubySymbol) {
RubySymbol arg1Value_ = (RubySymbol) arg1Value;
state_0 = state_0 | 0b100 /* add SpecializationActive[ImmutableClassNode.metaClassSymbol(RubySymbol, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassSymbol(arg1Value_, arg2Value);
}
if (NoImplicitCastsToLong.isNil(arg1Value)) {
Nil arg1Value_ = NoImplicitCastsToLong.asNil(arg1Value);
state_0 = state_0 | 0b1000 /* add SpecializationActive[ImmutableClassNode.metaClassNil(Nil, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassNil(arg1Value_, arg2Value);
}
if (arg1Value instanceof Boolean) {
boolean arg1Value_ = (boolean) arg1Value;
if ((arg1Value_)) {
state_0 = state_0 | 0b10000 /* add SpecializationActive[ImmutableClassNode.metaClassTrue(boolean, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassTrue(arg1Value_, arg2Value);
}
if ((!(arg1Value_))) {
state_0 = state_0 | 0b100000 /* add SpecializationActive[ImmutableClassNode.metaClassFalse(boolean, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassFalse(arg1Value_, arg2Value);
}
}
if (arg1Value instanceof Long) {
long arg1Value_ = (long) arg1Value;
state_0 = state_0 | 0b1000000 /* add SpecializationActive[ImmutableClassNode.metaClassLong(long, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassLong(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubyEncoding) {
RubyEncoding arg1Value_ = (RubyEncoding) arg1Value;
state_0 = state_0 | 0b10000000 /* add SpecializationActive[ImmutableClassNode.metaClassEncoding(RubyEncoding, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassEncoding(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubyRegexp) {
RubyRegexp arg1Value_ = (RubyRegexp) arg1Value;
state_0 = state_0 | 0b100000000 /* add SpecializationActive[ImmutableClassNode.metaClassRegexp(RubyRegexp, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassRegexp(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubyIntOrLongRange) {
RubyIntOrLongRange arg1Value_ = (RubyIntOrLongRange) arg1Value;
state_0 = state_0 | 0b1000000000 /* add SpecializationActive[ImmutableClassNode.metaClassRange(RubyIntOrLongRange, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassRange(arg1Value_, arg2Value);
}
if (arg1Value instanceof Double) {
double arg1Value_ = (double) arg1Value;
state_0 = state_0 | 0b10000000000 /* add SpecializationActive[ImmutableClassNode.metaClassDouble(double, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassDouble(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubyBignum) {
RubyBignum arg1Value_ = (RubyBignum) arg1Value;
state_0 = state_0 | 0b100000000000 /* add SpecializationActive[ImmutableClassNode.metaClassBignum(RubyBignum, CoreLibrary)] */;
this.state_0_.set(arg0Value, state_0);
return ImmutableClassNode.metaClassBignum(arg1Value_, arg2Value);
}
throw newUnsupportedSpecializationException3(this, arg0Value, arg1Value, arg2Value);
}
}
@GeneratedBy(ImmutableClassNode.class)
@DenyReplace
private static final class Uncached extends ImmutableClassNode implements UnadoptableNode {
@TruffleBoundary
@Override
protected RubyClass execute(Node arg0Value, Object arg1Value, CoreLibrary arg2Value) {
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
return ImmutableClassNode.metaClassInt(arg1Value_, arg2Value);
}
if (arg1Value instanceof ImmutableRubyString) {
ImmutableRubyString arg1Value_ = (ImmutableRubyString) arg1Value;
return ImmutableClassNode.metaClassImmutableString(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubySymbol) {
RubySymbol arg1Value_ = (RubySymbol) arg1Value;
return ImmutableClassNode.metaClassSymbol(arg1Value_, arg2Value);
}
if (NoImplicitCastsToLong.isNil(arg1Value)) {
Nil arg1Value_ = NoImplicitCastsToLong.asNil(arg1Value);
return ImmutableClassNode.metaClassNil(arg1Value_, arg2Value);
}
if (arg1Value instanceof Boolean) {
boolean arg1Value_ = (boolean) arg1Value;
if ((arg1Value_)) {
return ImmutableClassNode.metaClassTrue(arg1Value_, arg2Value);
}
if ((!(arg1Value_))) {
return ImmutableClassNode.metaClassFalse(arg1Value_, arg2Value);
}
}
if (arg1Value instanceof Long) {
long arg1Value_ = (long) arg1Value;
return ImmutableClassNode.metaClassLong(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubyEncoding) {
RubyEncoding arg1Value_ = (RubyEncoding) arg1Value;
return ImmutableClassNode.metaClassEncoding(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubyRegexp) {
RubyRegexp arg1Value_ = (RubyRegexp) arg1Value;
return ImmutableClassNode.metaClassRegexp(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubyIntOrLongRange) {
RubyIntOrLongRange arg1Value_ = (RubyIntOrLongRange) arg1Value;
return ImmutableClassNode.metaClassRange(arg1Value_, arg2Value);
}
if (arg1Value instanceof Double) {
double arg1Value_ = (double) arg1Value;
return ImmutableClassNode.metaClassDouble(arg1Value_, arg2Value);
}
if (arg1Value instanceof RubyBignum) {
RubyBignum arg1Value_ = (RubyBignum) arg1Value;
return ImmutableClassNode.metaClassBignum(arg1Value_, arg2Value);
}
throw newUnsupportedSpecializationException3(this, arg0Value, arg1Value, arg2Value);
}
}
}