Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e792e9866f1b^
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4888d7c97a70
Choose a head ref
  • 2 commits
  • 354 files changed
  • 1 contributor

Commits on Jan 17, 2015

  1. [build] include ext/ in the bootstrap profile

    the gem build in ext/ are only used to be included into the stdlib
    and is only a way to "modularize" the codebase. these ext/ gems are not
    published any more to sonatype.org repo. so everything needs to build
    locally - travis, development machine, etc
    mkristian committed Jan 17, 2015
    Copy the full SHA
    e792e98 View commit details
  2. factored out the truffle part into its own maven module

    the source is split into core/src and truffle/src. some little
    code changes were needed to get it compliled.
    
    the lib/jruby.jar remains as is, dito jruby-complete.jar - just
    the way it gets build is slightly different.
    
    jruby-jars.gem has now three jars one is jruby-truffle.jar, so
    people want to use truffle need to require this jar as well.
    
    the jruby artifacts (org.jruby:jruby, org.jruby:jruby-noasm) can
    easily exclude truffle via :exclusions => ['org.jruby:jruby-truffle']
    declaration.
    mkristian committed Jan 17, 2015
    Copy the full SHA
    4888d7c View commit details
Showing 354 changed files with 349 additions and 41 deletions.
1 change: 0 additions & 1 deletion core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@
***** END LICENSE BLOCK *****/
package org.jruby;

