Skip to content

Commit c8eb4b5

Browse files
committed
Merge branch 'truffle-head'
2 parents ce21a14 + 887c928 commit c8eb4b5

File tree

19 files changed

+235
-129
lines changed

19 files changed

+235
-129
lines changed

spec/ruby/command_line/dash_e_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
end
1111

1212
it "uses 'main' as self" do
13-
ruby_exe("puts self").chomp.should == "main"
13+
ruby_exe("puts self", escape: false).chomp.should == "main"
1414
end
1515

1616
it "uses '-e' as file" do
17-
ruby_exe("puts __FILE__").chomp.should == "-e"
17+
ruby_exe("puts __FILE__", escape: false).chomp.should == "-e"
1818
end
1919

2020
#needs to test return => LocalJumpError

spec/ruby/command_line/rubyopt_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
it "requires the file for '-r'" do
5656
f = fixture __FILE__, "rubyopt"
5757
ENV["RUBYOPT"] = "-r#{f}"
58-
ruby_exe("").should =~ /^rubyopt.rb required/
58+
ruby_exe("0", args: '2>&1').should =~ /^rubyopt.rb required/
5959
end
6060

6161
it "raises a RuntimeError for '-a'" do

spec/ruby/core/time/dup_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@
2525
t.should be_an_instance_of(c)
2626
t.dup.should be_an_instance_of(c)
2727
end
28+
29+
it "returns a clone of Time instance" do
30+
c = Time.dup
31+
t = c.now
32+
33+
t.should be_an_instance_of(c)
34+
t.should_not be_an_instance_of(Time)
35+
36+
t.dup.should be_an_instance_of(c)
37+
t.dup.should_not be_an_instance_of(Time)
38+
end
2839
end

spec/truffle/tags/core/string/modulo_tags.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
fails:String#% raises an ArgumentError for unused arguments when $DEBUG is true
22
fails:String#% supports float formats using %g
33
fails:String#% supports float formats using %G
4-
fails:String#% supports octal formats using %o for negative numbers
54
fails:String#% raises an ArgumentError for huge precisions for %s
6-
fails:String#% supports hex formats using %x for negative numbers
7-
fails:String#% supports hex formats using %X for negative numbers
85
fails:String#% behaves as if calling Kernel#Float for %e arguments, when the passed argument does not respond to #to_ary
96
fails:String#% behaves as if calling Kernel#Float for %e arguments, when the passed argument is hexadecimal string
107
fails:String#% behaves as if calling Kernel#Float for %E arguments, when the passed argument does not respond to #to_ary

tool/jruby_eclipse

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ home = Dir.home rescue "/home/#{`whoami`.chomp}"
1010
M2REPO = "#{home}/.m2/repository"
1111

1212
TRUFFLE_VERSION = File.foreach("#{JRUBY}/truffle/pom.rb") { |line|
13-
break $1 if /'truffle\.version' => '(\d+\.\d+|\h+-SNAPSHOT)'/ =~ line
13+
break $1 if /'truffle\.version' => '((?:\d+\.\d+|\h+)(?:-SNAPSHOT)?)'/ =~ line
1414
}
1515

1616
TRUFFLEJARS = %W[

tool/jt.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
SO = 'so'
4343
end
4444

45+
# Expand GEM_HOME relative to cwd so it cannot be misinterpreted later.
46+
ENV['GEM_HOME'] = File.expand_path(ENV['GEM_HOME']) if ENV['GEM_HOME']
47+
4548
LIBXML_HOME = ENV['LIBXML_HOME'] = ENV['LIBXML_HOME'] || '/usr'
4649
LIBXML_LIB_HOME = ENV['LIBXML_LIB_HOME'] = ENV['LIBXML_LIB_HOME'] || "#{LIBXML_HOME}/lib"
4750
LIBXML_INCLUDE = ENV['LIBXML_INCLUDE'] = ENV['LIBXML_INCLUDE'] || "#{LIBXML_HOME}/include/libxml2"
@@ -59,7 +62,7 @@ module Utilities
5962

6063
def self.truffle_version
6164
File.foreach("#{JRUBY_DIR}/truffle/pom.rb") do |line|
62-
if /'truffle\.version' => '(\d+\.\d+(?:-SNAPSHOT)?|\h+-SNAPSHOT)'/ =~ line
65+
if /'truffle\.version' => '((?:\d+\.\d+|\h+)(?:-SNAPSHOT)?)'/ =~ line
6366
break $1
6467
end
6568
end
@@ -672,8 +675,10 @@ def cextc(cext_dir, *clang_opts)
672675
config_src = config['src']
673676

674677
src = replace_env_vars(config['src'])
678+
# Expand relative to the cext directory
675679
src = File.expand_path(src, cext_dir)
676-
src = Dir[src]
680+
src_files = Dir[src]
681+
raise "No source files found in #{src}!" if src_files.empty?
677682

678683
config_cflags = config['cflags'] || ''
679684
config_cflags = replace_env_vars(config_cflags)
@@ -692,7 +697,7 @@ def cextc(cext_dir, *clang_opts)
692697

693698
lls = []
694699

695-
src.each do |src|
700+
src_files.each do |src|
696701
ll = File.join(File.dirname(out), File.basename(src, '.*') + '.ll')
697702

698703
clang "-I#{SULONG_HOME}/include", '-Ilib/ruby/truffle/cext', '-S', '-emit-llvm', *config_cflags, *clang_opts, src, '-o', ll

truffle/src/main/java/org/jruby/truffle/builtins/CoreMethodNodeManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ private static CallTarget makeGenericMethod(RubyContext context, MethodDetails m
244244
if (!isSafe(context, method.unsafe())) {
245245
node = new UnsafeNode(context, sourceSection);
246246
} else {
247-
node = Translator.sequence(context, sourceSection, Arrays.asList(checkArity, methodNode));
247+
node = Translator.sequence(context, sharedMethodInfo.getName(), sourceSection, Arrays.asList(checkArity, methodNode));
248248
node = transformResult(method, node);
249249
}
250250

0 commit comments

Comments
 (0)