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: be0d8bc39528
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 69e043fd5702
Choose a head ref

Commits on Jun 22, 2015

  1. Copy the full SHA
    6b7f3f6 View commit details
  2. fix creating FileResource with CWD a uri-like path and path a regular…

    … file
    
    if the path is an absolute path to regular file and the CWD is using a
    uri:classloader:/ then the absolute path on the filesystem "wins"
    
    fixes #3071
    
    Sponsored by Lookout Inc.
    mkristian committed Jun 22, 2015
    Copy the full SHA
    edac27b View commit details
  3. Copy the full SHA
    0cce926 View commit details
  4. Merge branch 'jruby-1_7'

    Conflicts:
    	core/src/main/java/org/jruby/util/JRubyFile.java
    	lib/pom.rb
    	test/test_file.rb
    mkristian committed Jun 22, 2015
    Copy the full SHA
    1f9aac5 View commit details
  5. Copy the full SHA
    06c77ea View commit details
  6. Copy the full SHA
    6ec2c81 View commit details
  7. Copy the full SHA
    77e783b View commit details
  8. Copy the full SHA
    b48335a View commit details
  9. Copy the full SHA
    89ba433 View commit details
  10. [Truffle] Untagged ENV specs failing only on Windows.

    The specs were tagged when using the old ENV implementation.  While the new one still doesn't worky, it fails for a completely different reason.  We'll revisit as part of a larger 'get things working on Windows pass'.
    nirvdrum committed Jun 22, 2015
    Copy the full SHA
    a96b78f View commit details
  11. Copy the full SHA
    abc6a6a View commit details
  12. Copy the full SHA
    385b223 View commit details
  13. [Truffle] Fixed a bug with bad return values in Rubinius::Mirror::Ran…

    …ge#step_float_iterations_size.
    nirvdrum committed Jun 22, 2015
    Copy the full SHA
    186fc0c View commit details
  14. Copy the full SHA
    4ebf7ca View commit details

Commits on Jun 23, 2015

  1. Copy the full SHA
    3df7774 View commit details
  2. Copy the full SHA
    f8eef82 View commit details
  3. Copy the full SHA
    7e9b464 View commit details
  4. Copy the full SHA
    0b589e0 View commit details
  5. Copy the full SHA
    5a08be6 View commit details
  6. Copy the full SHA
    3873359 View commit details
  7. Copy the full SHA
    af0e0d0 View commit details
  8. Copy the full SHA
    75cbccb View commit details
  9. Copy the full SHA
    69e043f View commit details
