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

Commits on Sep 23, 2014

  1. Copy the full SHA
    f0b7c05 View commit details
  2. [Truffle] Move an enum used from Options to TruffleBridge so we can s…

    …till remove org.jruby.truffle if we want to.
    chrisseaton committed Sep 23, 2014
    Copy the full SHA
    674b336 View commit details
8 changes: 8 additions & 0 deletions core/src/main/java/org/jruby/TruffleBridge.java
Original file line number Diff line number Diff line change
@@ -18,6 +18,13 @@
import org.jruby.truffle.translator.TranslatorDriver;

public interface TruffleBridge {

enum BacktraceFormatter {
MRI,
DEBUG,
IMPL_DEBUG
}

void init();

TruffleMethod truffelize(DynamicMethod originalMethod, ArgsNode argsNode, Node bodyNode);
@@ -29,4 +36,5 @@ public interface TruffleBridge {
Object toTruffle(IRubyObject object);

void shutdown();

}
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
*/
package org.jruby.truffle.runtime.backtrace;

import org.jruby.TruffleBridge;
import org.jruby.util.cli.Options;

import java.util.Arrays;
@@ -17,12 +18,6 @@

public class Backtrace {

public static enum Formatter {
MRI,
DEBUG,
IMPL_DEBUG
}

public static final BacktraceFormatter DISPLAY_FORMATTER = getFormatter(Options.TRUFFLE_BACKTRACE_DISPLAY_FORMAT.load());
public static final BacktraceFormatter EXCEPTION_FORMATTER = getFormatter(Options.TRUFFLE_BACKTRACE_EXCEPTION_FORMAT.load());
public static final BacktraceFormatter DEBUG_FORMATTER = getFormatter(Options.TRUFFLE_BACKTRACE_DEBUG_FORMAT.load());
@@ -38,7 +33,7 @@ public List<Activation> getActivations() {
return Collections.unmodifiableList(Arrays.asList(activations));
}

private static BacktraceFormatter getFormatter(Formatter formatter) {
private static BacktraceFormatter getFormatter(TruffleBridge.BacktraceFormatter formatter) {
switch (formatter) {
case MRI:
return new MRIBacktraceFormatter();
10 changes: 5 additions & 5 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@
import java.util.List;

import com.headius.options.Option;
import org.jruby.TruffleBridge;
import org.jruby.runtime.Constants;
import org.jruby.truffle.runtime.backtrace.Backtrace;
import org.jruby.util.KCode;
import org.jruby.util.SafePropertyAccessor;
import static org.jruby.util.cli.Category.*;
@@ -142,10 +142,10 @@ public class Options {
public static final Option<Integer> TRUFFLE_HASHES_SMALL = integer(TRUFFLE, "truffle.hashes.small", 3, "Maximum size of a Hash to consider small for optimisations.");
public static final Option<Boolean> TRUFFLE_COMPILER_PASS_LOOPS_THROUGH_BLOCKS = bool(TRUFFLE, "truffle.compiler.pass_loops_through_blocks", false, "Pass loop counts through blocks to the method that is calling the block.");
public static final Option<Boolean> TRUFFLE_ALLOW_SIMPLE_SOURCE_SECTIONS = bool(TRUFFLE, "truffle.allow_simple_source_sections", false, "Allow simple source sections.");
public static final Option<Backtrace.Formatter> TRUFFLE_BACKTRACE_DISPLAY_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.display_format", Backtrace.Formatter.class, Backtrace.Formatter.MRI, "How to format backtraces displayed to the user.");
public static final Option<Backtrace.Formatter> TRUFFLE_BACKTRACE_DEBUG_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.debug_format", Backtrace.Formatter.class, Backtrace.Formatter.DEBUG, "How to format backtraces displayed using TruffleDebug.dump_call_stack.");
public static final Option<Backtrace.Formatter> TRUFFLE_BACKTRACE_EXCEPTION_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.exception_format", Backtrace.Formatter.class, Backtrace.Formatter.MRI, "How to format backtraces in Exception objects.");
public static final Option<Backtrace.Formatter> TRUFFLE_BACKTRACE_PANIC_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.panic_format", Backtrace.Formatter.class, Backtrace.Formatter.IMPL_DEBUG, "How to format backtraces in panics.");
public static final Option<TruffleBridge.BacktraceFormatter> TRUFFLE_BACKTRACE_DISPLAY_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.display_format", TruffleBridge.BacktraceFormatter.class, TruffleBridge.BacktraceFormatter.MRI, "How to format backtraces displayed to the user.");
public static final Option<TruffleBridge.BacktraceFormatter> TRUFFLE_BACKTRACE_DEBUG_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.debug_format", TruffleBridge.BacktraceFormatter.class, TruffleBridge.BacktraceFormatter.DEBUG, "How to format backtraces displayed using TruffleDebug.dump_call_stack.");
public static final Option<TruffleBridge.BacktraceFormatter> TRUFFLE_BACKTRACE_EXCEPTION_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.exception_format", TruffleBridge.BacktraceFormatter.class, TruffleBridge.BacktraceFormatter.MRI, "How to format backtraces in Exception objects.");
public static final Option<TruffleBridge.BacktraceFormatter> TRUFFLE_BACKTRACE_PANIC_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.panic_format", TruffleBridge.BacktraceFormatter.class, TruffleBridge.BacktraceFormatter.IMPL_DEBUG, "How to format backtraces in panics.");
public static final Option<Integer> TRUFFLE_BACKTRACE_MAX_VALUE_LENGTH = integer(TRUFFLE, "truffle.backtrace.max_value_length", 20, "Max length for values when displayed in a backtrace.");
public static final Option<Boolean> TRUFFLE_BACKTRACE_GENERATE = bool(TRUFFLE, "truffle.backtrace.generate", true, "Generate backtraces on exceptions.");
public static final Option<Integer> TRUFFLE_DISPATCH_POLYMORPHIC_MAX = integer(TRUFFLE, "truffle.dispatch.polymorphic.max", 8, "Maximum size of a polymorphic call site cache.");
4 changes: 3 additions & 1 deletion tool/remove-bundled-truffle.sh
Original file line number Diff line number Diff line change
@@ -4,11 +4,13 @@
# want to package com.oracle.truffle in complete. This script removes those
# packages from a build of complete.

# You will want to run mvn -Pcomplete first.

# Takes no arguments. Modifies a copy of
# maven/jruby-complete/target/jruby-complete-9000.dev.jar to create
# maven/jruby-complete/target/jruby-complete-no-truffle-9000.dev.jar.

# Chris Seaton, 5 Aug 14

cp maven/jruby-complete/target/jruby-complete-9000.dev.jar maven/jruby-complete/target/jruby-complete-no-truffle-9000.dev.jar
zip -d maven/jruby-complete/target/jruby-complete-no-truffle-9000.dev.jar com/oracle/truffle/*
zip -d maven/jruby-complete/target/jruby-complete-no-truffle-9000.dev.jar com/oracle/nfi/* com/oracle/truffle/*