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

Commits on May 30, 2016

  1. [Truffle] Ignore wrapper nodes when checking if the current node is a…

    … child of a RootNode.
    eregon committed May 30, 2016
    Copy the full SHA
    35b21d5 View commit details
  2. Copy the full SHA
    2e554c9 View commit details
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -236,6 +236,7 @@ public class Options {
public static final Option<Boolean> TRUFFLE_PLATFORM_USE_JAVA = bool(TRUFFLE, "truffle.platform.use_java", false, "Use a pure-Java platform, so no native POSIX.");

public static final Option<Boolean> TRUFFLE_COVERAGE_GLOBAL = bool(TRUFFLE, "truffle.coverage.global", false, "Run coverage for all code and print results on exit.");
public static final Option<Boolean> TRUFFLE_PROFILER = bool(TRUFFLE, "truffle.profiler", false, "Run the Truffle profiler.");

public static final Option<String> TRUFFLE_CORE_LOAD_PATH = string(TRUFFLE, "truffle.core.load_path", "truffle:/jruby-truffle", "Location to load the Truffle core library from.");

8 changes: 6 additions & 2 deletions truffle/src/main/java/org/jruby/truffle/JRubyTruffleImpl.java
Original file line number Diff line number Diff line change
@@ -11,15 +11,15 @@

import com.oracle.truffle.api.source.Source;
import com.oracle.truffle.api.vm.PolyglotEngine;
import com.oracle.truffle.tools.TruffleProfiler;
import java.io.IOException;
import org.jruby.JRubyTruffleInterface;
import org.jruby.Ruby;
import org.jruby.truffle.interop.JRubyContextWrapper;
import org.jruby.truffle.language.control.ExitException;
import org.jruby.truffle.platform.graal.Graal;
import org.jruby.util.cli.Options;

import java.io.IOException;

public class JRubyTruffleImpl implements JRubyTruffleInterface {

private final PolyglotEngine engine;
@@ -32,6 +32,10 @@ public JRubyTruffleImpl(Ruby runtime) {
.globalSymbol(JRubyTruffleInterface.RUNTIME_SYMBOL, new JRubyContextWrapper(runtime))
.build();

if (Options.TRUFFLE_PROFILER.load()) {
engine.getInstruments().get(TruffleProfiler.ID).setEnabled(true);
}

try {
context = (RubyContext) engine.eval(Source.fromText("Truffle::Boot.context", "context")
.withMimeType(RubyLanguage.MIME_TYPE)).get();
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.TypeSystemReference;
import com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode;
import com.oracle.truffle.api.instrumentation.StandardTags;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObject;
@@ -36,7 +37,6 @@
import org.jruby.truffle.platform.posix.TrufflePosix;
import org.jruby.truffle.stdlib.CoverageManager;
import org.jruby.util.ByteList;

import java.math.BigInteger;

@TypeSystemReference(RubyTypes.class)
@@ -195,7 +195,11 @@ private boolean isCall() {
}

private boolean isRoot() {
return getParent() instanceof RubyRootNode;
Node parent = getParent();
while (parent instanceof WrapperNode) {
parent = parent.getParent();
}
return parent instanceof RubyRootNode;
}

@Override