Skip to content

Commit

Permalink
Merge branch 'ruby-2.3' into ruby-2.3+socket
Browse files Browse the repository at this point in the history
headius committed Feb 7, 2016
2 parents f08fd42 + 40e1ead commit 5f0985f
Showing 393 changed files with 21,036 additions and 13,237 deletions.
24 changes: 9 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -42,12 +42,12 @@ env:
- PHASE='-Prake -Dtask=spec:jruby'
- PHASE='-Prake -Dtask=spec:jrubyc'
- PHASE='-Prake -Dtask=spec:profiler'
- JT='test specs :language'
- JT='test specs :core'
- JT='test specs :library'
- JT='test specs :truffle'
- JT='test mri'
- JT='test integration'
#- JT='test specs :language'
#- JT='test specs :core'
#- JT='test specs :library'
#- JT='test specs :truffle'
#- JT='test mri'
#- JT='test integration'

matrix:
include:
@@ -73,8 +73,8 @@ matrix:
jdk: oraclejdk8
- 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'
# NOTE: build seems to never start (waited for any to finish for more than a day) - probably a travis-ci bug
@@ -83,12 +83,6 @@ matrix:
# dist: trusty
# group: edge
# jdk: oraclejdk9
allow_failures: # due Ruby-2.3 new features
- env: PHASE='-Ptruffle-specs-language'
- env: PHASE='-Ptruffle-specs-core'
- env: PHASE='-Ptruffle-specs-library'
- env: PHASE='-Ptruffle-specs-truffle'
- env: PHASE='-Ptruffle-mri-tests'

branches:
only:
@@ -100,7 +94,7 @@ branches:
- ruby-2.3

script: tool/travis_runner.sh
install: travis_retry ./mvnw -Pbootstrap clean install -Dinvoker.skip -Dmaven.test.skip
install: travis_retry ./mvnw -Pbootstrap clean install -B -Dinvoker.skip -Dmaven.test.skip

notifications:
irc:
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.5.0-SNAPSHOT
9.1.0.0-SNAPSHOT
4 changes: 2 additions & 2 deletions bin/ast
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ def print_passes_on(scope, passes)
end

scope.lexical_scopes.each do |child_scope|
child_scope.prepare_for_initial_compilation
child_scope.prepare_for_compilation
print_passes_on(child_scope, passes)
end
end
@@ -195,7 +195,7 @@ def ir_setup(root)
builder = org.jruby.ir.IRBuilder

scope = builder.build_root(manager, root).scope
scope.prepare_for_initial_compilation
scope.prepare_for_compilation
passes = manager.get_compiler_passes(scope)
[scope, passes]
end
2 changes: 1 addition & 1 deletion bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -383,7 +383,7 @@ if [ "$VERIFY_JRUBY" != "" ]; then
"-Djruby.home=$JRUBY_HOME" \
"-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
"-Djruby.shell=$JRUBY_SHELL" \
$java_class $JRUBY_OPTS "$@"
$java_class $mode "$@"

# Record the exit status immediately, or it will be overridden.
JRUBY_STATUS=$?
2 changes: 1 addition & 1 deletion core/pom.rb
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@

jar 'org.jruby.joni:joni:2.1.9'
jar 'org.jruby.extras:bytelist:1.0.13'
jar 'org.jruby.jcodings:jcodings:1.0.16'
jar 'org.jruby.jcodings:jcodings:1.0.17'
jar 'org.jruby:dirgra:0.3'

