Skip to content

Commit

Permalink
Showing 40 changed files with 388 additions and 236 deletions.
10 changes: 8 additions & 2 deletions core/pom.rb
Original file line number Diff line number Diff line change
@@ -271,7 +271,10 @@
'outputFile' => '${jruby.basedir}/lib/jruby.jar',
'transformers' => [ { '@implementation' => 'org.apache.maven.plugins.shade.resource.ManifestResourceTransformer',
'mainClass' => 'org.jruby.Main' } ],
'createSourcesJar' => '${create.sources.jar}' )
'createSourcesJar' => '${create.sources.jar}',
filters:
{filter: {artifact: 'com.headius:invokebinder', excludes: {exclude: '**/module-info.class'}}}
)
end

[:all, :release, :main, :osgi, :j2ee, :complete, :dist, :'jruby_complete_jar_extended', :'jruby-jars' ].each do |name|
@@ -293,7 +296,10 @@
relocations: [
{pattern: 'org.objectweb', shadedPattern: 'org.jruby.org.objectweb' },
{pattern: 'me.qmx.jitescript', shadedPattern: 'org.jruby.me.qmx.jitescript'},
] )
],
filters:
{filter: {artifact: 'com.headius:invokebinder', excludes: {exclude: '**/module-info.class'}}}
)
end
end
end
80 changes: 80 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -620,6 +620,14 @@ DO NOT MODIFIY - GENERATED CODE
</transformer>
</transformers>
<createSourcesJar>${create.sources.jar}</createSourcesJar>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -684,6 +692,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -722,6 +738,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -760,6 +784,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -798,6 +830,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -836,6 +876,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -874,6 +922,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -912,6 +968,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -950,6 +1014,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -988,6 +1060,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
6 changes: 6 additions & 0 deletions core/src/main/java/org/jruby/PrependedModule.java
Original file line number Diff line number Diff line change
@@ -53,6 +53,12 @@ public PrependedModule(Ruby runtime, RubyClass superClass, RubyModule origin) {
}
}

@Override
public void addMethod(String name, DynamicMethod method) {
super.addMethod(name, method);
method.setDefinedClass(origin);
}

