Skip to content

Commit

Permalink
Merge branch 'master' into super_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed May 22, 2018
2 parents 7799044 + 8c3a669 commit 106dc09
Show file tree
Hide file tree
Showing 168 changed files with 1,390 additions and 16,130 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -53,7 +53,10 @@ lib/ruby/cext/
lib/ruby/gems
lib/ruby/stdlib/*.jar
lib/ruby/stdlib/ant*
lib/ruby/stdlib/cmath.rb
lib/ruby/stdlib/csv.rb
lib/ruby/stdlib/did_you_mean*
lib/ruby/stdlib/fileutils.rb
lib/ruby/stdlib/gauntlet_rdoc.rb
lib/ruby/stdlib/ipaddr*
lib/ruby/stdlib/jar*
Expand All @@ -75,6 +78,8 @@ lib/ruby/stdlib/readline*
lib/ruby/stdlib/minitest*
lib/ruby/stdlib/power_assert*
lib/ruby/stdlib/psych*
lib/ruby/stdlib/scanf.rb
lib/ruby/stdlib/webrick*
lib/ruby/stdlib/**/maven-metadata-local.xml
release.properties
share
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -43,7 +43,6 @@ env:
- PHASE='-Prake -Dtask=test:mri:fullint'
- PHASE='-Prake -Dtask=test:mri:jit'
- PHASE='-Prake -Dtask=test:slow_suites'
- PHASE='-Prake -Dtask=test:tracing'
- PHASE='-Prake -Dtask=spec:ji'
- PHASE='-Prake -Dtask=spec:compiler'
- PHASE='-Prake -Dtask=spec:compiler' JRUBY_OPTS=-Xcompile.invokedynamic
Expand Down
8 changes: 4 additions & 4 deletions core/pom.rb
Expand Up @@ -42,12 +42,12 @@

# exclude jnr-ffi to avoid problems with shading and relocation of the asm packages
jar 'com.github.jnr:jnr-netdb:1.1.6', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-enxio:0.16', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-enxio:0.17', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-x86asm:1.0.2', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.17', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.44', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.19', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.45', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-constants:0.9.9', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-ffi:2.1.7'
jar 'com.github.jnr:jnr-ffi:2.1.8'
jar 'com.github.jnr:jffi:${jffi.version}'
jar 'com.github.jnr:jffi:${jffi.version}:native'

Expand Down
8 changes: 4 additions & 4 deletions core/pom.xml
Expand Up @@ -101,7 +101,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-enxio</artifactId>
<version>0.16</version>
<version>0.17</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
Expand All @@ -123,7 +123,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-unixsocket</artifactId>
<version>0.17</version>
<version>0.19</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
Expand All @@ -134,7 +134,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
<version>3.0.44</version>
<version>3.0.45</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
Expand All @@ -156,7 +156,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-ffi</artifactId>
<version>2.1.7</version>
<version>2.1.8</version>
</dependency>
<dependency>
<groupId>com.github.jnr</groupId>
Expand Down
36 changes: 19 additions & 17 deletions core/src/main/java/org/jruby/Ruby.java
Expand Up @@ -1645,15 +1645,6 @@ private void initLibraries() {
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
if (superClass != null && profile.allowClass(name)) {
return defineClass(name, superClass, superClass.getAllocator());
}
return null;
}

private Map<Integer, RubyClass> errnos = new HashMap<Integer, RubyClass>();