jar 'com.headius:invokebinder:1.7'
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ DO NOT MODIFIY - GENERATED CODE
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.5.0-SNAPSHOT</version>
<version>9.1.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-core</artifactId>
<name>JRuby Core</name>
@@ -184,7 +184,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>org.jruby.jcodings</groupId>
<artifactId>jcodings</artifactId>
<version>1.0.16</version>
<version>1.0.17</version>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
127 changes: 127 additions & 0 deletions core/src/main/java/org/jruby/ReifiedRubyObject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/*
***** BEGIN LICENSE BLOCK *****
* Version: EPL 1.0/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Eclipse Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.eclipse.org/legal/epl-v10.html
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the EPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the EPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
package org.jruby;

/**
* A RubyObject that provides a direct field for up to ten stored variables, to avoid
* the overhead of creating and managing a separate array and reference.
*/
public abstract class ReifiedRubyObject extends RubyObject {
public ReifiedRubyObject(Ruby runtime, RubyClass metaClass) {
super(runtime, metaClass);
}

@Override
public Object getVariable(int i) {
return super.getVariable(i);
}

@Override
public void setVariable(int index, Object value) {
super.setVariable(index, value);
}

public Object getVariable0() {
return getVariable(0);
}

public Object getVariable1() {
return getVariable(1);
}

public Object getVariable2() {
return getVariable(2);
}

public Object getVariable3() {
return getVariable(3);
}

public Object getVariable4() {
return getVariable(4);
}

public Object getVariable5() {
return getVariable(5);
}

public Object getVariable6() {
return getVariable(6);
}

public Object getVariable7() {
return getVariable(7);
}

public Object getVariable8() {
return getVariable(8);
}

public Object getVariable9() {
return getVariable(9);
}

public void setVariable0(Object value) {
setVariable(0, value);
}

public void setVariable1(Object value) {
setVariable(1, value);
}

public void setVariable2(Object value) {
setVariable(2, value);
}

public void setVariable3(Object value) {
setVariable(3, value);
}

public void setVariable4(Object value) {
setVariable(4, value);
}

public void setVariable5(Object value) {
setVariable(5, value);
}

public void setVariable6(Object value) {
setVariable(6, value);
}

public void setVariable7(Object value) {
setVariable(7, value);
}

public void setVariable8(Object value) {
setVariable(8, value);
}

public void setVariable9(Object value) {
setVariable(9, value);
}
}
55 changes: 32 additions & 23 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -1619,6 +1619,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);
@@ -2451,6 +2454,10 @@ public RubyClass getArgumentError() {
return argumentError;
}

public RubyClass getUncaughtThrowError() {
return uncaughtThrowError;
}

public RubyClass getIndexError() {
return indexError;
}
@@ -2857,31 +2864,30 @@ public PrintStream getOutputStream() {
return new PrintStream(new IOOutputStream(getGlobalVariables().get("$stdout")));
}

public RubyModule getClassFromPath(String path) {
RubyModule c = getObject();
public RubyModule getClassFromPath(final String path) {
if (path.length() == 0 || path.charAt(0) == '#') {
throw newTypeError("can't retrieve anonymous class " + path);
}

RubyModule c = getObject();
int pbeg = 0, p = 0;
for(int l=path.length(); p<l; ) {
while(p<l && path.charAt(p) != ':') {
p++;
}
String str = path.substring(pbeg, p);
for ( final int l = path.length(); p < l; ) {
while ( p < l && path.charAt(p) != ':' ) p++;

final String str = path.substring(pbeg, p);

if(p<l && path.charAt(p) == ':') {
if(p+1 < l && path.charAt(p+1) != ':') {
throw newTypeError("undefined class/module " + path.substring(pbeg,p));
if ( p < l && path.charAt(p) == ':' ) {
if ( ++p < l && path.charAt(p) != ':' ) {
throw newTypeError("undefined class/module " + str);
}
p += 2;
pbeg = p;
pbeg = ++p;
}

IRubyObject cc = c.getConstant(str);
if(!(cc instanceof RubyModule)) {
if ( ! ( cc instanceof RubyModule ) ) {
throw newTypeError(path + " does not refer to class/module");
}
c = (RubyModule)cc;
c = (RubyModule) cc;
}
return c;
}
@@ -2906,7 +2912,7 @@ public void printError(RubyException excp) {
}

public void loadFile(String scriptName, InputStream in, boolean wrap) {
IRubyObject self = wrap ? TopSelfFactory.createTopSelf(this, true) : getTopSelf();
IRubyObject self = wrap ? getTopSelf().rbClone() : getTopSelf();
ThreadContext context = getCurrentContext();
String file = context.getFile();

@@ -2917,7 +2923,9 @@ public void loadFile(String scriptName, InputStream in, boolean wrap) {

if (wrap) {
// toss an anonymous module into the search path
((RootNode) parseResult).getStaticScope().setModule(RubyModule.newModule(this));
RubyModule wrapper = RubyModule.newModule(this);
((RubyBasicObject)self).extend(new IRubyObject[] {wrapper});
((RootNode) parseResult).getStaticScope().setModule(wrapper);
}

runInterpreter(context, parseResult, self);
@@ -3878,12 +3886,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) {
@@ -3894,7 +3904,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);

@@ -3907,7 +3917,7 @@ public RaiseException newNameError(String message, String name, Throwable origEx

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

return new RaiseException(err);
}
@@ -3934,8 +3944,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) {
@@ -4949,7 +4958,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 5f0985f

Please sign in to comment.