Skip to content

Commit

Permalink
Showing 75 changed files with 822 additions and 138 deletions.
38 changes: 28 additions & 10 deletions truffle/src/main/java/org/jruby/truffle/RubyContext.java
Original file line number Diff line number Diff line change
@@ -9,17 +9,26 @@
*/
package org.jruby.truffle;

import com.oracle.truffle.api.*;
import com.oracle.truffle.api.CallTarget;
import com.oracle.truffle.api.CompilerAsserts;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.frame.*;
import com.oracle.truffle.api.CompilerOptions;
import com.oracle.truffle.api.ExecutionContext;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.TruffleLanguage;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.FrameDescriptor;
import com.oracle.truffle.api.frame.FrameInstance;
import com.oracle.truffle.api.frame.FrameInstance.FrameAccess;
import com.oracle.truffle.api.frame.MaterializedFrame;
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.object.DynamicObject;
import com.oracle.truffle.api.source.Source;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.tools.CoverageTracker;
import jnr.posix.POSIX;
import org.jcodings.Encoding;
import org.jcodings.specific.UTF8Encoding;
import org.jruby.Ruby;
@@ -31,7 +40,6 @@
import org.jruby.truffle.core.SetTopLevelBindingNode;
import org.jruby.truffle.core.array.ArrayOperations;
import org.jruby.truffle.core.binding.BindingNodes;
import org.jruby.truffle.platform.ClockGetTime;
import org.jruby.truffle.core.kernel.AtExitManager;
import org.jruby.truffle.core.kernel.TraceManager;
import org.jruby.truffle.core.objectspace.ObjectSpaceManager;
@@ -43,7 +51,14 @@
import org.jruby.truffle.core.thread.ThreadManager;
import org.jruby.truffle.extra.AttachmentsManager;
import org.jruby.truffle.instrument.RubyDefaultASTProber;
import org.jruby.truffle.language.*;
import org.jruby.truffle.language.LexicalScope;
import org.jruby.truffle.language.ModuleOperations;
import org.jruby.truffle.language.Options;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.RubyRootNode;
import org.jruby.truffle.language.SafepointManager;
import org.jruby.truffle.language.Warnings;
import org.jruby.truffle.language.arguments.RubyArguments;
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.language.control.SequenceNode;
@@ -56,23 +71,26 @@
import org.jruby.truffle.language.methods.InternalMethod;
import org.jruby.truffle.language.translator.TranslatorDriver;
import org.jruby.truffle.language.translator.TranslatorDriver.ParserContext;
import org.jruby.truffle.platform.*;
import org.jruby.truffle.platform.signal.SignalManager;
import org.jruby.truffle.platform.Sockets;
import org.jruby.truffle.platform.NativePlatform;
import org.jruby.truffle.platform.NativePlatformFactory;
import org.jruby.truffle.tools.InstrumentationServerManager;
import org.jruby.truffle.tools.callgraph.CallGraph;
import org.jruby.truffle.tools.callgraph.SimpleWriter;
import org.jruby.util.ByteList;
import org.jruby.util.IdUtil;

import java.io.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;