public RubyClass getErrno(int n) {
Expand Down Expand Up @@ -1791,8 +1782,8 @@ private void addLazyBuiltin(String name, String shortName, String className) {
}

private void addBuiltinIfAllowed(String name, Library lib) {
if(profile.allowBuiltin(name)) {
loadService.addBuiltinLibrary(name,lib);
if (profile.allowBuiltin(name)) {
loadService.addBuiltinLibrary(name, lib);
}
}

Expand Down Expand Up @@ -4268,13 +4259,16 @@ private RaiseException newLightweightErrnoException(RubyClass exceptionClass, St
*/
public RaiseException newStopIteration(IRubyObject result, String message) {
final ThreadContext context = getCurrentContext();
if (RubyInstanceConfig.STOPITERATION_BACKTRACE) {
RubyException ex = RubyStopIteration.newInstance(context, result, message);
return ex.toThrowable();
}
if ( message == null ) message = STOPIERATION_BACKTRACE_MESSAGE;

if (message == null) message = STOPIERATION_BACKTRACE_MESSAGE;

RubyException ex = RubyStopIteration.newInstance(context, result, message);
return RaiseException.from(ex, disabledBacktrace());

if (!RubyInstanceConfig.STOPITERATION_BACKTRACE) {
ex.forceBacktrace(disabledBacktrace());
}

return ex.toThrowable();
}

@Deprecated
Expand Down Expand Up @@ -4823,6 +4817,12 @@ public RubyClass getData() {
return dataClass;
}

/**
* @return Class -> extension initializer map
* @note Internal API, subject to change!
*/
public Map<Class, Consumer<RubyModule>> getJavaExtensionDefinitions() { return javaExtensionDefinitions; }

@Deprecated
private static final RecursiveFunctionEx<RecursiveFunction> LEGACY_RECURSE = new RecursiveFunctionEx<RecursiveFunction>() {
@Override
Expand Down Expand Up @@ -5293,6 +5293,8 @@ protected TypePopulator computeValue(Class<?> type) {

private volatile MRIRecursionGuard mriRecursionGuard;

private final Map<Class, Consumer<RubyModule>> javaExtensionDefinitions = new WeakHashMap<>(); // caller-syncs

// For strptime processing we cache the parsed format strings since most applications
// reuse the same formats over and over. This is also unbounded (for now) since all applications
// I know of use very few of them. Even if there are many the size of these lists are modest.
Expand Down
26 changes: 12 additions & 14 deletions core/src/main/java/org/jruby/RubyArray.java
Expand Up @@ -4601,7 +4601,7 @@ public IRubyObject sumCommon(final ThreadContext context, IRubyObject init, fina
if (result instanceof RubyInteger) {
result = ((RubyInteger) result).op_plus(context, value);
} else if (result instanceof RubyRational) {
result = ((RubyRational) result).op_add(context, value);
result = ((RubyRational) result).op_plus(context, value);
} else {
throw runtime.newTypeError("BUG: unexpected type in rational part of Array#sum");
}
Expand Down Expand Up @@ -4780,29 +4780,27 @@ public RubyString pack(ThreadContext context, IRubyObject obj) {

@JRubyMethod(name = "pack")
public RubyString pack(ThreadContext context, IRubyObject obj, IRubyObject maybeOpts) {
Ruby runtime = context.runtime;
final Ruby runtime = context.runtime;
IRubyObject opts = ArgsUtil.getOptionsArg(runtime, maybeOpts);
RubyString str;
IRubyObject buffer = context.nil;

if (!opts.isNil()) {
buffer = ArgsUtil.extractKeywordArg(context, "buffer", opts);
if (opts != context.nil) {
buffer = ArgsUtil.extractKeywordArg(context, "buffer", (RubyHash) opts);
if (!buffer.isNil() && !(buffer instanceof RubyString)) {
throw runtime.newTypeError(str(runtime, "buffer must be String, not ", types(runtime, buffer.getType())));
}
}

if (!buffer.isNil()) {
str = (RubyString) buffer;
} else {
str = RubyString.newString(runtime, "");
}
final RubyString pack = pack(context, obj);

try {
return str.append(pack(context, obj));
} catch (ArrayIndexOutOfBoundsException e) {
throw concurrentModification(context.runtime, e);
if (buffer != context.nil) {
try {
return ((RubyString) buffer).append(pack);
} catch (ArrayIndexOutOfBoundsException e) {
throw concurrentModification(context.runtime, e);
}
}
return pack;
}

@JRubyMethod(name = "dig", required = 1, rest = true)
Expand Down
20 changes: 7 additions & 13 deletions core/src/main/java/org/jruby/RubyBasicObject.java
Expand Up @@ -1111,14 +1111,6 @@ public synchronized Object dataGetStruct() {
return getInternalVariable("__wrap_struct__");
}

// Equivalent of Data_Get_Struct
// This will first check that the object in question is actually a T_DATA equivalent.
@Override
public synchronized Object dataGetStructChecked() {
TypeConverter.checkData(this);
return getInternalVariable("__wrap_struct__");
}

/** rb_obj_id
*
* Return the internal id of an object.
Expand Down Expand Up @@ -3107,11 +3099,6 @@ private static BasicObjectSites sites(ThreadContext context) {

// Deprecated methods below this line

@Deprecated
public IRubyObject initialize() {
return getRuntime().getNil();
}

@Deprecated
protected RubyBasicObject(Ruby runtime, RubyClass metaClass, boolean useObjectSpace, boolean canBeTainted) {
this(runtime, metaClass, useObjectSpace);
Expand Down Expand Up @@ -3243,6 +3230,13 @@ public final Object getNativeHandle() {
public final void setNativeHandle(Object value) {
}

@Override
@Deprecated
public synchronized Object dataGetStructChecked() {
TypeConverter.checkData(this);
return getInternalVariable("__wrap_struct__");
}

@Deprecated
public static final int FL_USHIFT = 4;
@Deprecated
Expand Down

0 comments on commit 106dc09

Please sign in to comment.