Skip to content

Commit

Permalink
Showing 1,774 changed files with 43,823 additions and 24,520 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -28,18 +28,20 @@ env:
- JT='test specs :core'
- JT='test specs :library'
- JT='test specs :truffle'
- JT='test mri'
- JT='test integration'
- JTR='ci --batch ../lib/ruby/truffle/jruby+truffle/gem_ci/travis.txt'

matrix:
include:
- env: COMMAND=test/check_versions.sh
jdk: oraclejdk8
- env: JT=check_ambiguous_arguments
jdk: oraclejdk8
#- env: JT=check_ambiguous_arguments
# jdk: oraclejdk8
allow_failures:
- env: PHASE='-Prake -Dtask=test:mri:fullint'
- env: JT=check_ambiguous_arguments
jdk: oraclejdk8
- env: JT='test mri'
- env: JTR='ci --batch ../lib/ruby/truffle/jruby+truffle/gem_ci/travis.txt'
# NOTE: build seems to never start (waited for any to finish for more than a day) - probably a travis-ci bug
#- env: PHASE='-Pmain'
# sudo: required
@@ -54,6 +56,7 @@ branches:
- truffle-head
- /^test-.*$/
- /^ha-feature/
- ruby-2.3

script: tool/travis_runner.sh
install: travis_retry ./mvnw -Pbootstrap clean install -B -Dinvoker.skip -Dmaven.test.skip
3 changes: 1 addition & 2 deletions core/pom.rb
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@
jar 'com.github.jnr:jffi:${jffi.version}'
jar 'com.github.jnr:jffi:${jffi.version}:native'