/**
* The global state of a running Ruby system.
Original file line number Diff line number Diff line change
@@ -90,7 +90,11 @@
import org.jruby.truffle.language.objects.SingletonClassNodeGen;
import org.jruby.truffle.platform.RubiniusTypes;
import org.jruby.truffle.platform.signal.SignalManager;
import org.jruby.truffle.stdlib.*;
import org.jruby.truffle.stdlib.BigDecimalNodesFactory;
import org.jruby.truffle.stdlib.DigestLayoutImpl;
import org.jruby.truffle.stdlib.DigestNodesFactory;
import org.jruby.truffle.stdlib.EtcNodesFactory;
import org.jruby.truffle.stdlib.ObjSpaceNodesFactory;
import org.jruby.truffle.stdlib.psych.PsychEmitterNodesFactory;
import org.jruby.truffle.stdlib.psych.PsychParserNodes;
import org.jruby.truffle.stdlib.psych.PsychParserNodesFactory;
Original file line number Diff line number Diff line change
@@ -21,8 +21,19 @@
import org.jruby.truffle.core.array.ArrayUtils;
import org.jruby.truffle.core.cast.TaintResultNode;
import org.jruby.truffle.core.numeric.FixnumLowerNodeGen;
import org.jruby.truffle.language.*;
import org.jruby.truffle.language.arguments.*;
import org.jruby.truffle.language.LexicalScope;
import org.jruby.truffle.language.ModuleOperations;
import org.jruby.truffle.language.NotProvided;
import org.jruby.truffle.language.RubyConstant;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.RubyRootNode;
import org.jruby.truffle.language.arguments.CheckArityNode;
import org.jruby.truffle.language.arguments.MissingArgumentBehaviour;
import org.jruby.truffle.language.arguments.ReadBlockNode;
import org.jruby.truffle.language.arguments.ReadCallerFrameNode;
import org.jruby.truffle.language.arguments.ReadPreArgumentNode;
import org.jruby.truffle.language.arguments.ReadRemainingArgumentsNode;
import org.jruby.truffle.language.control.SequenceNode;
import org.jruby.truffle.language.methods.Arity;
import org.jruby.truffle.language.methods.ExceptionTranslatingNode;
24 changes: 22 additions & 2 deletions truffle/src/main/java/org/jruby/truffle/core/Layouts.java
Original file line number Diff line number Diff line change
@@ -44,12 +44,32 @@
import org.jruby.truffle.core.queue.QueueLayoutImpl;
import org.jruby.truffle.core.queue.SizedQueueLayout;
import org.jruby.truffle.core.queue.SizedQueueLayoutImpl;
import org.jruby.truffle.core.range.*;
import org.jruby.truffle.core.range.IntegerFixnumRangeLayout;
import org.jruby.truffle.core.range.IntegerFixnumRangeLayoutImpl;
import org.jruby.truffle.core.range.LongFixnumRangeLayout;
import org.jruby.truffle.core.range.LongFixnumRangeLayoutImpl;
import org.jruby.truffle.core.range.ObjectRangeLayout;
import org.jruby.truffle.core.range.ObjectRangeLayoutImpl;
import org.jruby.truffle.core.regexp.MatchDataLayout;
import org.jruby.truffle.core.regexp.MatchDataLayoutImpl;
import org.jruby.truffle.core.regexp.RegexpLayout;
import org.jruby.truffle.core.regexp.RegexpLayoutImpl;
import org.jruby.truffle.core.rubinius.*;
import org.jruby.truffle.core.rubinius.AtomicReferenceLayout;
import org.jruby.truffle.core.rubinius.AtomicReferenceLayoutImpl;
import org.jruby.truffle.core.rubinius.ByteArrayLayout;
import org.jruby.truffle.core.rubinius.ByteArrayLayoutImpl;
import org.jruby.truffle.core.rubinius.DirLayout;
import org.jruby.truffle.core.rubinius.DirLayoutImpl;
import org.jruby.truffle.core.rubinius.IOBufferLayout;
import org.jruby.truffle.core.rubinius.IOBufferLayoutImpl;
import org.jruby.truffle.core.rubinius.IOLayout;
import org.jruby.truffle.core.rubinius.IOLayoutImpl;
import org.jruby.truffle.core.rubinius.PointerLayout;
import org.jruby.truffle.core.rubinius.PointerLayoutImpl;
import org.jruby.truffle.core.rubinius.RandomizerLayout;
import org.jruby.truffle.core.rubinius.RandomizerLayoutImpl;
import org.jruby.truffle.core.rubinius.WeakRefLayout;
import org.jruby.truffle.core.rubinius.WeakRefLayoutImpl;
import org.jruby.truffle.core.string.StringLayout;
import org.jruby.truffle.core.string.StringLayoutImpl;
import org.jruby.truffle.core.symbol.SymbolLayout;
Original file line number Diff line number Diff line change
@@ -19,11 +19,11 @@
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.cast.DefaultValueNodeGen;
import org.jruby.truffle.platform.ClockGetTime;
import org.jruby.truffle.core.ffi.TimeSpec;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.platform.ClockGetTime;
import org.jruby.truffle.platform.signal.Signal;

@CoreClass(name = "Process")
Original file line number Diff line number Diff line change
@@ -9,7 +9,11 @@
*/
package org.jruby.truffle.core.array;