Showing with 150 additions and 137 deletions.
  1. +8 −6 core/src/main/java/org/jruby/util/JRubyFile.java
  2. +1 −1 lib/pom.rb
  3. +1 −1 lib/pom.xml
  4. +0 −2 spec/truffle/tags/core/env/element_set_tags.txt
  5. +0 −1 spec/truffle/tags/core/env/has_value_tags.txt
  6. +0 −1 spec/truffle/tags/core/env/reject_tags.txt
  7. +0 −3 spec/truffle/tags/core/env/shift_tags.txt
  8. +0 −1 spec/truffle/tags/core/env/size_tags.txt
  9. +0 −8 spec/truffle/tags/core/env/store_tags.txt
  10. +0 −2 spec/truffle/tags/core/env/to_a_tags.txt
  11. +0 −3 spec/truffle/tags/core/env/to_h_tags.txt
  12. +0 −2 spec/truffle/tags/core/env/to_hash_tags.txt
  13. +0 −1 spec/truffle/tags/core/env/to_s_tags.txt
  14. +0 −1 spec/truffle/tags/core/env/value_tags.txt
  15. +0 −2 spec/truffle/tags/core/env/values_at_tags.txt
  16. +0 −2 spec/truffle/tags/core/env/values_tags.txt
  17. +0 −1 spec/truffle/tags/core/hash/reject_tags.txt
  18. +0 −1 spec/truffle/tags/library/base64/decode64_tags.txt
  19. +0 −3 spec/truffle/tags/library/bigdecimal/add_tags.txt
  20. +0 −1 spec/truffle/tags/library/bigdecimal/ceil_tags.txt
  21. +0 −1 spec/truffle/tags/library/bigdecimal/div_tags.txt
  22. +0 −2 spec/truffle/tags/library/bigdecimal/divmod_tags.txt
  23. +1 −2 spec/truffle/tags/library/bigdecimal/inspect_tags.txt
  24. +0 −2 spec/truffle/tags/library/bigdecimal/modulo_tags.txt
  25. +1 −3 spec/truffle/tags/library/complex/math/acos_tags.txt
  26. +0 −2 spec/truffle/tags/library/complex/math/asin_tags.txt
  27. +0 −2 spec/truffle/tags/library/complex/math/atan2_tags.txt
  28. +0 −1 spec/truffle/tags/library/conditionvariable/broadcast_tags.txt
  29. +0 −1 spec/truffle/tags/library/conditionvariable/signal_tags.txt
  30. +0 −1 spec/truffle/tags/library/delegate/delegate_class/private_instance_methods_tags.txt
  31. +0 −1 spec/truffle/tags/library/delegate/delegator/case_compare_tags.txt
  32. +0 −1 spec/truffle/tags/library/delegate/delegator/compare_tags.txt
  33. +0 −1 spec/truffle/tags/library/delegate/delegator/eql_tags.txt
  34. +0 −1 spec/truffle/tags/library/delegate/delegator/hash_tags.txt
  35. +0 −2 spec/truffle/tags/library/delegate/delegator/marshal_tags.txt
  36. +0 −1 spec/truffle/tags/library/delegate/delegator/public_methods_tags.txt
  37. +0 −1 spec/truffle/tags/library/erb/defmethod/def_erb_method_tags.txt
  38. +0 −1 spec/truffle/tags/library/getoptlong/initialize_tags.txt
  39. +0 −2 spec/truffle/tags/library/ipaddr/hton_tags.txt
  40. +0 −1 spec/truffle/tags/library/logger/device/close_tags.txt
  41. +0 −1 spec/truffle/tags/library/logger/device/new_tags.txt
  42. +0 −2 spec/truffle/tags/library/logger/device/write_tags.txt
  43. +0 −1 spec/truffle/tags/library/socket/basicsocket/close_read_tags.txt
  44. +0 −1 spec/truffle/tags/library/socket/basicsocket/close_write_tags.txt
  45. +0 −1 spec/truffle/tags/library/socket/basicsocket/for_fd_tags.txt
  46. +0 −3 spec/truffle/tags/library/socket/basicsocket/getsockname_tags.txt
  47. +0 −2 spec/truffle/tags/library/strscan/element_reference_tags.txt
  48. +0 −1 spec/truffle/tags/library/strscan/getbyte_tags.txt
  49. +0 −2 spec/truffle/tags/library/strscan/getch_tags.txt
  50. +0 −1 spec/truffle/tags/library/strscan/matched_tags.txt
  51. +0 −3 spec/truffle/tags/library/strscan/matchedsize_tags.txt
  52. +0 −2 spec/truffle/tags/library/strscan/peek_tags.txt
  53. +0 −2 spec/truffle/tags/library/strscan/peep_tags.txt
  54. +0 −1 spec/truffle/tags/library/strscan/post_match_tags.txt
  55. +0 −1 spec/truffle/tags/library/strscan/pre_match_tags.txt
  56. +0 −1 spec/truffle/tags/library/strscan/rest_tags.txt
  57. +0 −2 spec/truffle/tags/library/strscan/scan_tags.txt
  58. +0 −1 spec/truffle/tags/library/strscan/scan_until_tags.txt
  59. +0 −1 spec/truffle/tags/library/thread/sizedqueue/deq_tags.txt
  60. +0 −1 spec/truffle/tags/library/thread/sizedqueue/pop_tags.txt
  61. +0 −1 spec/truffle/tags/library/thread/sizedqueue/shift_tags.txt
  62. +0 −1 spec/truffle/tags/library/tmpdir/dir/tmpdir_tags.txt
  63. +21 −0 test/jruby/test_file.rb
  64. +1 −1 truffle/pom.rb
  65. +3 −3 truffle/pom.xml
  66. +8 −1 truffle/src/main/java/org/jruby/truffle/nodes/coerce/ToIntNode.java
  67. +6 −3 truffle/src/main/java/org/jruby/truffle/nodes/core/CoreMethod.java
  68. +24 −0 truffle/src/main/java/org/jruby/truffle/nodes/core/PointerGuards.java
  69. +7 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ExceptionPrimitiveNodes.java
  70. +8 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/PointerPrimitiveNodes.java
  71. +1 −1 truffle/src/main/ruby/core/hash.rb
  72. +15 −0 truffle/src/main/ruby/core/rubinius/api/shims/range_mirror.rb
  73. +7 −5 truffle/src/main/ruby/core/rubinius/common/string.rb
  74. +37 −17 truffle/src/test/java/org/jruby/truffle/tck/RubyTckTest.java
