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

Commits on Jun 29, 2016

  1. Copy the full SHA
    8854a02 View commit details
  2. Copy the full SHA
    676e8aa View commit details
  3. Copy the full SHA
    9b1a5a0 View commit details

Commits on Jun 30, 2016

  1. Copy the full SHA
    97aee10 View commit details
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -433,7 +433,7 @@ private boolean checkStreamSyntax(Ruby runtime, InputStream in, String filename)
} catch (RaiseException re) {
if (re.getException().getMetaClass().getBaseName().equals("SyntaxError")) {
context.setErrorInfo($ex);
config.getError().println("SyntaxError in " + re.getException().message(runtime.getCurrentContext()));
config.getError().println("SyntaxError in " + re.getException().message(context));
return false;
}
throw re;
29 changes: 15 additions & 14 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -1205,10 +1205,10 @@ private void init() {
threadService.initMainThread();

// Get the main threadcontext (gets constructed for us)
ThreadContext tc = getCurrentContext();
final ThreadContext context = getCurrentContext();

// Construct the top-level execution frame and scope for the main thread
tc.prepareTopLevel(objectClass, topSelf);
context.prepareTopLevel(objectClass, topSelf);

// Initialize all the core classes
bootstrap();
@@ -1223,10 +1223,10 @@ private void init() {

// Initialize the "dummy" class used as a marker
dummyClass = new RubyClass(this, classClass);
dummyClass.freeze(tc);
dummyClass.freeze(context);

// Create global constants and variables
RubyGlobal.createGlobals(tc, this);
RubyGlobal.createGlobals(context, this);

// Prepare LoadService and load path
getLoadService().init(config.getLoadPaths());
@@ -1270,7 +1270,7 @@ private void init() {

if (is1_9()) {
// everything booted, so SizedQueue should be available; set up root fiber
ThreadFiber.initRootFiber(tc);
ThreadFiber.initRootFiber(context);
}

if(config.isProfiling()) {
@@ -1292,7 +1292,7 @@ private void init() {
// Require in all libraries specified on command line
for (String scriptName : config.getRequiredLibraries()) {
if (is1_9) {
topSelf.callMethod(getCurrentContext(), "require", RubyString.newString(this, scriptName));
topSelf.callMethod(context, "require", RubyString.newString(this, scriptName));
} else {
loadService.require(scriptName);
}
@@ -4110,19 +4110,20 @@ public ExecRecursiveParams() {}

private void recursivePush(IRubyObject list, IRubyObject obj, IRubyObject paired_obj) {
IRubyObject pair_list;
if(paired_obj == null) {
((RubyHash)list).op_aset(getCurrentContext(), obj, getTrue());
} else if((pair_list = ((RubyHash)list).fastARef(obj)) == null) {
((RubyHash)list).op_aset(getCurrentContext(), obj, paired_obj);
final ThreadContext context = getCurrentContext();
if (paired_obj == null) {
((RubyHash) list).op_aset(context, obj, getTrue());
} else if ((pair_list = ((RubyHash)list).fastARef(obj)) == null) {
((RubyHash) list).op_aset(context, obj, paired_obj);
} else {
if(!(pair_list instanceof RubyHash)) {
if (!(pair_list instanceof RubyHash)) {
IRubyObject other_paired_obj = pair_list;
pair_list = RubyHash.newHash(this);
pair_list.setUntrusted(true);
((RubyHash)pair_list).op_aset(getCurrentContext(), other_paired_obj, getTrue());
((RubyHash)list).op_aset(getCurrentContext(), obj, pair_list);
((RubyHash)pair_list).op_aset(context, other_paired_obj, getTrue());
((RubyHash)list).op_aset(context, obj, pair_list);
}
((RubyHash)pair_list).op_aset(getCurrentContext(), paired_obj, getTrue());
((RubyHash)pair_list).op_aset(context, paired_obj, getTrue());
}
}

14 changes: 8 additions & 6 deletions core/src/main/java/org/jruby/RubyClassPathVariable.java
Original file line number Diff line number Diff line change
@@ -107,23 +107,25 @@ public IRubyObject size() {

@JRubyMethod
public IRubyObject each(Block block) {
URL[] urls = getRuntime().getJRubyClassLoader().getURLs();
ThreadContext ctx = getRuntime().getCurrentContext();
final ThreadContext context = getRuntime().getCurrentContext();
URL[] urls = context.runtime.getJRubyClassLoader().getURLs();
for(int i=0,j=urls.length;i<j;i++) {
block.yield(ctx, getRuntime().newString(urls[i].toString()));
block.yield(context, context.runtime.newString(urls[i].toString()));
}
return getRuntime().getNil();
return context.nil;
}

@Override
@JRubyMethod
public IRubyObject to_s() {
return callMethod(getRuntime().getCurrentContext(), "to_a").callMethod(getRuntime().getCurrentContext(), "to_s");
final ThreadContext context = getRuntime().getCurrentContext();
return callMethod(context, "to_a").callMethod(context, "to_s");
}

@Override
@JRubyMethod(name = "inspect")
public IRubyObject inspect() {
return callMethod(getRuntime().getCurrentContext(), "to_a").callMethod(getRuntime().getCurrentContext(), "inspect");
final ThreadContext context = getRuntime().getCurrentContext();
return callMethod(context, "to_a").callMethod(context, "inspect");
}
}// RubyClassPathVariable
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyKernel.java
Original file line number Diff line number Diff line change
@@ -1311,11 +1311,11 @@ private static IRubyObject rbThrowInternal(ThreadContext context, IRubyObject ta
message = "uncaught throw `" + tag + "'";
}
RubyThread currentThread = context.getThread();

if (currentThread == runtime.getThreadService().getMainThread()) {
throw uncaught.uncaughtThrow(runtime, message, tag);
} else {
message += " in thread 0x" + Integer.toHexString(RubyInteger.fix2int(currentThread.id()));
message += " in thread 0x" + Integer.toHexString(System.identityHashCode(currentThread.getNativeThread()));
if (runtime.is1_9()) {
throw runtime.newArgumentError(message);
} else {
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/util/cli/OutputStrings.java
Original file line number Diff line number Diff line change
@@ -144,6 +144,6 @@ public static String getVersionString(CompatVersion compatVersion) {
}

public static String getCopyrightString() {
return "JRuby - Copyright (C) 2001-2013 The JRuby Community (and contribs)";
return "JRuby - Copyright (C) 2001-2016 The JRuby Community (and contribs)";
}
}