Skip to content

Commit

Permalink
Merge branch 'master' into truffle-head
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed May 12, 2015
2 parents 2660d99 + 7c29362 commit c0d2d92
Show file tree
Hide file tree
Showing 81 changed files with 1,327 additions and 618 deletions.
30 changes: 19 additions & 11 deletions core/pom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,24 @@
'shadedPattern' => 'org.jruby.org.objectweb' } ],
'outputFile' => '${jruby.basedir}/lib/jruby.jar',
'transformers' => [ { '@implementation' => 'org.apache.maven.plugins.shade.resource.ManifestResourceTransformer',
'mainClass' => 'org.jruby.Main' } ] )
execute_goals( 'shade',
:id => 'shade the asm classes',
:phase => 'package',
'artifactSet' => {
'includes' => [ 'com.github.jnr:jnr-ffi',
'org.ow2.asm:*' ]
},
'relocations' => [ { 'pattern' => 'org.objectweb',
'shadedPattern' => 'org.jruby.org.objectweb' } ] )
'mainClass' => 'org.jruby.Main' } ],
:artifactSet => { :excludes => ['com.github.jnr:jffi:native'] } )
end

[:release, :main, :osgi, :j2ee, :complete, :dist, :'jruby_complete_jar_extended', :'jruby-jars' ].each do |name|
profile name do
plugin :shade do
execute_goals( 'shade',
:id => 'shade the asm classes',
:phase => 'package',
'artifactSet' => {
'includes' => [ 'com.github.jnr:jnr-ffi',
'org.ow2.asm:*' ]
},
'relocations' => [ { 'pattern' => 'org.objectweb',
'shadedPattern' => 'org.jruby.org.objectweb' } ] )
end
end
end

profile 'jruby.bash' do
Expand Down Expand Up @@ -322,7 +330,7 @@
profile 'build.properties' do

activation do
file( :exits => '../build.properties' )
file( :exists => '../build.properties' )
end

plugin 'org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2' do
Expand Down
290 changes: 270 additions & 20 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -544,34 +544,282 @@
<mainClass>org.jruby.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
<execution>
<id>shade the asm classes</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.jnr:jnr-ffi</include>
<include>org.ow2.asm:*</include>
</includes>
<excludes>
<exclude>com.github.jnr:jffi:native</exclude>
</excludes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.jruby.org.objectweb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade the asm classes</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.jnr:jnr-ffi</include>
<include>org.ow2.asm:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.jruby.org.objectweb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>main</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade the asm classes</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.jnr:jnr-ffi</include>
<include>org.ow2.asm:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.jruby.org.objectweb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>osgi</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade the asm classes</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.jnr:jnr-ffi</include>
<include>org.ow2.asm:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.jruby.org.objectweb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>j2ee</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade the asm classes</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.jnr:jnr-ffi</include>
<include>org.ow2.asm:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.jruby.org.objectweb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>complete</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade the asm classes</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.jnr:jnr-ffi</include>
<include>org.ow2.asm:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.jruby.org.objectweb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>dist</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade the asm classes</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.jnr:jnr-ffi</include>
<include>org.ow2.asm:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.jruby.org.objectweb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jruby_complete_jar_extended</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade the asm classes</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.jnr:jnr-ffi</include>
<include>org.ow2.asm:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.jruby.org.objectweb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jruby-jars</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade the asm classes</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.jnr:jnr-ffi</include>
<include>org.ow2.asm:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.jruby.org.objectweb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jruby.bash</id>
<activation>
Expand Down Expand Up @@ -651,7 +899,9 @@
<profile>
<id>build.properties</id>
<activation>
<file />
<file>
<exists>../build.properties</exists>
</file>
</activation>
<build>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ private TruffleContextInterface loadTruffleContext() {
try {
clazz = getJRubyClassLoader().loadClass("org.jruby.truffle.runtime.RubyContext");
} catch (Exception e) {
throw new UnsupportedOperationException("Truffle classes not available", e);
throw new RuntimeException("Truffle backend not available", e);
}

final TruffleContextInterface truffleBridge;
Expand All @@ -936,7 +936,7 @@ private TruffleContextInterface loadTruffleContext() {
Constructor<?> con = clazz.getConstructor(Ruby.class);
truffleBridge = (TruffleContextInterface) con.newInstance(this);
} catch (Exception e) {
throw new UnsupportedOperationException("Error while calling the constructor of TruffleBridgeImpl", e);
throw new RuntimeException("Error while calling the constructor of Truffle's RubyContext", e);
}

return truffleBridge;
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -2251,8 +2251,9 @@ public Operand buildEnsureInternal(Node ensureBodyNode, Node ensurerNode) {
activeRescuers.pop();

// Clone the ensure body and jump to the end.
// Don't bother if the protected body ended in a return.
if (rv != U_NIL && !(ensureBodyNode instanceof RescueNode)) {
// Don't bother if the protected body ended in a return
// OR if we are really processing a rescue node
if (ensurerNode != null && rv != U_NIL && !(ensureBodyNode instanceof RescueNode)) {
ebi.cloneIntoHostScope(this);
addInstr(new JumpInstr(ebi.end));
}
Expand Down Expand Up @@ -3069,9 +3070,8 @@ private Operand buildRescueInternal(RescueNode rescueNode, EnsureBlockInfo ensur
activeRescuers.pop();

// Else part of the body -- we simply fall through from the main body if there were no exceptions
Label elseLabel = rescueNode.getElseNode() == null ? null : getNewLabel();
if (elseLabel != null) {
addInstr(new LabelInstr(elseLabel));
if (rescueNode.getElseNode() != null) {
addInstr(new LabelInstr(getNewLabel()));
tmp = build(rescueNode.getElseNode());
}

Expand Down
Loading

0 comments on commit c0d2d92

Please sign in to comment.