14 changes: 8 additions & 6 deletions core/src/main/java/org/jruby/util/JRubyFile.java
Original file line number Diff line number Diff line change
@@ -108,7 +108,8 @@ private static FileResource createResource(Ruby runtime, String cwd, String path
}
}

if (cwd != null && (cwd.startsWith("uri:") || cwd.startsWith("file:"))) {
File internal = new JavaSecuredFile(pathname);
if (cwd != null && !internal.isAbsolute() && (cwd.startsWith("uri:") || cwd.startsWith("file:"))) {
return createResource(runtime, null, cwd + "/" + pathname);
}

@@ -133,14 +134,15 @@ private static JRubyFile createNoUnicodeConversion(String cwd, String pathname)
pathname = pathname.substring(5);
}
File internal = new JavaSecuredFile(pathname);
if(cwd != null && cwd.startsWith("uri:") && !pathname.startsWith("uri:") && !pathname.contains("!/") && !internal.isAbsolute()) {
if (internal.isAbsolute()) {
return new JRubyFile(internal);
}
if(cwd != null && cwd.startsWith("uri:") && !pathname.startsWith("uri:") && !pathname.contains("!/")) {
return new JRubyFile(cwd + "/" + pathname);
}
internal = new JavaSecuredFile(cwd, pathname);
if(!internal.isAbsolute()) {
internal = new JavaSecuredFile(cwd, pathname);
if(!internal.isAbsolute()) {
throw new IllegalArgumentException("Neither current working directory ("+cwd+") nor pathname ("+pathname+") led to an absolute path");
}
throw new IllegalArgumentException("Neither current working directory ("+cwd+") nor pathname ("+pathname+") led to an absolute path");
}
return new JRubyFile(internal);
}
2 changes: 1 addition & 1 deletion lib/pom.rb
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ def version
ImportedGem.new( 'power_assert', 'power_assert.version', true ),
ImportedGem.new( 'psych', '2.0.14.pre1', true ),
ImportedGem.new( 'json', 'json.version', true ),
ImportedGem.new( 'jar-dependencies', '0.1.14', true )
ImportedGem.new( 'jar-dependencies', '0.1.15', true )
]

project 'JRuby Lib Setup' do
2 changes: 1 addition & 1 deletion lib/pom.xml
Original file line number Diff line number Diff line change
@@ -144,7 +144,7 @@
<dependency>
<groupId>rubygems</groupId>
<artifactId>jar-dependencies</artifactId>
<version>0.1.14</version>
<version>0.1.15</version>
<type>gem</type>
<scope>provided</scope>
<exclusions>
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/env/element_set_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/env/has_value_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/env/reject_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/core/env/shift_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/env/size_tags.txt

