Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b94d8a36ee29
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 79aeb5612126
Choose a head ref
  • 9 commits
  • 14 files changed
  • 1 contributor

Commits on Apr 5, 2016

  1. Copy the full SHA
    15851fe View commit details

Commits on Apr 6, 2016

  1. Copy the full SHA
    a1f37ba View commit details
  2. Copy the full SHA
    a1ad7b8 View commit details
  3. Copy the full SHA
    10fa887 View commit details
  4. Copy the full SHA
    246cae8 View commit details
  5. [Truffle] Queue is safe.

    chrisseaton committed Apr 6, 2016
    Copy the full SHA
    89fbfe3 View commit details
  6. Copy the full SHA
    5ccaa9e View commit details
  7. Copy the full SHA
    1084cd0 View commit details
  8. Copy the full SHA
    79aeb56 View commit details
Original file line number Diff line number Diff line change
@@ -381,7 +381,7 @@ public DynamicObject current() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "allocate", constructor = true, unsafe = UnsafeGroup.THREADS)
@CoreMethod(names = "allocate", constructor = true, unsafe = UnsafeGroup.THREADS)
public abstract static class AllocateNode extends CoreMethodArrayArgumentsNode {

public AllocateNode(RubyContext context, SourceSection sourceSection) {
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@
@CoreClass(name = "Method")
public abstract class MethodNodes {

@CoreMethod(unsafeNeedsAudit = true, names = { "==", "eql?" }, required = 1)
@CoreMethod(names = { "==", "eql?" }, required = 1)
public abstract static class EqualNode extends CoreMethodArrayArgumentsNode {

@Child protected ReferenceEqualNode referenceEqualNode;
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
@CoreClass(name = "ObjectSpace")
public abstract class ObjectSpaceNodes {

@CoreMethod(unsafeNeedsAudit = true, names = "_id2ref", isModuleFunction = true, required = 1)
@CoreMethod(names = "_id2ref", isModuleFunction = true, required = 1)
@ImportStatic(ObjectIDOperations.class)
public abstract static class ID2RefNode extends CoreMethodArrayArgumentsNode {

@@ -103,7 +103,7 @@ protected boolean isFloatID(DynamicObject id) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "each_object", isModuleFunction = true, needsBlock = true, optional = 1, returnsEnumeratorIfNoBlock = true)
@CoreMethod(names = "each_object", isModuleFunction = true, needsBlock = true, optional = 1, returnsEnumeratorIfNoBlock = true)
public abstract static class EachObjectNode extends YieldingCoreMethodNode {

public EachObjectNode(RubyContext context, SourceSection sourceSection) {
@@ -149,7 +149,7 @@ private boolean isHidden(DynamicObject object) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "define_finalizer", isModuleFunction = true, required = 2)
@CoreMethod(names = "define_finalizer", isModuleFunction = true, required = 2)
public abstract static class DefineFinalizerNode extends CoreMethodArrayArgumentsNode {

// MRI would do a dynamic call to #respond_to? but it seems better to warn the user earlier.
@@ -175,7 +175,7 @@ public DynamicObject defineFinalizer(VirtualFrame frame, DynamicObject object, O

}

@CoreMethod(unsafeNeedsAudit = true, names = "undefine_finalizer", isModuleFunction = true, required = 1)
@CoreMethod(names = "undefine_finalizer", isModuleFunction = true, required = 1)
public abstract static class UndefineFinalizerNode extends CoreMethodArrayArgumentsNode {

public UndefineFinalizerNode(RubyContext context, SourceSection sourceSection) {
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@
@CoreClass(name = "Queue")
public abstract class QueueNodes {

@CoreMethod(unsafeNeedsAudit = true, names = "allocate", constructor = true)
@CoreMethod(names = "allocate", constructor = true)
public abstract static class AllocateNode extends CoreMethodArrayArgumentsNode {

@Child private AllocateObjectNode allocateNode;
@@ -56,7 +56,7 @@ public DynamicObject allocate(DynamicObject rubyClass) {

}

@CoreMethod(unsafeNeedsAudit = true, names = { "push", "<<", "enq" }, required = 1)
@CoreMethod(names = { "push", "<<", "enq" }, required = 1)
public abstract static class PushNode extends CoreMethodArrayArgumentsNode {

public PushNode(RubyContext context, SourceSection sourceSection) {
@@ -79,7 +79,7 @@ private void doPush(final Object value, final BlockingQueue<Object> queue) {

}

@CoreMethod(unsafeNeedsAudit = true, names = { "pop", "shift", "deq" }, optional = 1)
@CoreMethod(names = { "pop", "shift", "deq" }, optional = 1)
@NodeChildren({
@NodeChild(type = RubyNode.class, value = "queue"),
@NodeChild(type = RubyNode.class, value = "nonBlocking")
@@ -133,7 +133,7 @@ private Object doPoll(final BlockingQueue<Object> queue) {
}

@RubiniusOnly
@CoreMethod(unsafeNeedsAudit = true, names = "receive_timeout", required = 1, visibility = Visibility.PRIVATE)
@CoreMethod(names = "receive_timeout", required = 1, visibility = Visibility.PRIVATE)
@NodeChildren({
@NodeChild(type = RubyNode.class, value = "queue"),
@NodeChild(type = RubyNode.class, value = "duration")
@@ -183,7 +183,7 @@ public Object block() throws InterruptedException {

}

@CoreMethod(unsafeNeedsAudit = true, names = "empty?")
@CoreMethod(names = "empty?")
public abstract static class EmptyNode extends CoreMethodArrayArgumentsNode {

public EmptyNode(RubyContext context, SourceSection sourceSection) {
@@ -199,7 +199,7 @@ public boolean empty(DynamicObject self) {

}

@CoreMethod(unsafeNeedsAudit = true, names = { "size", "length" })
@CoreMethod(names = { "size", "length" })
public abstract static class SizeNode extends CoreMethodArrayArgumentsNode {

public SizeNode(RubyContext context, SourceSection sourceSection) {
@@ -215,7 +215,7 @@ public int size(DynamicObject self) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "clear")
@CoreMethod(names = "clear")
public abstract static class ClearNode extends CoreMethodArrayArgumentsNode {

public ClearNode(RubyContext context, SourceSection sourceSection) {
@@ -232,7 +232,7 @@ public DynamicObject clear(DynamicObject self) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "marshal_dump")
@CoreMethod(names = "marshal_dump")
public abstract static class MarshalDumpNode extends CoreMethodArrayArgumentsNode {

public MarshalDumpNode(RubyContext context, SourceSection sourceSection) {
@@ -247,7 +247,7 @@ public Object marshal_dump(DynamicObject self) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "num_waiting")
@CoreMethod(names = "num_waiting")
public abstract static class NumWaitingNode extends CoreMethodArrayArgumentsNode {

public NumWaitingNode(RubyContext context, SourceSection sourceSection) {
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@
@CoreClass(name = "SizedQueue")
public abstract class SizedQueueNodes {

@CoreMethod(unsafeNeedsAudit = true, names = "allocate", constructor = true)
@CoreMethod(names = "allocate", constructor = true)
public abstract static class AllocateNode extends CoreMethodArrayArgumentsNode {

public AllocateNode(RubyContext context, SourceSection sourceSection) {
@@ -53,7 +53,7 @@ public DynamicObject allocate(DynamicObject rubyClass) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "initialize", visibility = Visibility.PRIVATE, required = 1)
@CoreMethod(names = "initialize", visibility = Visibility.PRIVATE, required = 1)
public abstract static class InitializeNode extends CoreMethodArrayArgumentsNode {

public InitializeNode(RubyContext context, SourceSection sourceSection) {
@@ -74,7 +74,7 @@ public DynamicObject initialize(DynamicObject self, int capacity) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "max=", required = 1)
@CoreMethod(names = "max=", required = 1)
public abstract static class SetMaxNode extends CoreMethodArrayArgumentsNode {

public SetMaxNode(RubyContext context, SourceSection sourceSection) {
@@ -104,7 +104,7 @@ public int setMax(DynamicObject self, int newCapacity) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "max")
@CoreMethod(names = "max")
public abstract static class MaxNode extends CoreMethodArrayArgumentsNode {

public MaxNode(RubyContext context, SourceSection sourceSection) {
@@ -122,7 +122,7 @@ public int max(DynamicObject self) {

}

@CoreMethod(unsafeNeedsAudit = true, names = { "push", "<<", "enq" }, required = 1, optional = 1)
@CoreMethod(names = { "push", "<<", "enq" }, required = 1, optional = 1)
@NodeChildren({
@NodeChild(type = RubyNode.class, value = "queue"),
@NodeChild(type = RubyNode.class, value = "value"),
@@ -179,7 +179,7 @@ private boolean doOffer(final Object value, final BlockingQueue<Object> queue) {

}

@CoreMethod(unsafeNeedsAudit = true, names = { "pop", "shift", "deq" }, optional = 1)
@CoreMethod(names = { "pop", "shift", "deq" }, optional = 1)
@NodeChildren({
@NodeChild(type = RubyNode.class, value = "queue"),
@NodeChild(type = RubyNode.class, value = "nonBlocking")
@@ -232,7 +232,7 @@ private Object doPoll(final BlockingQueue<Object> queue) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "empty?")
@CoreMethod(names = "empty?")
public abstract static class EmptyNode extends CoreMethodArrayArgumentsNode {

public EmptyNode(RubyContext context, SourceSection sourceSection) {
@@ -248,7 +248,7 @@ public boolean empty(DynamicObject self) {

}

@CoreMethod(unsafeNeedsAudit = true, names = { "size", "length" })
@CoreMethod(names = { "size", "length" })
public abstract static class SizeNode extends CoreMethodArrayArgumentsNode {

public SizeNode(RubyContext context, SourceSection sourceSection) {
@@ -263,7 +263,7 @@ public int size(DynamicObject self) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "clear")
@CoreMethod(names = "clear")
public abstract static class ClearNode extends CoreMethodArrayArgumentsNode {

public ClearNode(RubyContext context, SourceSection sourceSection) {
@@ -280,7 +280,7 @@ public DynamicObject clear(DynamicObject self) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "num_waiting")
@CoreMethod(names = "num_waiting")
public abstract static class NumWaitingNode extends CoreMethodArrayArgumentsNode {

public NumWaitingNode(RubyContext context, SourceSection sourceSection) {

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -854,7 +854,7 @@ private int countSlow(DynamicObject string, DynamicObject... otherStrings) {
}
}

@CoreMethod(unsafeNeedsAudit = true, names = "crypt", required = 1, taintFromSelf = true, taintFromParameter = 0)
@CoreMethod(names = "crypt", required = 1, taintFromSelf = true, taintFromParameter = 0)
@NodeChildren({
@NodeChild(type = RubyNode.class, value = "string"),
@NodeChild(type = RubyNode.class, value = "salt")
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ public static SymbolCodeRangeableWrapper getCodeRangeable(DynamicObject symbol)
return wrapper;
}

@CoreMethod(unsafeNeedsAudit = true, names = "all_symbols", onSingleton = true)
@CoreMethod(names = "all_symbols", onSingleton = true)
public abstract static class AllSymbolsNode extends CoreMethodArrayArgumentsNode {

public AllSymbolsNode(RubyContext context, SourceSection sourceSection) {
Original file line number Diff line number Diff line change
@@ -152,7 +152,7 @@ public String visitFrame(FrameInstance frameInstance) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "gc_count", onSingleton = true)
@CoreMethod(names = "gc_count", onSingleton = true)
public abstract static class GCCountNode extends CoreMethodArrayArgumentsNode {

public GCCountNode(RubyContext context, SourceSection sourceSection) {
@@ -167,7 +167,7 @@ public int gcCount() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "gc_time", onSingleton = true)
@CoreMethod(names = "gc_time", onSingleton = true)
public abstract static class GCTimeNode extends CoreMethodArrayArgumentsNode {

public GCTimeNode(RubyContext context, SourceSection sourceSection) {
@@ -182,7 +182,7 @@ public long gcTime() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "assert_constant", onSingleton = true, required = 1)
@CoreMethod(names = "assert_constant", onSingleton = true, required = 1)
public abstract static class AssertConstantNode extends CoreMethodArrayArgumentsNode {

public AssertConstantNode(RubyContext context, SourceSection sourceSection) {
@@ -196,7 +196,7 @@ public DynamicObject assertConstant(Object value) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "assert_not_compiled", onSingleton = true)
@CoreMethod(names = "assert_not_compiled", onSingleton = true)
public abstract static class AssertNotCompiledNode extends CoreMethodArrayArgumentsNode {

public AssertNotCompiledNode(RubyContext context, SourceSection sourceSection) {
@@ -211,7 +211,7 @@ public DynamicObject assertNotCompiled() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "java_class_of", onSingleton = true, required = 1)
@CoreMethod(names = "java_class_of", onSingleton = true, required = 1)
public abstract static class JavaClassOfNode extends CoreMethodArrayArgumentsNode {

public JavaClassOfNode(RubyContext context, SourceSection sourceSection) {
@@ -248,7 +248,7 @@ public DynamicObject dumpString(DynamicObject string) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "graal?", onSingleton = true)
@CoreMethod(names = "graal?", onSingleton = true)
public abstract static class GraalNode extends CoreMethodArrayArgumentsNode {

public GraalNode(RubyContext context, SourceSection sourceSection) {
@@ -263,7 +263,7 @@ public boolean graal() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "substrate?", onSingleton = true)
@CoreMethod(names = "substrate?", onSingleton = true)
public abstract static class SubstrateNode extends CoreMethodArrayArgumentsNode {

public SubstrateNode(RubyContext context, SourceSection sourceSection) {
@@ -277,7 +277,7 @@ public boolean substrate() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "graal_version", onSingleton = true)
@CoreMethod(names = "graal_version", onSingleton = true)
public abstract static class GraalVersionNode extends CoreMethodArrayArgumentsNode {

public GraalVersionNode(RubyContext context, SourceSection sourceSection) {
@@ -847,7 +847,7 @@ public boolean load(VirtualFrame frame, DynamicObject file, NotProvided wrap, @C
}
}

@CoreMethod(unsafeNeedsAudit = true, names = "run_jruby_root", onSingleton = true)
@CoreMethod(names = "run_jruby_root", onSingleton = true)
public abstract static class RunJRubyRootNode extends CoreMethodArrayArgumentsNode {

public RunJRubyRootNode(RubyContext context, SourceSection sourceSection) {
@@ -970,4 +970,18 @@ public DynamicObject originalLoadPath() {

}

@CoreMethod(names = "io_safe?", onSingleton = true)
public abstract static class IsIOSafeNode extends CoreMethodNode {

public IsIOSafeNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@Specialization
public boolean ioSafe() {
return getContext().getOptions().PLATFORM_SAFE_IO;
}

}

}
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@
@CoreClass(name = "Truffle::Interop")
public abstract class TruffleInteropNodes {

@CoreMethod(unsafeNeedsAudit = true, names = "executable?", isModuleFunction = true, needsSelf = false, required = 1)
@CoreMethod(names = "executable?", isModuleFunction = true, needsSelf = false, required = 1)
public abstract static class IsExecutableNode extends CoreMethodArrayArgumentsNode {

public IsExecutableNode(RubyContext context, SourceSection sourceSection) {
@@ -67,7 +67,7 @@ protected Node createIsExecutableNode() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "execute", isModuleFunction = true, needsSelf = false, required = 1, rest = true)
@CoreMethod(names = "execute", isModuleFunction = true, needsSelf = false, required = 1, rest = true)
public abstract static class ExecuteNode extends CoreMethodArrayArgumentsNode {

public ExecuteNode(RubyContext context, SourceSection sourceSection) {
@@ -119,7 +119,7 @@ protected int getCacheLimit() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "invoke", isModuleFunction = true, needsSelf = false, required = 2, rest = true)
@CoreMethod(names = "invoke", isModuleFunction = true, needsSelf = false, required = 2, rest = true)
public abstract static class InvokeNode extends CoreMethodArrayArgumentsNode {

public InvokeNode(RubyContext context, SourceSection sourceSection) {
@@ -195,7 +195,7 @@ protected int getCacheLimit() {

}

@CoreMethod(unsafeNeedsAudit = true, names = {"size?", "has_size_property?"}, isModuleFunction = true, needsSelf = false, required = 1)
@CoreMethod(names = {"size?", "has_size_property?"}, isModuleFunction = true, needsSelf = false, required = 1)
public abstract static class HasSizeNode extends CoreMethodArrayArgumentsNode {

public HasSizeNode(RubyContext context, SourceSection sourceSection) {
@@ -216,7 +216,7 @@ protected Node createHasSizeNode() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "size", isModuleFunction = true, needsSelf = false, required = 1)
@CoreMethod(names = "size", isModuleFunction = true, needsSelf = false, required = 1)
public abstract static class SizeNode extends CoreMethodArrayArgumentsNode {

public SizeNode(RubyContext context, SourceSection sourceSection) {
@@ -248,7 +248,7 @@ protected Node createGetSizeNode() {

}

@CoreMethod(unsafeNeedsAudit = true, names = {"boxed?", "boxed_primitive?"}, isModuleFunction = true, needsSelf = false, required = 1)
@CoreMethod(names = {"boxed?", "boxed_primitive?"}, isModuleFunction = true, needsSelf = false, required = 1)
public abstract static class BoxedNode extends CoreMethodArrayArgumentsNode {

public BoxedNode(RubyContext context, SourceSection sourceSection) {
@@ -315,7 +315,7 @@ public boolean isBoxed(Object receiver) {

}

@CoreMethod(unsafeNeedsAudit = true, names = {"unbox", "unbox_value"}, isModuleFunction = true, needsSelf = false, required = 1)
@CoreMethod(names = {"unbox", "unbox_value"}, isModuleFunction = true, needsSelf = false, required = 1)
public abstract static class UnboxNode extends CoreMethodArrayArgumentsNode {

public UnboxNode(RubyContext context, SourceSection sourceSection) {
@@ -385,7 +385,7 @@ protected Node createUnboxNode() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "null?", isModuleFunction = true, needsSelf = false, required = 1)
@CoreMethod(names = "null?", isModuleFunction = true, needsSelf = false, required = 1)
public abstract static class NullNode extends CoreMethodArrayArgumentsNode {

public NullNode(RubyContext context, SourceSection sourceSection) {
@@ -406,7 +406,7 @@ protected Node createIsNullNode() {

}

@CoreMethod(unsafeNeedsAudit = true, names = {"read", "read_property"}, isModuleFunction = true, needsSelf = false, required = 2)
@CoreMethod(names = {"read", "read_property"}, isModuleFunction = true, needsSelf = false, required = 2)
@ImportStatic(StringCachingGuards.class)
public abstract static class ReadNode extends CoreMethodArrayArgumentsNode {

@@ -502,7 +502,7 @@ protected int getCacheLimit() {

}

@CoreMethod(unsafeNeedsAudit = true, names = {"write", "write_property"}, isModuleFunction = true, needsSelf = false, required = 3)
@CoreMethod(names = {"write", "write_property"}, isModuleFunction = true, needsSelf = false, required = 3)
@ImportStatic(StringCachingGuards.class)
public abstract static class WriteNode extends CoreMethodArrayArgumentsNode {

@@ -602,7 +602,7 @@ protected int getCacheLimit() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "export", isModuleFunction = true, needsSelf = false, required = 2)
@CoreMethod(names = "export", isModuleFunction = true, needsSelf = false, required = 2)
public abstract static class ExportNode extends CoreMethodArrayArgumentsNode {

public ExportNode(RubyContext context, SourceSection sourceSection) {
@@ -633,7 +633,7 @@ public Object importObject(DynamicObject name) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "mime_type_supported?", isModuleFunction = true, needsSelf = false, required =1)
@CoreMethod(names = "mime_type_supported?", isModuleFunction = true, needsSelf = false, required =1)
public abstract static class MimeTypeSupportedNode extends CoreMethodArrayArgumentsNode {

public MimeTypeSupportedNode(RubyContext context, SourceSection sourceSection) {
@@ -648,7 +648,7 @@ public boolean isMimeTypeSupported(DynamicObject mimeType) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "eval", isModuleFunction = true, needsSelf = false, required = 2)
@CoreMethod(names = "eval", isModuleFunction = true, needsSelf = false, required = 2)
@ImportStatic(StringCachingGuards.class)
public abstract static class EvalNode extends CoreMethodArrayArgumentsNode {

Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
@CoreClass(name = "Truffle::Etc")
public abstract class EtcNodes {

@CoreMethod(unsafeNeedsAudit = true, names = "nprocessors", needsSelf = false)
@CoreMethod(names = "nprocessors", needsSelf = false)
public abstract static class NProcessors extends CoreMethodNode {

public NProcessors(RubyContext context, SourceSection sourceSection) {
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
@CoreClass(name = "Truffle::ObjSpace")
public abstract class ObjSpaceNodes {

@CoreMethod(unsafeNeedsAudit = true, names = "memsize_of", isModuleFunction = true, required = 1)
@CoreMethod(names = "memsize_of", isModuleFunction = true, required = 1)
public abstract static class MemsizeOfNode extends CoreMethodArrayArgumentsNode {

public MemsizeOfNode(RubyContext context, SourceSection sourceSection) {
@@ -86,7 +86,7 @@ public int memsizeOfObject(DynamicObject object) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "adjacent_objects", isModuleFunction = true, required = 1)
@CoreMethod(names = "adjacent_objects", isModuleFunction = true, required = 1)
public abstract static class AdjacentObjectsNode extends CoreMethodArrayArgumentsNode {

public AdjacentObjectsNode(RubyContext context, SourceSection sourceSection) {
@@ -102,7 +102,7 @@ public DynamicObject adjacentObjects(DynamicObject object) {

}

@CoreMethod(unsafeNeedsAudit = true, names = "root_objects", isModuleFunction = true)
@CoreMethod(names = "root_objects", isModuleFunction = true)
public abstract static class RootObjectsNode extends CoreMethodArrayArgumentsNode {

public RootObjectsNode(RubyContext context, SourceSection sourceSection) {
@@ -118,7 +118,7 @@ public DynamicObject rootObjects() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "trace_allocations_start", isModuleFunction = true)
@CoreMethod(names = "trace_allocations_start", isModuleFunction = true)
public abstract static class TraceAllocationsStartNode extends CoreMethodArrayArgumentsNode {

public TraceAllocationsStartNode(RubyContext context, SourceSection sourceSection) {
@@ -134,7 +134,7 @@ public DynamicObject traceAllocationsStart() {

}

@CoreMethod(unsafeNeedsAudit = true, names = "trace_allocations_stop", isModuleFunction = true)
@CoreMethod(names = "trace_allocations_stop", isModuleFunction = true)
public abstract static class TraceAllocationsStopNode extends CoreMethodArrayArgumentsNode {

public TraceAllocationsStopNode(RubyContext context, SourceSection sourceSection) {
9 changes: 8 additions & 1 deletion truffle/src/main/ruby/core/rubinius/api/shims/io.rb
Original file line number Diff line number Diff line change
@@ -46,7 +46,14 @@ def mode=(value)
# The +sync+ attribute will also be set.
#
def self.setup(io, fd, mode=nil, sync=false)
cur_mode = FFI::Platform::POSIX.fcntl(fd, F_GETFL, 0)
if Truffle::Primitive.io_safe?
cur_mode = FFI::Platform::POSIX.fcntl(fd, F_GETFL, 0)
else
cur_mode = RDONLY if fd == 0
cur_mode = WRONLY if fd == 1
cur_mode = WRONLY if fd == 2
end

Errno.handle if cur_mode < 0

cur_mode &= ACCMODE
26 changes: 14 additions & 12 deletions truffle/src/main/ruby/core/shims.rb
Original file line number Diff line number Diff line change
@@ -34,19 +34,21 @@ def external_encoding
end
end

if STDOUT.tty?
STDOUT.sync = true
else
Truffle::Primitive.at_exit true do
STDOUT.flush
if Truffle::Primitive.io_safe?
if STDOUT.tty?
STDOUT.sync = true
else
Truffle::Primitive.at_exit true do
STDOUT.flush
end
end
end

if STDERR.tty?
STDERR.sync = true
else
Truffle::Primitive.at_exit true do
STDERR.flush
if STDERR.tty?
STDERR.sync = true
else
Truffle::Primitive.at_exit true do
STDERR.flush
end
end
end

@@ -263,7 +265,7 @@ def self.load_arguments_from_array_kw_helper(array, kwrest_name, binding)
else
kwargs = {}
end

binding.local_variable_set(kwrest_name, kwargs) if kwrest_name
array
end