import com.oracle.truffle.api.Truffle;
import org.jruby.exceptions.MainExitException;
import org.jruby.exceptions.RaiseException;
import org.jruby.exceptions.ThreadKill;
12 changes: 6 additions & 6 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -138,8 +138,6 @@
import org.jruby.runtime.profile.builtin.ProfiledMethods;
import org.jruby.runtime.scope.ManyVarsDynamicScope;
import org.jruby.threading.DaemonThreadFactory;
import org.jruby.truffle.TruffleBridgeImpl;
import org.jruby.truffle.translator.TranslatorDriver;
import org.jruby.util.ByteList;
import org.jruby.util.DefinedMessage;
import org.jruby.util.JRubyClassLoader;
@@ -837,7 +835,7 @@ public IRubyObject runScriptBody(Script script) {
public IRubyObject runInterpreter(ThreadContext context, ParseResult parseResult, IRubyObject self) {
if (getInstanceConfig().getCompileMode() == CompileMode.TRUFFLE) {
assert parseResult instanceof RootNode;
getTruffleBridge().execute(TranslatorDriver.ParserContext.TOP_LEVEL, getTruffleBridge().toTruffle(self), null, (RootNode) parseResult);
getTruffleBridge().execute(getTruffleBridge().toTruffle(self), (RootNode) parseResult);
return getNil();
} else {
try {
@@ -853,7 +851,7 @@ public IRubyObject runInterpreter(ThreadContext context, Node rootNode, IRubyObj

if (getInstanceConfig().getCompileMode() == CompileMode.TRUFFLE) {
assert rootNode instanceof RootNode;
getTruffleBridge().execute(TranslatorDriver.ParserContext.TOP_LEVEL, getTruffleBridge().toTruffle(self), null, (RootNode) rootNode);
getTruffleBridge().execute(getTruffleBridge().toTruffle(self), (RootNode) rootNode);
return getNil();
} else {
try {
@@ -905,9 +903,11 @@ public synchronized TruffleBridge getTruffleBridge() {
*/

try {
truffleBridge = new TruffleBridgeImpl(this);
Class<?> clazz = getClass().getClassLoader().loadClass( "org.jruby.truffle.TruffleBridgeImpl" );
java.lang.reflect.Constructor con = clazz.getConstructor( new Class[] { Ruby.class } );
truffleBridge = (TruffleBridge) con.newInstance( clazz, new Object[] { this } );
truffleBridge.init();
} catch (NoClassDefFoundError e) {
} catch (Exception e) {
throw new UnsupportedOperationException("Support for Truffle has been removed from this distribution", e);
}
}
4 changes: 1 addition & 3 deletions core/src/main/java/org/jruby/TruffleBridge.java
Original file line number Diff line number Diff line change
@@ -9,9 +9,7 @@
*/
package org.jruby;

import com.oracle.truffle.api.frame.MaterializedFrame;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.truffle.translator.TranslatorDriver;

public interface TruffleBridge {

@@ -23,7 +21,7 @@ enum BacktraceFormatter {

void init();

Object execute(TranslatorDriver.ParserContext parserContext, Object self, MaterializedFrame parentFrame, org.jruby.ast.RootNode rootNode);
Object execute(Object self, org.jruby.ast.RootNode rootNode);

Object toTruffle(IRubyObject object);

1 change: 0 additions & 1 deletion core/src/main/java/org/jruby/util/io/SelectBlob.java
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@
***** END LICENSE BLOCK *****/
package org.jruby.util.io;

import com.oracle.truffle.api.dsl.TypeCheck;
import org.jruby.Ruby;
import org.jruby.RubyArray;
import org.jruby.RubyFixnum;
1 change: 1 addition & 0 deletions ext/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pkg
*.jar
*gemspec.xml
2 changes: 1 addition & 1 deletion ext/readline/Mavenfile
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ jar 'org.jruby:jruby:1.7.11', :scope => :provided

properties( 'gem.home' => '${basedir}/../target/rubygems',
'gem.path' => '${gem.home}',
'jruby.plugins.version' => '1.0.5',
'jruby.plugins.version' => '1.0.7',
'tesla.dump.pom' => 'pom.xml',
'tesla.dump.readonly' => true )

2 changes: 1 addition & 1 deletion ext/readline/pom.xml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
<tesla.dump.readonly>true</tesla.dump.readonly>
<gem.path>${gem.home}</gem.path>
<gem.home>${basedir}/../target/rubygems</gem.home>
<jruby.plugins.version>1.0.5</jruby.plugins.version>
<jruby.plugins.version>1.0.7</jruby.plugins.version>
<tesla.dump.pom>pom.xml</tesla.dump.pom>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
</properties>
2 changes: 1 addition & 1 deletion ext/ripper/Mavenfile
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ jar 'org.jruby:jruby:1.7.11', :scope => :provided

properties( 'gem.home' => '${basedir}/../target/rubygems',
'gem.path' => '${gem.home}',
'jruby.plugins.version' => '1.0.5',
'jruby.plugins.version' => '1.0.7',
'tesla.dump.pom' => 'pom.xml',
'tesla.dump.readonly' => true )

2 changes: 1 addition & 1 deletion ext/ripper/pom.xml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
<tesla.dump.readonly>true</tesla.dump.readonly>
<gem.path>${gem.home}</gem.path>
<gem.home>${basedir}/../target/rubygems</gem.home>
<jruby.plugins.version>1.0.5</jruby.plugins.version>
<jruby.plugins.version>1.0.7</jruby.plugins.version>
<tesla.dump.pom>pom.xml</tesla.dump.pom>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
</properties>
1 change: 1 addition & 0 deletions maven/jruby-complete/pom.rb
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
'org.ow2.asm:asm-commons',
'org.ow2.asm:asm-analysis',
'org.ow2.asm:asm-util' ] )
jar 'org.jruby:jruby-truffle:${project.version}'
jar 'org.jruby:jruby-stdlib:${project.version}'
end

6 changes: 6 additions & 0 deletions maven/jruby-complete/pom.xml
Original file line number Diff line number Diff line change
@@ -48,6 +48,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-truffle</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-stdlib</artifactId>
20 changes: 12 additions & 8 deletions maven/jruby-jars/Mavenfile
Original file line number Diff line number Diff line change
@@ -5,11 +5,11 @@ gemspec

version = File.read( File.join( basedir, '..', '..', 'VERSION' ) ).strip

inherit "org.jruby:jruby-artifacts:#{version}"

ruby_version = model.version
# maven does treats prereleased version as snapshot - undo it here
ruby_version = model.version.sub( /-SNAPSHOT/, '' )
self.version nil

model.version = nil
inherit "org.jruby:jruby-artifacts:#{version}"

name "JRuby Jars Gem"

@@ -38,12 +38,16 @@ properties( 'tesla.dump.pom' => 'pom.xml',
end

execute 'copy jruby.jar', 'prepare-package' do |ctx|
FileUtils.cp( File.join( ctx.project.properties[ 'jruby_home' ],
source = File.expand_path( ctx.project.properties[ 'jruby_home' ].to_pathname )
# TODO somehow the lib/jruby.jar gets moved away to avoid conflicts
FileUtils.cp( Dir[ File.join( source, "core/target/jruby-core-#{version}-complete.jar" ) ].first,
File.join( ctx.project.basedir.to_pathname,
'lib',
'jruby.jar' ),
File.join( ctx.project.basedir.to_s,
"jruby-core-#{ctx.project.version}-complete.jar" ) )
FileUtils.cp( Dir[ File.join( source, "truffle/target/jruby-truffle-#{version}-complete.jar" ) ].first,
File.join( ctx.project.basedir.to_pathname,
'lib',
"jruby-core-#{ctx.project.version}.jar" ) )
"jruby-truffle-#{ctx.project.version}-complete.jar" ) )
end

# do not push the gem during deploy phase
6 changes: 5 additions & 1 deletion maven/jruby-jars/lib/jruby-jars.rb
Original file line number Diff line number Diff line change
@@ -4,10 +4,14 @@ module JRubyJars
PATH = File.expand_path(File.dirname(__FILE__))

def self.core_jar_path
"#{PATH}/jruby-core-#{JRubyJars::MAVEN_VERSION}.jar"
"#{PATH}/jruby-core-#{JRubyJars::MAVEN_VERSION}-complete.jar"
end

def self.stdlib_jar_path
"#{PATH }/jruby-stdlib-#{JRubyJars::MAVEN_VERSION}.jar"
end

def self.truffle_jar_path
"#{PATH }/jruby-truffle-#{JRubyJars::MAVEN_VERSION}-complete.jar"
end
end
7 changes: 1 addition & 6 deletions maven/jruby-jars/pom.xml
Original file line number Diff line number Diff line change
@@ -18,18 +18,12 @@ freezing to) a specific jruby-complete jar version.</description>
<licenses>
<license>
<name>EPL-1.0</name>
<url>http://opensource.org/licenses/EPL-1.0</url>
<comments>Eclipse Public License 1.0</comments>
</license>
<license>
<name>GPL-2.0</name>
<url>http://opensource.org/licenses/GPL-2.0</url>
<comments>GNU General Public License version 2.0</comments>
</license>
<license>
<name>LGPL-2.1</name>
<url>http://opensource.org/licenses/LGPL-2.1</url>
<comments>GNU Library or "Lesser" General Public License version 2.1</comments>
</license>
</licenses>
<developers>
@@ -48,6 +42,7 @@ freezing to) a specific jruby-complete jar version.</description>
<gem.home>${jruby.home}/lib/ruby/gems/shared</gem.home>
<jruby.plugins.version>1.0.7</jruby.plugins.version>
<tesla.dump.pom>pom.xml</tesla.dump.pom>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<jruby_home>${basedir}/../../</jruby_home>
<tesla.version>0.1.1</tesla.version>
</properties>
1 change: 1 addition & 0 deletions maven/jruby-noasm/pom.rb
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
'org.ow2.asm:asm-commons',
'org.ow2.asm:asm-analysis',
'org.ow2.asm:asm-util' ] )
jar 'org.jruby:jruby-truffle:${project.version}'
jar 'org.jruby:jruby-stdlib:${project.version}'

# we have no sources and attach an empty jar later in the build to
1 change: 1 addition & 0 deletions maven/jruby/pom.rb
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
end

jar 'org.jruby:jruby-core:${project.version}'
jar 'org.jruby:jruby-truffle:${project.version}'
jar 'org.jruby:jruby-stdlib:${project.version}'

# we have no sources and attach an empty jar later in the build to
25 changes: 16 additions & 9 deletions pom.rb
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@
properties 'jruby.home' => '${basedir}/..'
end

modules [ 'core', 'lib' ]
modules [ 'truffle', 'core', 'lib' ]

plugin_management do
jar( 'junit:junit:4.11',
@@ -206,7 +206,7 @@
[ 'bootstrap', 'bootstrap-no-launcher' ].each do |name|
profile name do

modules [ 'test' ]
modules [ 'ext', 'test' ]

end
end
@@ -241,16 +241,23 @@
end
end

all_modules = [ 'test', 'maven' ]
profile 'jruby_complete_jar_extended' do

[ 'all', 'jruby_complete_jar_extended' ].each do |name|
profile name do
modules [ 'test', 'maven' ]

modules all_modules
build do
default_goal 'install'
end
end

build do
default_goal 'install'
end
all_modules = [ 'ext', 'test', 'maven' ]

profile 'all' do

modules all_modules

build do
default_goal 'install'
end
end

9 changes: 7 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -89,6 +89,7 @@
</mailingList>
</mailingLists>
<modules>
<module>truffle</module>
<module>core</module>
<module>lib</module>
</modules>
@@ -601,12 +602,14 @@
<profile>
<id>bootstrap</id>
<modules>
<module>ext</module>
<module>test</module>
</modules>
</profile>
<profile>
<id>bootstrap-no-launcher</id>
<modules>
<module>ext</module>
<module>test</module>
</modules>
</profile>
@@ -737,7 +740,7 @@
</properties>
</profile>
<profile>
<id>all</id>
<id>jruby_complete_jar_extended</id>
<build>
<defaultGoal>install</defaultGoal>
</build>
@@ -747,11 +750,12 @@
</modules>
</profile>
<profile>
<id>jruby_complete_jar_extended</id>
<id>all</id>
<build>
<defaultGoal>install</defaultGoal>
</build>
<modules>
<module>ext</module>
<module>test</module>
<module>maven</module>
</modules>
@@ -762,6 +766,7 @@
<defaultGoal>clean</defaultGoal>
</build>
<modules>
<module>ext</module>
<module>test</module>
<module>maven</module>
</modules>
2 changes: 2 additions & 0 deletions truffle/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/bin/
/target/
Loading