This file was deleted.

8 changes: 0 additions & 8 deletions spec/truffle/tags/core/env/store_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/env/to_a_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/core/env/to_h_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/env/to_hash_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/env/to_s_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/env/value_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/env/values_at_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/env/values_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/hash/reject_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/base64/decode64_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/library/bigdecimal/add_tags.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
fails:BigDecimal#add favors the precision specified in the second argument over the global limit
fails:BigDecimal#add uses the current rounding mode if rounding is needed
fails:BigDecimal#add uses the default ROUND_HALF_UP rounding if it wasn't explicitly changed
fails:BigDecimal#add returns NaN if NaN is involved
fails:BigDecimal#add returns Infinity or -Infinity if these are involved
fails:BigDecimal#add returns NaN if Infinity + (- Infinity)
fails:BigDecimal#add raises TypeError when adds nil
fails:BigDecimal#add raises TypeError when precision parameter is nil
fails:BigDecimal#add raises ArgumentError when precision parameter is negative
1 change: 0 additions & 1 deletion spec/truffle/tags/library/bigdecimal/ceil_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:BigDecimal#ceil returns an Integer, if n is unspecified
fails:BigDecimal#ceil returns a BigDecimal, if n is specified
fails:BigDecimal#ceil returns the smallest integer greater or equal to self, if n is unspecified
fails:BigDecimal#ceil raise exception, if self is special value
1 change: 0 additions & 1 deletion spec/truffle/tags/library/bigdecimal/div_tags.txt
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ fails:BigDecimal#div returns a / b with optional precision
fails:BigDecimal#div raises FloatDomainError if NaN is involved
fails:BigDecimal#div returns 0 if divided by Infinity and no precision given
fails:BigDecimal#div returns 0 if divided by Infinity with given precision
fails:BigDecimal#div raises ZeroDivisionError if divided by zero and no precision given
fails:BigDecimal#div returns NaN if zero is divided by zero
fails:BigDecimal#div raises FloatDomainError if (+|-) Infinity divided by 1 and no precision given
fails:BigDecimal#div returns (+|-)Infinity if (+|-)Infinity by 1 and precision given
2 changes: 0 additions & 2 deletions spec/truffle/tags/library/bigdecimal/divmod_tags.txt
Original file line number Diff line number Diff line change
@@ -4,12 +4,10 @@ fails:BigDecimal#mod_part_of_divmod returns NaN if NaN is involved
fails:BigDecimal#mod_part_of_divmod returns NaN if the dividend is Infinity
fails:BigDecimal#mod_part_of_divmod returns the dividend if the divisor is Infinity
fails:BigDecimal#mod_part_of_divmod raises TypeError if the argument cannot be coerced to BigDecimal
fails:BigDecimal#mod_part_of_divmod raises ZeroDivisionError if other is zero
fails:BigDecimal#divmod divides value, returns an array
fails:BigDecimal#divmod array contains quotient and modulus as BigDecimal
fails:BigDecimal#divmod Can be reversed with * and +
fails:BigDecimal#divmod returns an array of two NaNs if NaN is involved
fails:BigDecimal#divmod raises ZeroDivisionError if the divisor is zero
fails:BigDecimal#divmod returns an array of Infinity and NaN if the dividend is Infinity
fails:BigDecimal#divmod returns an array of zero and the dividend if the divisor is Infinity
fails:BigDecimal#divmod returns an array of two zero if the diviend is zero
3 changes: 1 addition & 2 deletions spec/truffle/tags/library/bigdecimal/inspect_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
fails:BigDecimal#inspect returns String
fails:BigDecimal#inspect returns String starting with #
fails:BigDecimal#inspect encloses information in angle brackets
fails:BigDecimal#inspect is comma separated list of three items
fails:BigDecimal#inspect value after first comma is value as string
fails:BigDecimal#inspect last part is number of significant digits
fails:BigDecimal#inspect looks like this
fails:BigDecimal#inspect returns String starting with #
2 changes: 0 additions & 2 deletions spec/truffle/tags/library/bigdecimal/modulo_tags.txt
Original file line number Diff line number Diff line change
@@ -4,11 +4,9 @@ fails:BigDecimal#% returns NaN if NaN is involved
fails:BigDecimal#% returns NaN if the dividend is Infinity
fails:BigDecimal#% returns the dividend if the divisor is Infinity
fails:BigDecimal#% raises TypeError if the argument cannot be coerced to BigDecimal
fails:BigDecimal#% raises ZeroDivisionError if other is zero
fails:BigDecimal#modulo returns self modulo other
fails:BigDecimal#modulo returns a [Float value] when the argument is Float
fails:BigDecimal#modulo returns NaN if NaN is involved
fails:BigDecimal#modulo returns NaN if the dividend is Infinity
fails:BigDecimal#modulo returns the dividend if the divisor is Infinity
fails:BigDecimal#modulo raises TypeError if the argument cannot be coerced to BigDecimal
fails:BigDecimal#modulo raises ZeroDivisionError if other is zero
4 changes: 1 addition & 3 deletions spec/truffle/tags/library/complex/math/acos_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
fails:Math#acos returns the arccosine for Complex numbers
fails:Math#acos returns the arccosine for numbers greater than 1.0 as a Complex number
fails:Math#acos returns the arccosine for numbers less than -1.0 as a Complex number
fails:Math.acos returns the arccosine for Complex numbers
fails:Math.acos returns the arccosine for numbers greater than 1.0 as a Complex number
fails:Math.acos returns the arccosine for numbers less than -1.0 as a Complex number
fails:Math.acos returns the arccosine for numbers less than -1.0 as a Complex number
2 changes: 0 additions & 2 deletions spec/truffle/tags/library/complex/math/asin_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/library/complex/math/atan2_tags.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/delegate/delegator/eql_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/delegate/delegator/hash_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/library/delegate/delegator/marshal_tags.txt

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/getoptlong/initialize_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/library/ipaddr/hton_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/logger/device/close_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/logger/device/new_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/library/logger/device/write_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -2,5 +2,4 @@ fails:Socket::BasicSocket#close_read closes the reading end of the socket
fails:Socket::BasicSocket#close_read it works on sockets with closed ends
fails:Socket::BasicSocket#close_read does not close the socket
fails:Socket::BasicSocket#close_read fully closes the socket if it was already closed for writing
fails:Socket::BasicSocket#close_read raises IOError on closed socket
fails:Socket::BasicSocket#close_read returns nil
Original file line number Diff line number Diff line change
@@ -2,5 +2,4 @@ fails:Socket::BasicSocket#close_write closes the writing end of the socket
fails:Socket::BasicSocket#close_write works on sockets with closed write ends
fails:Socket::BasicSocket#close_write does not close the socket
fails:Socket::BasicSocket#close_write fully closes the socket if it was already closed for reading
fails:Socket::BasicSocket#close_write raises IOError on closed socket
fails:Socket::BasicSocket#close_write returns nil

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/library/strscan/element_reference_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/strscan/getbyte_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/library/strscan/getch_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/strscan/matched_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/library/strscan/matchedsize_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/library/strscan/peek_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/library/strscan/peep_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/strscan/post_match_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/strscan/pre_match_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/strscan/rest_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/library/strscan/scan_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/strscan/scan_until_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/thread/sizedqueue/deq_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/thread/sizedqueue/pop_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/thread/sizedqueue/shift_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/library/tmpdir/dir/tmpdir_tags.txt

