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: 491f793afbde
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 22695dd423d7
Choose a head ref
  • 2 commits
  • 19 files changed
  • 1 contributor

Commits on Nov 22, 2016

  1. Copy the full SHA
    a8293ab View commit details
  2. [Truffle] We don't need the source cache any more - let Truffle handl…

    …e caching if it wants to.
    chrisseaton committed Nov 22, 2016
    1
    Copy the full SHA
    22695dd View commit details
94 changes: 0 additions & 94 deletions spec/truffle/specs/truffle/attachments/attach_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/truffle/specs/truffle/debug/break_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/truffle/specs/truffle/debug/clear_spec.rb

This file was deleted.

37 changes: 0 additions & 37 deletions spec/truffle/specs/truffle/debug/java_class_of_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/truffle/specs/truffle/debug/simple_shell_spec.rb

This file was deleted.

6 changes: 0 additions & 6 deletions test/truffle/compiler/attachments-optimise.sh

This file was deleted.

39 changes: 0 additions & 39 deletions test/truffle/compiler/attachments-optimise/attachments-optimise.rb

This file was deleted.

14 changes: 0 additions & 14 deletions truffle/src/main/java/org/jruby/truffle/RubyContext.java
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@
import org.jruby.truffle.core.string.FrozenStrings;
import org.jruby.truffle.core.symbol.SymbolTable;
import org.jruby.truffle.core.thread.ThreadManager;
import org.jruby.truffle.extra.AttachmentsManager;
import org.jruby.truffle.interop.InteropManager;
import org.jruby.truffle.language.CallStackManager;
import org.jruby.truffle.language.LexicalScope;
@@ -44,7 +43,6 @@
import org.jruby.truffle.language.control.JavaException;
import org.jruby.truffle.language.loader.CodeLoader;
import org.jruby.truffle.language.loader.FeatureLoader;
import org.jruby.truffle.language.loader.SourceCache;
import org.jruby.truffle.language.loader.SourceLoader;
import org.jruby.truffle.language.methods.DeclarationContext;
import org.jruby.truffle.language.methods.InternalMethod;
@@ -88,7 +86,6 @@ public class RubyContext extends ExecutionContext {
private final ObjectSpaceManager objectSpaceManager = new ObjectSpaceManager(this);
private final AtExitManager atExitManager = new AtExitManager(this);
private final SourceLoader sourceLoader = new SourceLoader(this);
private final SourceCache sourceCache = new SourceCache(sourceLoader);
private final CallStackManager callStack = new CallStackManager(this);
private final CoreStrings coreStrings = new CoreStrings(this);
private final FrozenStrings frozenStrings = new FrozenStrings(this);
@@ -109,8 +106,6 @@ public class RubyContext extends ExecutionContext {

private final Object classVariableDefinitionLock = new Object();

private final AttachmentsManager attachmentsManager;

private String currentDirectory;

public RubyContext(RubyInstanceConfig instanceConfig, TruffleLanguage.Env env) {
@@ -177,7 +172,6 @@ public RubyContext(RubyInstanceConfig instanceConfig, TruffleLanguage.Env env) {
// Capture known builtin methods

final Instrumenter instrumenter = env.lookup(Instrumenter.class);
attachmentsManager = new AttachmentsManager(this, instrumenter);
traceManager = new TraceManager(this, instrumenter);
coreMethods = new CoreMethods(coreLibrary);

@@ -366,18 +360,10 @@ public static RubyContext getInstance() {
return RubyLanguage.INSTANCE.unprotectedFindContext(RubyLanguage.INSTANCE.unprotectedCreateFindContextNode());
}

public AttachmentsManager getAttachmentsManager() {
return attachmentsManager;
}

public SourceLoader getSourceLoader() {
return sourceLoader;
}

public SourceCache getSourceCache() {
return sourceCache;
}

public RopeTable getRopeTable() {
return ropeTable;
}
2 changes: 0 additions & 2 deletions truffle/src/main/java/org/jruby/truffle/RubyLanguage.java
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
import org.jruby.RubyInstanceConfig;
import org.jruby.runtime.Constants;
import org.jruby.truffle.core.kernel.TraceManager;
import org.jruby.truffle.extra.AttachmentsManager;
import org.jruby.truffle.interop.InstanceConfigWrapper;
import org.jruby.truffle.language.LazyRubyRootNode;
import org.jruby.truffle.language.RubyGuards;
@@ -34,7 +33,6 @@
mimeType = RubyLanguage.MIME_TYPE)
@ProvidedTags({
CoverageManager.LineTag.class,
AttachmentsManager.LineTag.class,
TraceManager.CallTag.class,
TraceManager.ClassTag.class,
TraceManager.LineTag.class,
12 changes: 3 additions & 9 deletions truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
Original file line number Diff line number Diff line change
@@ -101,7 +101,6 @@
import org.jruby.truffle.core.time.TimeNodesFactory;
import org.jruby.truffle.core.tracepoint.TracePointNodesFactory;
import org.jruby.truffle.debug.TruffleDebugNodesFactory;
import org.jruby.truffle.extra.AttachmentsInternalNodesFactory;
import org.jruby.truffle.extra.TruffleGraalNodesFactory;
import org.jruby.truffle.extra.TrufflePosixNodesFactory;
import org.jruby.truffle.extra.ffi.PointerPrimitiveNodesFactory;
@@ -598,8 +597,6 @@ public CoreLibrary(RubyContext context) {
defineModule(truffleModule, "GC");
defineModule(truffleModule, "Array");
defineModule(truffleModule, "String");
final DynamicObject attachments = defineModule(truffleModule, "Attachments");
defineModule(attachments, "Internal");
truffleBootModule = defineModule(truffleModule, "Boot");
defineModule(truffleModule, "Fixnum");
defineModule(truffleModule, "Safe");
@@ -707,7 +704,6 @@ public void addCoreMethods(PrimitiveManager primitiveManager) {
List<List<? extends NodeFactory<? extends RubyNode>>> factories = Arrays.asList(
ArrayNodesFactory.getFactories(),
AtomicReferenceNodesFactory.getFactories(),
AttachmentsInternalNodesFactory.getFactories(),
BasicObjectNodesFactory.getFactories(),
BCryptNodesFactory.getFactories(),
BigDecimalNodesFactory.getFactories(),
@@ -1005,7 +1001,7 @@ public void loadRubyCore() {
try {
for (int n = 0; n < coreFiles.length; n++) {
final RubyRootNode rootNode = context.getCodeLoader().parse(
context.getSourceCache().getSource(getCoreLoadPath() + coreFiles[n]),
context.getSourceLoader().load(getCoreLoadPath() + coreFiles[n]),
UTF8Encoding.INSTANCE, ParserContext.TOP_LEVEL, null, true, node);

final CodeLoader.DeferredCall deferredCall = context.getCodeLoader().prepareExecute(
@@ -1027,7 +1023,7 @@ public void loadRubyCore() {

coreFileFutures.add(ForkJoinPool.commonPool().submit(() ->
context.getCodeLoader().parse(
context.getSourceCache().getSource(getCoreLoadPath() + coreFiles[finalN]),
context.getSourceLoader().load(getCoreLoadPath() + coreFiles[finalN]),
UTF8Encoding.INSTANCE, ParserContext.TOP_LEVEL, null, true, node)
));
}
@@ -1079,7 +1075,7 @@ public void initializePostBoot() {

try {
for (String path : new String[]{"/post-boot/gems.rb", "/post-boot/shims.rb"}) {
final RubyRootNode rootNode = context.getCodeLoader().parse(context.getSourceCache().getSource(getCoreLoadPath() + path), UTF8Encoding.INSTANCE, ParserContext.TOP_LEVEL, null, true, node);
final RubyRootNode rootNode = context.getCodeLoader().parse(context.getSourceLoader().load(getCoreLoadPath() + path), UTF8Encoding.INSTANCE, ParserContext.TOP_LEVEL, null, true, node);
final CodeLoader.DeferredCall deferredCall = context.getCodeLoader().prepareExecute(ParserContext.TOP_LEVEL, DeclarationContext.TOP_LEVEL, rootNode, null, context.getCoreLibrary().getMainObject());
deferredCall.callWithoutCallNode();
}
@@ -1745,8 +1741,6 @@ public Object getTruffleKernelModule() {
"/core/math.rb",
"/core/method.rb",
"/core/unbound_method.rb",
"/core/truffle/attachments.rb",
"/core/truffle/debug.rb",
"/core/truffle/cext.rb",
"/core/truffle/interop.rb",
"/core/rbconfig.rb",
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ public boolean load(VirtualFrame frame, DynamicObject file, boolean wrap,
}

try {
final RubyRootNode rootNode = getContext().getCodeLoader().parse(getContext().getSourceCache().getSource(StringOperations.getString(file)), UTF8Encoding.INSTANCE, ParserContext.TOP_LEVEL, null, true, this);
final RubyRootNode rootNode = getContext().getCodeLoader().parse(getContext().getSourceLoader().load(StringOperations.getString(file)), UTF8Encoding.INSTANCE, ParserContext.TOP_LEVEL, null, true, this);
final CodeLoader.DeferredCall deferredCall = getContext().getCodeLoader().prepareExecute(ParserContext.TOP_LEVEL, DeclarationContext.TOP_LEVEL, rootNode, null, getContext().getCoreLibrary().getMainObject());
deferredCall.call(frame, callNode);
} catch (IOException e) {
Loading