import com.oracle.truffle.api.dsl.*;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.NodeChildren;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.ConditionProfile;
Original file line number Diff line number Diff line change
@@ -9,7 +9,11 @@
*/
package org.jruby.truffle.core.array;

import com.oracle.truffle.api.dsl.*;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.NodeChildren;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.ConditionProfile;
47 changes: 40 additions & 7 deletions truffle/src/main/java/org/jruby/truffle/core/array/ArrayNodes.java
Original file line number Diff line number Diff line change
@@ -13,7 +13,12 @@
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.*;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.CreateCast;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.NodeChildren;
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.VirtualFrame;
@@ -30,20 +35,40 @@
import org.jcodings.specific.USASCIIEncoding;
import org.jcodings.specific.UTF8Encoding;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.*;
import org.jruby.truffle.core.CoreClass;
import org.jruby.truffle.core.CoreMethod;
import org.jruby.truffle.core.CoreMethodArrayArgumentsNode;
import org.jruby.truffle.core.CoreMethodNode;
import org.jruby.truffle.core.CoreSourceSection;
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.core.YieldingCoreMethodNode;
import org.jruby.truffle.core.coerce.ToAryNodeGen;
import org.jruby.truffle.core.coerce.ToIntNode;
import org.jruby.truffle.core.coerce.ToIntNodeGen;
import org.jruby.truffle.core.format.parser.PackCompiler;
import org.jruby.truffle.core.format.runtime.PackResult;
import org.jruby.truffle.core.format.runtime.exceptions.*;
import org.jruby.truffle.core.format.runtime.exceptions.CantCompressNegativeException;
import org.jruby.truffle.core.format.runtime.exceptions.CantConvertException;
import org.jruby.truffle.core.format.runtime.exceptions.NoImplicitConversionException;
import org.jruby.truffle.core.format.runtime.exceptions.OutsideOfStringException;
import org.jruby.truffle.core.format.runtime.exceptions.PackException;
import org.jruby.truffle.core.format.runtime.exceptions.RangeException;
import org.jruby.truffle.core.format.runtime.exceptions.TooFewArgumentsException;
import org.jruby.truffle.core.kernel.KernelNodes;
import org.jruby.truffle.core.kernel.KernelNodesFactory;
import org.jruby.truffle.core.numeric.FixnumLowerNodeGen;
import org.jruby.truffle.core.proc.ProcNodes;
import org.jruby.truffle.core.rope.*;
import org.jruby.truffle.core.rope.CodeRange;
import org.jruby.truffle.core.rope.Rope;
import org.jruby.truffle.core.rope.RopeNodes;
import org.jruby.truffle.core.rope.RopeNodesFactory;
import org.jruby.truffle.core.rope.ValidLeafRope;
import org.jruby.truffle.core.string.StringOperations;
import org.jruby.truffle.language.*;
import org.jruby.truffle.language.NotProvided;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.RubyRootNode;
import org.jruby.truffle.language.StringCachingGuards;
import org.jruby.truffle.language.arguments.MissingArgumentBehaviour;
import org.jruby.truffle.language.arguments.ReadPreArgumentNode;
import org.jruby.truffle.language.arguments.RubyArguments;
@@ -56,13 +81,21 @@
import org.jruby.truffle.language.methods.DeclarationContext;
import org.jruby.truffle.language.methods.InternalMethod;
import org.jruby.truffle.language.methods.SharedMethodInfo;
import org.jruby.truffle.language.objects.*;
import org.jruby.truffle.language.objects.AllocateObjectNode;
import org.jruby.truffle.language.objects.AllocateObjectNodeGen;
import org.jruby.truffle.language.objects.IsFrozenNode;
import org.jruby.truffle.language.objects.IsFrozenNodeGen;
import org.jruby.truffle.language.objects.TaintNode;
import org.jruby.truffle.language.objects.TaintNodeGen;
import org.jruby.truffle.language.yield.YieldDispatchHeadNode;
import org.jruby.util.Memo;

import java.util.Arrays;