This file was deleted.

21 changes: 21 additions & 0 deletions test/jruby/test_file.rb
Original file line number Diff line number Diff line change
@@ -964,6 +964,27 @@ def test_file_utf8
end
end

# GH-3074
def test_file_with_absolute_path_and_uri_path_as_cwd
filename = File.expand_path( 'test_absolute_path_and_uri_path_as_cwd' )

Dir.chdir('uri:classloader:/') do
begin
f = File.new(filename, File::CREAT)
assert_equal(nil, f.read(1))

assert File.file?(filename)
assert File.exist?(filename)
ensure
f.close
File.delete(filename)

assert !File.file?(filename)
assert !File.exist?(filename)
end
end
end

def test_file_create
filename = '2nnever'
f = File.new(filename, File::CREAT)
2 changes: 1 addition & 1 deletion truffle/pom.rb
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
repository( :url => 'http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/',
:id => 'truffle' )

truffle_version = '0.8-ef8c90391f1ec21bcfb6d5c6fb39757b860d4973-SNAPSHOT'
truffle_version = '0.8-ff6f34159b8a2d7149e384b67b0bb007e79c8a75-SNAPSHOT'
jar 'com.oracle:truffle:' + truffle_version
jar 'com.oracle:truffle-dsl-processor:' + truffle_version, :scope => 'provided'
jar 'com.oracle:truffle-tck:' + truffle_version, :scope => 'test'
6 changes: 3 additions & 3 deletions truffle/pom.xml
Original file line number Diff line number Diff line change
@@ -24,18 +24,18 @@
<dependency>
<groupId>com.oracle</groupId>
<artifactId>truffle</artifactId>
<version>0.8-ef8c90391f1ec21bcfb6d5c6fb39757b860d4973-SNAPSHOT</version>
<version>0.8-ff6f34159b8a2d7149e384b67b0bb007e79c8a75-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>truffle-dsl-processor</artifactId>
<version>0.8-ef8c90391f1ec21bcfb6d5c6fb39757b860d4973-SNAPSHOT</version>
<version>0.8-ff6f34159b8a2d7149e384b67b0bb007e79c8a75-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>truffle-tck</artifactId>
<version>0.8-ef8c90391f1ec21bcfb6d5c6fb39757b860d4973-SNAPSHOT</version>
<version>0.8-ff6f34159b8a2d7149e384b67b0bb007e79c8a75-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.nodes.RubyGuards;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.core.FloatNodes;
import org.jruby.truffle.nodes.core.FloatNodesFactory;
@@ -42,6 +43,11 @@ public int doInt(VirtualFrame frame, Object object) {
return (int) integerObject;
}

