Skip to content

Commit ad4ba4b

Browse files
committed
Merge branch 'truffle-head'
2 parents edec82e + c28f4ce commit ad4ba4b

File tree

190 files changed

+3532
-3970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+3532
-3970
lines changed

core/src/main/java/org/jruby/RubyInstanceConfig.java

-9
Original file line numberDiff line numberDiff line change
@@ -1814,8 +1814,6 @@ public boolean shouldPrecompileAll() {
18141814
public static String IR_JIT_PASSES = Options.IR_JIT_PASSES.load();
18151815
public static String IR_INLINE_COMPILER_PASSES = Options.IR_INLINE_COMPILER_PASSES.load();
18161816

1817-
private TruffleHooksStub truffleHooks = null;
1818-
18191817
public static final boolean COROUTINE_FIBERS = Options.FIBER_COROUTINES.load();
18201818

18211819
/**
@@ -1848,13 +1846,6 @@ private static int initGlobalJavaVersion() {
18481846
return Opcodes.V1_5;
18491847
}
18501848
}
1851-
public void setTruffleHooks(TruffleHooksStub truffleHooks) {
1852-
this.truffleHooks = truffleHooks;
1853-
}
1854-
1855-
public TruffleHooksStub getTruffleHooks() {
1856-
return truffleHooks;
1857-
}
18581849

18591850
@Deprecated
18601851
public void setSafeLevel(int safeLevel) {

core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ private void logScriptResolutionFailure(String path) {
718718
public static void checkGraalVersion() {
719719
if (Options.TRUFFLE_RUNTIME_VERSION_CHECK.load()) {
720720
final String graalVersion = System.getProperty("graal.version", "unknown");
721-
final String expectedGraalVersion = "0.6";
721+
final String expectedGraalVersion = "0.7";
722722

723723
if (graalVersion.equals("unknown")) {
724724
return;

core/src/main/java/org/jruby/util/cli/Options.java

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public class Options {
145145
public static final Option<String> TRUFFLE_TRANSLATOR_PRINT_PARSE_TREE = string(TRUFFLE, "truffle.translator.print_parse_trees", "", "Comma delimited list of method names to print the JRuby parse tree of before translation.");
146146
public static final Option<Boolean> TRUFFLE_PANIC_ON_JAVA_ASSERT = bool(TRUFFLE, "truffle.debug.panic_on_java_assert", false, "Panic as soon as a Java assertion failure is found.");
147147
public static final Option<Boolean> TRUFFLE_EXCEPTIONS_PRINT_JAVA = bool(TRUFFLE, "truffle.exceptions.print_java", false, "Print Java exceptions at the point of translating them to Ruby exceptions.");
148+
public static final Option<Boolean> TRUFFLE_EXCEPTIONS_PRINT_UNCAUGHT_JAVA = bool(TRUFFLE, "truffle.exceptions.print_uncaught_java", false, "Print uncaught Java exceptions at the point of translating them to Ruby exceptions.");
149+
public static final Option<Boolean> TRUFFLE_COVERAGE = bool(TRUFFLE, "truffle.coverage", false, "Enable coverage (will be enabled by default in the future - currently has some bugs");
148150

149151
public static final Option<Boolean> TRUFFLE_INLINER_ALWAYS_CLONE_YIELD = bool(TRUFFLE, "truffle.inliner.always_clone_yield", true, "Always clone yield call targets.");
150152
public static final Option<Boolean> TRUFFLE_INLINER_ALWAYS_INLINE_YIELD = bool(TRUFFLE, "truffle.inliner.always_inline_yield", true, "Always inline yield call targets.");

lib/ruby/truffle/truffle/coverage.rb

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
2+
# code is released under a tri EPL/GPL/LGPL license. You can use it,
3+
# redistribute it and/or modify it under the terms of the:
4+
#
5+
# Eclipse Public License version 1.0
6+
# GNU General Public License version 2
7+
# GNU Lesser General Public License version 2.1
8+
9+
module Coverage
10+
11+
def self.start
12+
Truffle::Primitive.coverage_start
13+
end
14+
15+
def self.result
16+
Truffle::Primitive.coverage_result
17+
end
18+
19+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fails:String#strip returns a new string with leading and trailing whitespace removed
2+
fails:String#strip returns a copy of self with trailing NULL bytes and whitespace
3+
fails:String#strip taints the result when self is tainted

test/pom.rb

-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ def truffle_spec_config(spec_type, generate_report)
309309
'<exec dir="${jruby.home}" executable="${jruby.home}/bin/jruby" failonerror="true">' +
310310
'<arg value="-J-server" />' +
311311
'<arg value="-X+T" />' +
312-
'<arg value="-Xtruffle.debug.enable_assert_constant=true" />' +
313312
'<arg value="test/truffle/pe/pe.rb" />' +
314313
'</exec>' +
315314
'</target>' ) ] )

test/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,6 @@
10091009
<exec failonerror="true" dir="${jruby.home}" executable="${jruby.home}/bin/jruby">
10101010
<arg value="-J-server" />
10111011
<arg value="-X+T" />
1012-
<arg value="-Xtruffle.debug.enable_assert_constant=true" />
10131012
<arg value="test/truffle/pe/pe.rb" />
10141013
</exec>
10151014
</target>

test/truffle/cext/foo/ext/foo/add.c

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <ruby.h>
2+
3+
#include "add.h"
4+
5+
VALUE add(VALUE self, VALUE a, VALUE b) {
6+
return INT2NUM(NUM2INT(a) + NUM2INT(b));
7+
}

test/truffle/cext/foo/ext/foo/add.h

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VALUE add(VALUE self, VALUE a, VALUE b);
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
require 'mkmf'
2+
$CFLAGS << ' -Wall'
3+
create_makefile('foo/foo')

test/truffle/cext/foo/ext/foo/foo.c

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <ruby.h>
2+
3+
#include "add.h"
4+
5+
void Init_foo() {
6+
VALUE Foo = rb_define_module("Foo");
7+
rb_define_method(Foo, "add", add, 2);
8+
}

test/truffle/cext/inline.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
p Truffle::CExt.supported?
2+
3+
Truffle::CExt.inline %{
4+
#include <stdio.h>
5+
}, %{
6+
printf("Hello, World!\\n");
7+
}

test/truffle/cext/inline_capi.rb

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
p Truffle::CExt.supported?
2+
3+
Truffle::CExt.inline %{
4+
VALUE add(VALUE self, VALUE a, VALUE b) {
5+
return INT2NUM(NUM2INT(a) + NUM2INT(b));
6+
}
7+
}, %{
8+
VALUE Test = rb_define_module("Test");
9+
rb_define_method(Test, "add", add, 2);
10+
}
11+
12+
p Test.add(14, 2)

test/truffle/cext/inline_flags.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
p Truffle::CExt.supported?
2+
3+
Truffle::CExt.inline %{
4+
#include <stdio.h>
5+
}, %{
6+
printf("FOO was defined to be %d\\n", FOO);
7+
}, %w(-DFOO=14)

test/truffle/cext/require.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
p Truffle::CExt.supported?
2+
3+
require 'foo/foo'
4+
5+
p Foo.add 14, 2

test/truffle/pe/core/kernel/set_trace_func_pe.rb

-33
This file was deleted.

truffle/.factorypath

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<factorypath>
2-
<factorypathentry kind="VARJAR" id="M2_REPO/com/oracle/truffle/0.6/truffle-0.6.jar" enabled="true" runInBatchMode="false"/>
3-
<factorypathentry kind="VARJAR" id="M2_REPO/com/oracle/truffle-dsl-processor/0.6/truffle-dsl-processor-0.6.jar" enabled="true" runInBatchMode="false"/>
2+
<factorypathentry kind="VARJAR" id="M2_REPO/com/oracle/truffle/0.7-SNAPSHOT/truffle-0.7-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
3+
<factorypathentry kind="VARJAR" id="M2_REPO/com/oracle/truffle-dsl-processor/0.7-SNAPSHOT/truffle-dsl-processor-0.7-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
44
</factorypath>

truffle/pom.rb

+23-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@
99
'tesla.dump.readonly' => true,
1010

1111
'jruby.basedir' => '${basedir}/..' )
12+
13+
repository( 'http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/releases/',
14+
:id => 'truffle' ) do
15+
releases 'true'
16+
snapshots 'false'
17+
end
1218

1319
jar 'org.jruby:jruby-core', '${project.version}', :scope => 'provided'
1420

15-
jar 'com.oracle:truffle:0.6'
16-
jar 'com.oracle:truffle-dsl-processor:0.6', :scope => 'provided'
21+
jar 'com.oracle:truffle:0.7'
22+
jar 'com.oracle:truffle-dsl-processor:0.7', :scope => 'provided'
1723

1824
plugin( :compiler,
1925
'encoding' => 'utf-8',
@@ -49,4 +55,19 @@
4955
includes '**/*rb'
5056
end
5157
end
58+
59+
[ :dist, :'jruby-jars', :all, :release ].each do |name|
60+
profile name do
61+
plugin :shade do
62+
execute_goals( 'shade',
63+
:id => 'pack jruby-truffle-complete.jar',
64+
:phase => 'verify',
65+
:artifactSet => { :includes => [
66+
'com.oracle:truffle',
67+
'com.oracle:truffle-interop' ] },
68+
:shadedArtifactAttached => 'true',
69+
:shadedClassifierName => 'complete' )
70+
end
71+
end
72+
end
5273
end

truffle/pom.xml

+132-2
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,27 @@
2424
<dependency>
2525
<groupId>com.oracle</groupId>
2626
<artifactId>truffle</artifactId>
27-
<version>0.6</version>
27+
<version>0.7</version>
2828
</dependency>
2929
<dependency>
3030
<groupId>com.oracle</groupId>
3131
<artifactId>truffle-dsl-processor</artifactId>
32-
<version>0.6</version>
32+
<version>0.7</version>
3333
<scope>provided</scope>
3434
</dependency>
3535
</dependencies>
36+
<repositories>
37+
<repository>
38+
<releases>
39+
<enabled>true</enabled>
40+
</releases>
41+
<snapshots>
42+
<enabled>false</enabled>
43+
</snapshots>
44+
<id>truffle</id>
45+
<url>http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/releases/</url>
46+
</repository>
47+
</repositories>
3648
<build>
3749
<defaultGoal>package</defaultGoal>
3850
<resources>
@@ -96,4 +108,122 @@
96108
</plugin>
97109
</plugins>
98110
</build>
111+
<profiles>
112+
<profile>
113+
<id>dist</id>
114+
<build>
115+
<plugins>
116+
<plugin>
117+
<artifactId>maven-shade-plugin</artifactId>
118+
<executions>
119+
<execution>
120+
<id>pack jruby-truffle-complete.jar</id>
121+
<phase>verify</phase>
122+
<goals>
123+
<goal>shade</goal>
124+
</goals>
125+
<configuration>
126+
<artifactSet>
127+
<includes>
128+
<include>com.oracle:truffle</include>
129+
<include>com.oracle:truffle-interop</include>
130+
</includes>
131+
</artifactSet>
132+
<shadedArtifactAttached>true</shadedArtifactAttached>
133+
<shadedClassifierName>complete</shadedClassifierName>
134+
</configuration>
135+
</execution>
136+
</executions>
137+
</plugin>
138+
</plugins>
139+
</build>
140+
</profile>
141+
<profile>
142+
<id>jruby-jars</id>
143+
<build>
144+
<plugins>
145+
<plugin>
146+
<artifactId>maven-shade-plugin</artifactId>
147+
<executions>
148+
<execution>
149+
<id>pack jruby-truffle-complete.jar</id>
150+
<phase>verify</phase>
151+
<goals>
152+
<goal>shade</goal>
153+
</goals>
154+
<configuration>
155+
<artifactSet>
156+
<includes>
157+
<include>com.oracle:truffle</include>
158+
<include>com.oracle:truffle-interop</include>
159+
</includes>
160+
</artifactSet>
161+
<shadedArtifactAttached>true</shadedArtifactAttached>
162+
<shadedClassifierName>complete</shadedClassifierName>
163+
</configuration>
164+
</execution>
165+
</executions>
166+
</plugin>
167+
</plugins>
168+
</build>
169+
</profile>
170+
<profile>
171+
<id>all</id>
172+
<build>
173+
<plugins>
174+
<plugin>
175+
<artifactId>maven-shade-plugin</artifactId>
176+
<executions>
177+
<execution>
178+
<id>pack jruby-truffle-complete.jar</id>
179+
<phase>verify</phase>
180+
<goals>
181+
<goal>shade</goal>
182+
</goals>
183+
<configuration>
184+
<artifactSet>
185+
<includes>
186+
<include>com.oracle:truffle</include>
187+
<include>com.oracle:truffle-interop</include>
188+
</includes>
189+
</artifactSet>
190+
<shadedArtifactAttached>true</shadedArtifactAttached>
191+
<shadedClassifierName>complete</shadedClassifierName>
192+
</configuration>
193+
</execution>
194+
</executions>
195+
</plugin>
196+
</plugins>
197+
</build>
198+
</profile>
199+
<profile>
200+
<id>release</id>
201+
<build>
202+
<plugins>
203+
<plugin>
204+
<artifactId>maven-shade-plugin</artifactId>
205+
<executions>
206+
<execution>
207+
<id>pack jruby-truffle-complete.jar</id>
208+
<phase>verify</phase>
209+
<goals>
210+
<goal>shade</goal>
211+
</goals>
212+
<configuration>
213+
<artifactSet>
214+
<includes>
215+
<include>com.oracle:truffle</include>
216+
<include>com.oracle:truffle-interop</include>
217+
</includes>
218+
</artifactSet>
219+
<shadedArtifactAttached>true</shadedArtifactAttached>
220+
<shadedClassifierName>complete</shadedClassifierName>
221+
</configuration>
222+
</execution>
223+
</executions>
224+
</plugin>
225+
</plugins>
226+
</build>
227+
</profile>
228+
</profiles>
99229
</project>

0 commit comments

Comments
 (0)