jar 'org.jruby.joni:joni:2.1.9'
jar 'org.jruby.joni:joni:2.1.10-SNAPSHOT'
jar 'org.jruby.extras:bytelist:1.0.13'
jar 'org.jruby.jcodings:jcodings:1.0.17'
jar 'org.jruby:dirgra:0.3'
@@ -218,7 +218,6 @@
'forkCount' => '1',
'reuseForks' => 'false',
'systemProperties' => {
'jruby.compat.version' => '1.9',
'jruby.home' => '${basedir}/..'
},
'argLine' => '-Xmx${jruby.test.memory} -XX:MaxPermSize=${jruby.test.memory.permgen} -Dfile.encoding=UTF-8 -Djava.awt.headless=true',
11 changes: 5 additions & 6 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ DO NOT MODIFIY - GENERATED CODE
<artifactId>jruby-core</artifactId>
<name>JRuby Core</name>
<properties>
<version.ruby>2.2.3</version.ruby>
<version.ruby>2.3.0</version.ruby>
<prawn.dir>${test.dir}/prawn</prawn.dir>
<spec.tags.dir>${spec.dir}/tags</spec.tags.dir>
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
@@ -28,7 +28,7 @@ DO NOT MODIFIY - GENERATED CODE
<jruby.test.memory.permgen>2G</jruby.test.memory.permgen>
<installer.gems>${jruby.win32ole.gem}</installer.gems>
<prawn.git.repo>git://github.com/sandal/prawn.git</prawn.git.repo>
<version.ruby.minor>3</version.ruby.minor>
<version.ruby.minor>0</version.ruby.minor>
<tzdata.version>2013d</tzdata.version>
<install4j.executable>/Applications/install4j 4/bin/install4jc</install4j.executable>
<jay.bin>jay</jay.bin>
@@ -40,15 +40,15 @@ DO NOT MODIFIY - GENERATED CODE
<rubyspec.1.8.dir>${rubyspec.dir}/1.8</rubyspec.1.8.dir>
<jruby.launch.memory>1024M</jruby.launch.memory>
<jruby.compile.memory>2G</jruby.compile.memory>
<version.ruby.major>2.2</version.ruby.major>
<version.ruby.major>2.3</version.ruby.major>
<unsafe.version>8.0</unsafe.version>
<release.dir>release</release.dir>
<lib.dir>lib</lib.dir>
<rails.dir>${test.dir}/rails</rails.dir>
<parser.dir>core/src/main/java/org/jruby/parser</parser.dir>
<jruby.basedir>${basedir}/..</jruby.basedir>
<rubyspec.dir>${spec.dir}/ruby</rubyspec.dir>
<version.ruby.revision>51636</version.ruby.revision>
<version.ruby.revision>52539</version.ruby.revision>
<jruby.test.memory>3G</jruby.test.memory>
<mspec.dir>${spec.dir}/mspec</mspec.dir>
<build.date>${maven.build.timestamp}</build.date>
@@ -174,7 +174,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>org.jruby.joni</groupId>
<artifactId>joni</artifactId>
<version>2.1.9</version>
<version>2.1.10-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jruby.extras</groupId>
@@ -563,7 +563,6 @@ DO NOT MODIFIY - GENERATED CODE
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<systemProperties>
<jruby.compat.version>1.9</jruby.compat.version>
<jruby.home>${basedir}/..</jruby.home>
</systemProperties>
<argLine>-Xmx${jruby.test.memory} -XX:MaxPermSize=${jruby.test.memory.permgen} -Dfile.encoding=UTF-8 -Djava.awt.headless=true</argLine>
17 changes: 7 additions & 10 deletions core/src/main/java/org/jruby/NativeException.java
Original file line number Diff line number Diff line change
@@ -42,18 +42,15 @@ public class NativeException extends RubyException {

private final Throwable cause;
public static final String CLASS_NAME = "NativeException";
private final Ruby runtime;

public NativeException(Ruby runtime, RubyClass rubyClass, Throwable cause) {
super(runtime, rubyClass);
this.runtime = runtime;
this.cause = cause;
this.message = runtime.newString(cause.getClass().getName() + ": " + searchStackMessage(cause));
}

private NativeException(Ruby runtime, RubyClass rubyClass) {
super(runtime, rubyClass);
this.runtime = runtime;
this.cause = new Throwable();
this.message = runtime.newString();
}
@@ -84,6 +81,7 @@ public IRubyObject backtrace() {
if (rubyTrace.isNil()) {
return rubyTrace;
}
final Ruby runtime = getRuntime();
RubyArray array = (RubyArray) rubyTrace.dup();
StackTraceElement[] stackTrace = cause.getStackTrace();
for (int i = stackTrace.length - 1; i >= 0; i--) {
@@ -97,12 +95,12 @@ public IRubyObject backtrace() {
final String packageName = index == -1 ? "" : className.substring(0, index) + '/';
line = packageName.replace('.', '/') + element.getFileName() + ':' + element.getLineNumber() + ":in `" + element.getMethodName() + '\'';
}
RubyString string = runtime.newString(line);
array.unshift(string);
array.unshift(runtime.newString(line));
}
return array;
}

@Deprecated // not used
public void trimStackTrace(Member target) {
Throwable t = new Throwable();
StackTraceElement[] origStackTrace = cause.getStackTrace();
@@ -143,19 +141,18 @@ public void trimStackTrace(Member target) {

public void printBacktrace(PrintStream errorStream) {
super.printBacktrace(errorStream);
if (getRuntime().getDebug().isTrue()) {
if (getRuntime().isDebug()) {
errorStream.println("Complete Java stackTrace");
cause.printStackTrace(errorStream);
}
}

public Throwable getCause() {
public final Throwable getCause() {
return cause;
}

private String searchStackMessage(Throwable cause) {
String message = null;

private static String searchStackMessage(Throwable cause) {
String message;
do {
message = cause.getMessage();
cause = cause.getCause();
83 changes: 67 additions & 16 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -1275,13 +1275,21 @@ && getInstanceConfig().getCompileMode() != CompileMode.TRUFFLE) {
// out of base boot mode
bootingCore = false;

// init Ruby-based kernel
if (getInstanceConfig().getCompileMode() != CompileMode.TRUFFLE) {
// init Ruby-based kernel
initRubyKernel();
}

// everything booted, so SizedQueue should be available; set up root fiber
if (getInstanceConfig().getCompileMode() != CompileMode.TRUFFLE) {
// Define blank modules for feature detection in preludes
if (!config.isDisableGems()) {
defineModule("Gem");
}
if (!config.isDisableDidYouMean()) {
defineModule("DidYouMean");
}

initRubyPreludes();

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

@@ -1332,6 +1340,7 @@ private boolean doesReflectionWork() {
private void bootstrap() {
initCore();
initExceptions();
initLibraries();
}

private void initDefinedMessages() {
@@ -1414,7 +1423,9 @@ public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule claz
singleNilArray = new IRubyObject[] {nilObject};

falseObject = new RubyBoolean.False(this);
falseObject.setFrozen(true);
trueObject = new RubyBoolean.True(this);
trueObject.setFrozen(true);
}

private void initCore() {
@@ -1570,11 +1581,6 @@ private void initCore() {
RubyEnumerator.defineEnumerator(this);
}

// Fiber depends on thread library, so we load it here
new ThreadLibrary().load(this, false);

new ThreadFiberLibrary().load(this, false);

TracePoint.createTracePointClass(this);
}

@@ -1616,6 +1622,9 @@ private void initExceptions() {
interrupt = defineClassIfAllowed("Interrupt", signalException);
typeError = defineClassIfAllowed("TypeError", standardError);
argumentError = defineClassIfAllowed("ArgumentError", standardError);
if (profile.allowClass("UncaughtThrowError")) {
uncaughtThrowError = RubyUncaughtThrowError.createUncaughtThrowErrorClass(this, argumentError);
}
indexError = defineClassIfAllowed("IndexError", standardError);
if (profile.allowClass("StopIteration")) {
stopIteration = RubyStopIteration.createStopIterationClass(this, indexError);
@@ -1655,6 +1664,11 @@ private void initExceptions() {
initErrno();
}

private void initLibraries() {
new ThreadLibrary().load(this, false);
new ThreadFiberLibrary().load(this, false);
}

private RubyClass defineClassIfAllowed(String name, RubyClass superClass) {
// TODO: should probably apply the null object pattern for a
// non-allowed class, rather than null
@@ -1786,6 +1800,14 @@ private void initRubyKernel() {
loadService.loadFromClassLoader(getClassLoader(), "jruby/kernel.rb", false);
}

private void initRubyPreludes() {
// We cannot load any .rb and debug new parser features
if (RubyInstanceConfig.DEBUG_PARSER) return;

// load Ruby parts of core
loadService.loadFromClassLoader(getClassLoader(), "jruby/preludes.rb", false);
}

private void addLazyBuiltin(String name, String shortName, String className) {
addBuiltinIfAllowed(name, new LateLoadingLibrary(shortName, className, getClassLoader()));
}
@@ -2435,6 +2457,10 @@ public RubyClass getArgumentError() {
return argumentError;
}

public RubyClass getUncaughtThrowError() {
return uncaughtThrowError;
}

public RubyClass getIndexError() {
return indexError;
}
@@ -2902,7 +2928,11 @@ public void loadFile(String scriptName, InputStream in, boolean wrap) {
// toss an anonymous module into the search path
RubyModule wrapper = RubyModule.newModule(this);
((RubyBasicObject)self).extend(new IRubyObject[] {wrapper});
((RootNode) parseResult).getStaticScope().setModule(wrapper);
RootNode root = (RootNode) parseResult;
StaticScope top = root.getStaticScope();
StaticScope newTop = staticScopeFactory.newLocalScope(null);
top.setPreviousCRefScope(newTop);
top.setModule(wrapper);
}

runInterpreter(context, parseResult, self);
@@ -3859,12 +3889,14 @@ public RaiseException newNotImplementedError(String message) {
return newRaiseException(getNotImplementedError(), message);
}

@Deprecated
public RaiseException newInvalidEncoding(String message) {
return newRaiseException(fastGetClass("Iconv").getClass("InvalidEncoding"), message);
return newRaiseException(getClass("Iconv").getClass("InvalidEncoding"), message);
}

@Deprecated
public RaiseException newIllegalSequence(String message) {
return newRaiseException(fastGetClass("Iconv").getClass("IllegalSequence"), message);
return newRaiseException(getClass("Iconv").getClass("IllegalSequence"), message);
}

public RaiseException newNoMethodError(String message, String name, IRubyObject args) {
@@ -3875,7 +3907,7 @@ public RaiseException newNameError(String message, String name) {
return newNameError(message, name, null);
}

// This name sucks and should be replaced by newNameErrorfor 9k.
@Deprecated
public RaiseException newNameErrorObject(String message, IRubyObject name) {
RubyException error = new RubyNameError(this, getNameError(), message, name);

@@ -3886,6 +3918,26 @@ public RaiseException newNameError(String message, String name, Throwable origEx
return newNameError(message, name, origException, false);
}

public RaiseException newNameError(String message, IRubyObject recv, IRubyObject name) {
IRubyObject msg = new RubyNameError.RubyNameErrorMessage(this, message, recv, name);
RubyException err = RubyNameError.newNameError(getNameError(), msg, name);

return new RaiseException(err);
}

public RaiseException newNameError(String message, IRubyObject recv, String name) {
RubySymbol nameSym = newSymbol(name);
return newNameError(message, recv, nameSym);
}

public RaiseException newNoMethodError(String message, IRubyObject recv, String name, RubyArray args) {
RubySymbol nameStr = newSymbol(name);
IRubyObject msg = new RubyNameError.RubyNameErrorMessage(this, message, recv, nameStr);
RubyException err = RubyNoMethodError.newNoMethodError(getNoMethodError(), msg, nameStr, args);

return new RaiseException(err);
}

public RaiseException newNameError(String message, String name, Throwable origException, boolean printWhenVerbose) {
if (origException != null) {
if (printWhenVerbose && isVerbose()) {
@@ -3895,8 +3947,7 @@ public RaiseException newNameError(String message, String name, Throwable origEx
}
}

return new RaiseException(new RubyNameError(
this, getNameError(), message, name), false);
return new RaiseException(new RubyNameError(this, getNameError(), message, name), false);
}

public RaiseException newLocalJumpError(RubyLocalJumpError.Reason reason, IRubyObject exitValue, String message) {
@@ -4926,7 +4977,7 @@ public FilenoUtil getFilenoUtil() {
groupStruct, procStatusClass, exceptionClass, runtimeError, ioError,
scriptError, nameError, nameErrorMessage, noMethodError, signalException,
rangeError, dummyClass, systemExit, localJumpError, nativeException,
systemCallError, fatal, interrupt, typeError, argumentError, indexError, stopIteration,
systemCallError, fatal, interrupt, typeError, argumentError, uncaughtThrowError, indexError, stopIteration,
syntaxError, standardError, loadError, notImplementedError, securityError, noMemoryError,
regexpError, eofError, threadError, concurrencyError, systemStackError, zeroDivisionError, floatDomainError, mathDomainError,
encodingError, encodingCompatibilityError, converterNotFoundError, undefinedConversionError,
Loading

0 comments on commit b0bf2cb

Please sign in to comment.