if (RubyGuards.isRubyBignum(object)) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().rangeError("bignum too big to convert into `long'", this));
}

CompilerDirectives.transferToInterpreter();
throw new UnsupportedOperationException();
}
@@ -60,7 +66,8 @@ public long coerceLong(long value) {

@Specialization(guards = "isRubyBignum(value)")
public RubyBasicObject coerceRubyBignum(RubyBasicObject value) {
return value;
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().rangeError("bignum too big to convert into `long'", this));
}

@Specialization
Original file line number Diff line number Diff line change
@@ -27,22 +27,25 @@

/**
* Defines the method on the singleton class.
* {@link needsSelf} is always false.
* {@link #needsSelf() needsSelf} is always false.
* See {@link #constructor() constructor} if you need self.
* */
boolean onSingleton() default false;

/**
* Like {@link #onSingleton()} but with {@link #needsSelf()} always true.
* Like {@link #onSingleton() onSingleton} but with {@link #needsSelf() needsSelf} always true.
*/
boolean constructor() default false;

/**
* Defines the method as public on the singleton class
* and as a private instance method.
* {@link needsSelf} is always false.
* {@link #needsSelf() needsSelf} is always false
* as it could be either a module or any receiver.
*/
boolean isModuleFunction() default false;

/** Whether <code>self</code> is passed as first argument to specializations. */
boolean needsSelf() default true;

int required() default 0;
Loading