Skip to content

Commit

Permalink
[Truffle] Restyle @CompilerDirectives.TruffleBoundary to @TruffleBoun…
Browse files Browse the repository at this point in the history
…dary.

* No qualified names in annotations please!
  • Loading branch information
eregon committed May 27, 2015
1 parent 2ce76a5 commit 9c22b94
Show file tree
Hide file tree
Showing 57 changed files with 254 additions and 163 deletions.
3 changes: 2 additions & 1 deletion truffle/src/main/java/org/jruby/truffle/nodes/RubyNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.jruby.truffle.nodes;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.TypeSystemReference;
Expand Down Expand Up @@ -300,7 +301,7 @@ protected Object rubyWithSelf(VirtualFrame frame, Object self, String expression
return getContext().eval(expression, binding, true, "inline-ruby", this);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private MaterializedFrame setupFrame(Object self, Object... arguments) {
final MaterializedFrame evalFrame = Truffle.getRuntime().createMaterializedFrame(
RubyArguments.pack(null, null, self, null, new Object[]{}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
package org.jruby.truffle.nodes.arguments;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.ConditionProfile;
import com.oracle.truffle.api.utilities.ValueProfile;

import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.RubyArguments;
import org.jruby.truffle.runtime.RubyContext;
Expand Down Expand Up @@ -70,7 +72,7 @@ public Object execute(VirtualFrame frame) {
}
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private Object lookupKeywordInHash(RubyHash hash) {
for (KeyValue keyValue : HashOperations.verySlowToKeyValues(hash)) {
if (keyValue.getKey().toString().equals(name)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
package org.jruby.truffle.nodes.cast;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;

import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.core.RubyArray;
Expand All @@ -38,7 +40,7 @@ protected Object castSingle(Object[] args) {
return args[0];
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization(guards = { "!noArguments(args)", "!singleArgument(args)" })
protected RubyArray castMany(Object[] args) {
return RubyArray.fromObjects(getContext().getCoreLibrary().getArrayClass(), args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
package org.jruby.truffle.nodes.conversion;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;

import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.core.RubyString;
Expand All @@ -30,13 +32,13 @@ public ToJavaStringNode(RubyContext context, SourceSection sourceSection) {

// TODO(CS): cache the conversion to a Java String? Or should the user do that themselves?

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
protected String toJavaString(RubySymbol symbol) {
return symbol.toString();
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
protected String toJavaString(RubyString string) {
return string.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.jruby.truffle.nodes.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
Expand Down Expand Up @@ -135,7 +136,7 @@ public AddOpNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private Object addBigDecimal(RubyBasicObject a, BigDecimal b) {
return createRubyBigDecimal(
getContext().getCoreLibrary().getBigDecimalClass(),
Expand Down Expand Up @@ -176,7 +177,7 @@ public AddNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private Object addBigDecimal(RubyBasicObject a, BigDecimal b, int precision) {
return createRubyBigDecimal(
getContext().getCoreLibrary().getBigDecimalClass(),
Expand Down Expand Up @@ -217,7 +218,7 @@ public SubOpNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private Object subBigDecimal(RubyBasicObject a, BigDecimal b) {
return createRubyBigDecimal(
getContext().getCoreLibrary().getBigDecimalClass(),
Expand Down Expand Up @@ -258,7 +259,7 @@ public SubNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private Object subBigDecimal(RubyBasicObject a, BigDecimal b, int precision) {
return createRubyBigDecimal(
getContext().getCoreLibrary().getBigDecimalClass(),
Expand Down Expand Up @@ -298,7 +299,7 @@ public MultOpNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private Object multBigDecimal(RubyBasicObject a, BigDecimal b) {
return createRubyBigDecimal(
getContext().getCoreLibrary().getBigDecimalClass(),
Expand Down Expand Up @@ -339,7 +340,7 @@ public MultNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private Object mulBigDecimal(RubyBasicObject a, BigDecimal b, int precision) {
return createRubyBigDecimal(
getContext().getCoreLibrary().getBigDecimalClass(),
Expand Down Expand Up @@ -380,7 +381,7 @@ public DivOpNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private Object divBigDecimal(RubyBasicObject a, BigDecimal b) {
// precision based on https://github.com/pitr-ch/jruby/blob/bigdecimal/core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java#L892-903
final int len = getBigDecimalValue(a).precision() + b.precision();
Expand Down Expand Up @@ -471,7 +472,7 @@ public ToSNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
public RubyString toS(RubyBasicObject value) {
final BigDecimal bigDecimal = getBigDecimalValue(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
package org.jruby.truffle.nodes.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.*;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.BranchProfile;
Expand All @@ -24,15 +22,13 @@
import org.jruby.truffle.nodes.cast.BooleanCastNodeGen;
import org.jruby.truffle.nodes.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.nodes.dispatch.DispatchHeadNodeFactory;
import org.jruby.truffle.nodes.objects.Allocator;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.UndefinedPlaceholder;
import org.jruby.truffle.runtime.control.RaiseException;
import org.jruby.truffle.runtime.core.*;

import java.math.BigInteger;
import java.util.EnumSet;
import java.util.concurrent.locks.ReentrantLock;

@CoreClass(name = "Bignum")
public abstract class BignumNodes {
Expand Down Expand Up @@ -591,7 +587,7 @@ public EvenNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
public boolean even(RubyBasicObject value) {
return !getBigIntegerValue(value).testBit(0);
Expand Down Expand Up @@ -620,7 +616,7 @@ public OddNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
public boolean odd(RubyBasicObject value) {
return getBigIntegerValue(value).testBit(0);
Expand Down Expand Up @@ -669,7 +665,7 @@ public RubyString toS(RubyBasicObject value, UndefinedPlaceholder undefined) {
return getContext().makeString(getBigIntegerValue(value).toString());
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
public RubyString toS(RubyBasicObject value, int base) {
if (base < 2 || base > 36) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
package org.jruby.truffle.nodes.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.FrameDescriptor;
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.api.source.SourceSection;

import org.jruby.truffle.nodes.locals.ReadFrameSlotNode;
import org.jruby.truffle.nodes.locals.ReadFrameSlotNodeGen;
import org.jruby.truffle.nodes.locals.WriteFrameSlotNode;
Expand Down Expand Up @@ -92,7 +94,7 @@ public Object localVariableGetCached(RubyBinding binding, RubySymbol symbol,
}
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization(guards = "!isLastLine(symbol)")
public Object localVariableGetUncached(RubyBinding binding, RubySymbol symbol) {
final MaterializedFrame frame = binding.getFrame();
Expand All @@ -105,7 +107,7 @@ public Object localVariableGetUncached(RubyBinding binding, RubySymbol symbol) {
return frame.getValue(frameSlot);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization(guards = "isLastLine(symbol)")
public Object localVariableGetLastLine(RubyBinding binding, RubySymbol symbol) {
final MaterializedFrame frame = binding.getFrame();
Expand Down Expand Up @@ -181,7 +183,7 @@ public Object localVariableSetCached(RubyBinding binding, RubySymbol symbol, Obj
return writeLocalVariableNode.executeWrite(binding.getFrame(), value);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization(guards = "!isLastLine(symbol)")
public Object localVariableSetUncached(RubyBinding binding, RubySymbol symbol, Object value) {
final MaterializedFrame frame = binding.getFrame();
Expand All @@ -190,7 +192,7 @@ public Object localVariableSetUncached(RubyBinding binding, RubySymbol symbol, O
return value;
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization(guards = "isLastLine(symbol)")
public Object localVariableSetLastLine(RubyBinding binding, RubySymbol symbol, Object value) {
final MaterializedFrame frame = binding.getFrame();
Expand Down Expand Up @@ -237,7 +239,7 @@ public LocalVariablesNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
public RubyArray localVariables(RubyBinding binding) {
final RubyArray array = new RubyArray(getContext().getCoreLibrary().getArrayClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public ToSNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
public RubyString toS(RubyEncoding encoding) {
final ByteList name = encoding.getName().dup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
package org.jruby.truffle.nodes.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.BranchProfile;

import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.RubyContext;

Expand Down Expand Up @@ -71,7 +73,7 @@ public Object fixnumOrBignum(double value) {
return fixnumOrBignum(doubleToBigInteger(value));
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private static BigInteger doubleToBigInteger(double value) {
return new BigDecimal(value).toBigInteger();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
package org.jruby.truffle.nodes.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.BranchProfile;
import com.oracle.truffle.api.utilities.ConditionProfile;

import org.jruby.truffle.nodes.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.nodes.dispatch.DispatchHeadNodeFactory;
import org.jruby.truffle.runtime.RubyContext;
Expand Down Expand Up @@ -726,7 +728,7 @@ public ToSNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
public RubyString toS(double value) {
return getContext().makeString(Double.toString(value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
package org.jruby.truffle.nodes.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.ConditionProfile;

import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.cast.ToSNode;
import org.jruby.truffle.nodes.objects.IsTaintedNode;
Expand Down Expand Up @@ -65,7 +67,7 @@ public Object execute(VirtualFrame frame) {
return string;
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
private RubyString concat(RubyString[] strings) {
// TODO(CS): there is a lot of copying going on here - and I think this is sometimes inner loop stuff

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
package org.jruby.truffle.nodes.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.IndirectCallNode;
import com.oracle.truffle.api.source.NullSourceSection;
import com.oracle.truffle.api.source.SourceSection;

import org.jruby.ast.ArgsNode;
import org.jruby.runtime.ArgumentDescriptor;
import org.jruby.runtime.Helpers;
Expand Down Expand Up @@ -143,7 +145,7 @@ public ParametersNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@TruffleBoundary
@Specialization
public RubyArray parameters(RubyMethod method) {
final ArgsNode argsNode = method.getMethod().getSharedMethodInfo().getParseTree().findFirstChild(ArgsNode.class);
Expand Down
Loading

0 comments on commit 9c22b94

Please sign in to comment.