@Override
public boolean isPrepended() {
return true;
1 change: 0 additions & 1 deletion core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -1730,7 +1730,6 @@ private void initBuiltins() {
addLazyBuiltin("bigdecimal.jar", "bigdecimal", "org.jruby.ext.bigdecimal.BigDecimalLibrary");
addLazyBuiltin("io/wait.jar", "io/wait", "org.jruby.ext.io.wait.IOWaitLibrary");
addLazyBuiltin("etc.jar", "etc", "org.jruby.ext.etc.EtcLibrary");
addLazyBuiltin("weakref.rb", "weakref", "org.jruby.ext.weakref.WeakRefLibrary");
addLazyBuiltin("timeout.rb", "timeout", "org.jruby.ext.timeout.Timeout");
addLazyBuiltin("socket.jar", "socket", "org.jruby.ext.socket.SocketLibrary");
addLazyBuiltin("rbconfig.rb", "rbconfig", "org.jruby.ext.rbconfig.RbConfigLibrary");
7 changes: 6 additions & 1 deletion core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -2055,7 +2055,12 @@ protected IRubyObject rbIoClose(ThreadContext context) {

// interrupt waiting threads
fptr.interruptBlockingThreads(context);
fptr.waitForBlockingThreads(context);
try {
fptr.unlock();
fptr.waitForBlockingThreads(context);
} finally {
fptr.lock();
}
fptr.cleanup(runtime, false);

if (fptr.getProcess() != null) {
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/RubyModule.java
Original file line number Diff line number Diff line change
@@ -1175,6 +1175,11 @@ public IRubyObject singleton_class_p(ThreadContext context) {
public void addMethod(String name, DynamicMethod method) {
testFrozen("class/module");

if (methodLocation != this) {
methodLocation.addMethod(name, method);
return;
}

if (this instanceof MetaClass) {
// FIXME: Gross and not quite right. See MRI's rb_frozen_class_p logic
RubyBasicObject attached = (RubyBasicObject)((MetaClass)this).getAttached();
7 changes: 6 additions & 1 deletion core/src/main/java/org/jruby/RubyObjectSpace.java
Original file line number Diff line number Diff line change
@@ -212,6 +212,11 @@ public IRubyObject op_aref(ThreadContext context, IRubyObject key, IRubyObject v
return context.runtime.newFixnum(System.identityHashCode(value));
}

private final WeakValuedIdentityMap<IRubyObject, IRubyObject> map = new WeakValuedIdentityMap<>();
@JRubyMethod(name = "key?")
public IRubyObject key_p(ThreadContext context, IRubyObject key) {
return context.runtime.newBoolean(map.get(key) != null);
}

private final WeakValuedIdentityMap<IRubyObject, IRubyObject> map = new WeakValuedIdentityMap<IRubyObject, IRubyObject>();
}
}
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -2129,7 +2129,7 @@ public static RubyString inspect(final Ruby runtime, ByteList byteList) {
int end = p + byteList.getRealSize();
RubyString result = new RubyString(runtime, runtime.getString(), new ByteList(end - p));
Encoding resultEnc = runtime.getDefaultInternalEncoding();
boolean isUnicode = StringSupport.isUnicode(enc);
boolean isUnicode = enc.isUnicode();
boolean asciiCompat = enc.isAsciiCompatible();


2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/compiler/FullBuildTask.java
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ class FullBuildTask implements Runnable {

public void run() {
try {
method.getIRScope().getTopLevelScope().prepareFullBuild();
method.getIRScope().getRootLexicalScope().prepareFullBuild();

method.completeBuild(method.getIRScope().prepareFullBuild());

5 changes: 3 additions & 2 deletions core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java
Original file line number Diff line number Diff line change
@@ -37,8 +37,9 @@ public static void initRootFiber(ThreadContext context) {

ThreadFiber rootFiber = new ThreadFiber(runtime, runtime.getClass("Fiber")); // FIXME: getFiber()

rootFiber.data = new FiberData(new FiberQueue(runtime), null, rootFiber);
rootFiber.thread = context.getThread();
RubyThread currentThread = context.getThread();
rootFiber.data = new FiberData(new FiberQueue(runtime), currentThread, rootFiber);
rootFiber.thread = currentThread;
context.setRootFiber(rootFiber);
}

2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ext/jruby/JRubyLibrary.java
Original file line number Diff line number Diff line change
@@ -270,7 +270,7 @@ private static IRScriptBody compileIR(ThreadContext context, IRubyObject[] args,
IRManager manager = new IRManager(context.runtime.getInstanceConfig());
manager.setDryRun(true);
IRScriptBody scope = (IRScriptBody) IRBuilder.buildRoot(manager, node).getScope();
scope.setTopLevelBindingScope(node.getScope());
scope.setScriptDynamicScope(node.getScope());
return scope;
}

7 changes: 5 additions & 2 deletions core/src/main/java/org/jruby/ext/ripper/RipperLexer.java
Original file line number Diff line number Diff line change
@@ -101,9 +101,12 @@ protected void ambiguousOperator(String op, String syn) {
parser.dispatch("on_operator_ambiguous", getRuntime().newSymbol(op), getRuntime().newString(syn));
}

protected void onMagicComment(String name, ByteList value) {
super.onMagicComment(name, value);
protected boolean onMagicComment(String name, ByteList value) {
boolean found = super.onMagicComment(name, value);

parser.dispatch("on_magic_comment", getRuntime().newString(name), getRuntime().newString(value));

return found;
}

private int getFloatToken(String number, int suffix) {
Loading

0 comments on commit e3bac23

Please sign in to comment.