import static org.jruby.truffle.core.array.ArrayHelpers.*;
import static org.jruby.truffle.core.array.ArrayHelpers.createArray;
import static org.jruby.truffle.core.array.ArrayHelpers.getSize;
import static org.jruby.truffle.core.array.ArrayHelpers.getStore;
import static org.jruby.truffle.core.array.ArrayHelpers.setStoreAndSize;

@CoreClass(name = "Array")
public abstract class ArrayNodes {
Original file line number Diff line number Diff line change
@@ -20,7 +20,12 @@
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.runtime.Visibility;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.*;
import org.jruby.truffle.core.BinaryCoreMethodNode;
import org.jruby.truffle.core.CoreClass;
import org.jruby.truffle.core.CoreMethod;
import org.jruby.truffle.core.CoreMethodArrayArgumentsNode;
import org.jruby.truffle.core.RubiniusOnly;
import org.jruby.truffle.core.UnaryCoreMethodNode;
import org.jruby.truffle.core.array.ArrayHelpers;
import org.jruby.truffle.core.cast.BooleanCastNodeGen;
import org.jruby.truffle.core.string.StringOperations;
Original file line number Diff line number Diff line change
@@ -21,7 +21,11 @@
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.*;
import org.jruby.truffle.core.CoreClass;
import org.jruby.truffle.core.CoreMethod;
import org.jruby.truffle.core.CoreMethodArrayArgumentsNode;
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.core.UnaryCoreMethodNode;
import org.jruby.truffle.core.array.ArrayHelpers;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.ThreadLocalObject;
Original file line number Diff line number Diff line change
@@ -10,7 +10,11 @@
package org.jruby.truffle.core.cast;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.*;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Fallback;
import com.oracle.truffle.api.dsl.ImportStatic;
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.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;
Original file line number Diff line number Diff line change
@@ -25,7 +25,11 @@
import org.jruby.runtime.Visibility;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.*;
import org.jruby.truffle.core.CoreClass;
import org.jruby.truffle.core.CoreMethod;
import org.jruby.truffle.core.CoreMethodArrayArgumentsNode;
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.core.RubiniusOnly;
import org.jruby.truffle.language.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.language.dispatch.DispatchHeadNodeFactory;
import org.jruby.util.ByteList;
Original file line number Diff line number Diff line change
@@ -23,7 +23,12 @@
import org.jcodings.util.CaseInsensitiveBytesHash;
import org.jcodings.util.Hash;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.*;
import org.jruby.truffle.core.CoreClass;
import org.jruby.truffle.core.CoreMethod;
import org.jruby.truffle.core.CoreMethodArrayArgumentsNode;
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.core.RubiniusOnly;
import org.jruby.truffle.core.UnaryCoreMethodNode;
import org.jruby.truffle.core.coerce.ToStrNode;
import org.jruby.truffle.core.coerce.ToStrNodeGen;
import org.jruby.truffle.core.rope.CodeRange;
Original file line number Diff line number Diff line change
@@ -15,7 +15,11 @@
import com.oracle.truffle.api.source.SourceSection;
import org.jcodings.specific.UTF8Encoding;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.*;
import org.jruby.truffle.core.CoreClass;
import org.jruby.truffle.core.CoreMethod;
import org.jruby.truffle.core.CoreMethodArrayArgumentsNode;
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.core.RubiniusOnly;
import org.jruby.truffle.core.string.StringOperations;
import org.jruby.truffle.language.NotProvided;
import org.jruby.truffle.language.RubyCallStack;
Original file line number Diff line number Diff line change
@@ -18,7 +18,12 @@
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.*;
import org.jruby.truffle.core.CoreClass;
import org.jruby.truffle.core.CoreMethod;
import org.jruby.truffle.core.CoreMethodArrayArgumentsNode;
import org.jruby.truffle.core.CoreMethodNode;
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.core.UnaryCoreMethodNode;
import org.jruby.truffle.core.cast.SingleValueCastNode;
import org.jruby.truffle.core.cast.SingleValueCastNodeGen;
import org.jruby.truffle.core.proc.ProcNodes;
Loading

0 comments on commit 87e5cfd

Please sign in to comment.