Skip to content

Commit

Permalink
Showing 4 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -13,11 +13,12 @@
import com.oracle.truffle.api.profiles.ConditionProfile;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyBaseNode;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.language.dispatch.DispatchHeadNodeFactory;

public class HashNode extends RubyNode {
public class HashNode extends RubyBaseNode {

@Child private CallDispatchHeadNode hashNode;

@@ -41,9 +42,4 @@ public int hash(VirtualFrame frame, Object key) {
}
}

@Override
public Object execute(VirtualFrame frame) {
throw new UnsupportedOperationException();
}

}
Original file line number Diff line number Diff line change
@@ -17,11 +17,12 @@
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.core.basicobject.BasicObjectNodes;
import org.jruby.truffle.core.basicobject.BasicObjectNodesFactory;
import org.jruby.truffle.language.RubyBaseNode;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.language.dispatch.DispatchHeadNodeFactory;

public class LookupEntryNode extends RubyNode {
public class LookupEntryNode extends RubyBaseNode {

@Child HashNode hashNode;
@Child CallDispatchHeadNode eqlNode;
@@ -63,9 +64,4 @@ public HashLookupResult lookup(VirtualFrame frame, DynamicObject hash, Object ke
return new HashLookupResult(hashed, index, previousEntry, null);
}

@Override
public Object execute(VirtualFrame frame) {
throw new UnsupportedOperationException();
}

}
Original file line number Diff line number Diff line change
@@ -17,12 +17,13 @@
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.CoreLibrary;
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.language.RubyBaseNode;
import org.jruby.truffle.language.RubyNode;

import java.math.BigDecimal;
import java.math.BigInteger;

public class FixnumOrBignumNode extends RubyNode {
public class FixnumOrBignumNode extends RubyBaseNode {

private static final BigInteger LONG_MIN_BIGINT = BigInteger.valueOf(Long.MIN_VALUE);
private static final BigInteger LONG_MAX_BIGINT = BigInteger.valueOf(Long.MAX_VALUE);
@@ -76,8 +77,4 @@ private static BigInteger doubleToBigInteger(double value) {
return new BigDecimal(value).toBigInteger();
}

public Object execute(VirtualFrame frame) {
throw new UnsupportedOperationException();
}

}
Original file line number Diff line number Diff line change
@@ -16,12 +16,13 @@
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.language.RubyBaseNode;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.control.RaiseException;

import java.math.BigInteger;

public class GeneralDivModNode extends RubyNode {
public class GeneralDivModNode extends RubyBaseNode {

@Child private FixnumOrBignumNode fixnumOrBignumQuotient;
@Child private FixnumOrBignumNode fixnumOrBignumRemainder;
@@ -172,9 +173,4 @@ public DynamicObject create(BigInteger value) {
return Layouts.BIGNUM.createBignum(coreLibrary().getBignumFactory(), value);
}

@Override
public Object execute(VirtualFrame frame) {
throw new UnsupportedOperationException();
}

}

1 comment on commit 95f825a

@chrisseaton
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jruby/truffle

If you use RubyNode just because you want the context and helpers and things, use RubyBaseNode instead, and then there's no need for a dummy execute method.

Sorry, something went wrong.

Please sign in to comment.