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

Commits on Nov 16, 2015

  1. Copy the full SHA
    04418a3 View commit details
  2. Copy the full SHA
    5c5f637 View commit details
  3. Copy the full SHA
    d9650ee View commit details
  4. Copy the full SHA
    fa48f45 View commit details
  5. Copy the full SHA
    4a53a79 View commit details
  6. Copy the full SHA
    b4b1f54 View commit details
  7. Copy the full SHA
    03dab04 View commit details

Commits on Nov 17, 2015

  1. [Truffle] Pack comments.

    chrisseaton committed Nov 17, 2015
    Copy the full SHA
    394ba8f View commit details

Commits on Nov 28, 2015

  1. Copy the full SHA
    5515feb View commit details
  2. Copy the full SHA
    dd5c418 View commit details
  3. Add Save/RestoreBindingVisibilityInstr required for block execution

    * Execution plugged into InterpreterEngine.
    * No IR generated yet.
    subbuss committed Nov 28, 2015
    Copy the full SHA
    8e5f3e9 View commit details

Commits on Nov 29, 2015

  1. Copy the full SHA
    ff8306a View commit details
  2. Added one more instruction towards IR-instr based block invocation

    * Hooked up with interpreter.
    subbuss committed Nov 29, 2015
    Copy the full SHA
    d807cb2 View commit details
  3. Copy the full SHA
    f6db901 View commit details
  4. Copy the full SHA
    4a29011 View commit details
  5. Copy the full SHA
    a5e47e1 View commit details
  6. Copy the full SHA
    b5a4f37 View commit details
  7. Copy the full SHA
    78d7f16 View commit details
  8. [Truffle] Remove the hashCode check in String#== as currently it migh…

    …t require extra traversals.
    eregon committed Nov 29, 2015
    Copy the full SHA
    90fb2b7 View commit details

Commits on Nov 30, 2015

  1. Initial steps towards specialized block args preparation

    * This should eliminate a lot of useless overhead for the
      common case scenarios.
    
    * Still a whole bunch of work to be done + more specialized
      instructions to be created.
    subbuss committed Nov 30, 2015
    Copy the full SHA
    b0d2fc4 View commit details
  2. [Truffle] Reuse our translateDummyAssignment and read/write ivar do n…

    …ot need to be convertible to one another.
    eregon committed Nov 30, 2015
    Copy the full SHA
    673f26c View commit details
  3. Copy the full SHA
    a5d08c0 View commit details
  4. [Truffle] Remove unused field.

    eregon committed Nov 30, 2015
    Copy the full SHA
    178fc3d View commit details
  5. Copy the full SHA
    9893ba5 View commit details
  6. Copy the full SHA
    4a91f71 View commit details
  7. Copy the full SHA
    a40ae60 View commit details
  8. Copy the full SHA
    c53cd40 View commit details

Commits on Dec 1, 2015

  1. Copy the full SHA
    e593a98 View commit details
  2. Copy the full SHA
    bf0dbf4 View commit details
  3. [Truffle] Only get the caller frame if we need it in RegexpNodes.matc…

    …hCommon().
    
    * Fixes compilation issues of most gsub/gsub! and such.
    eregon committed Dec 1, 2015
    Copy the full SHA
    239a233 View commit details
  4. Copy the full SHA
    8b1a0fd View commit details
  5. Copy the full SHA
    8d284aa View commit details
  6. Remove some temp vars

    enebo committed Dec 1, 2015
    Copy the full SHA
    7455d05 View commit details

Commits on Dec 2, 2015

  1. Copy the full SHA
    d9f8005 View commit details
  2. Copy the full SHA
    4ac7662 View commit details
  3. Copy the full SHA
    3f18c0d View commit details
  4. Copy the full SHA
    14a18b1 View commit details
  5. [Truffle] Run the VerifyTruffleProcessor to detect TruffleBoundary/Vi…

    …rtualFrame conflicts at compilation time from maven.
    eregon committed Dec 2, 2015
    1
    Copy the full SHA
    7091d23 View commit details
  6. [Truffle] Simplify ReadHeadObjectFieldNode and ReadInstanceVariableNode.

    * Does potentially boxing but in the interpreter values are getting boxed across calls anyway.
    eregon committed Dec 2, 2015
    Copy the full SHA
    511b580 View commit details
  7. Copy the full SHA
    7457dde View commit details
  8. [Truffle] Clean up Fixnum#{<<,>>}.

    * Proper types, no transfer, lower the rhs before the node.
    eregon committed Dec 2, 2015
    Copy the full SHA
    f91a591 View commit details
  9. Copy the full SHA
    c7c9e30 View commit details

Commits on Dec 3, 2015

  1. [Truffle] Lower parameters to int or let the implicit cast to long.

    * Fixes lowerFixnumParameters on shift nodes.
    eregon committed Dec 3, 2015
    Copy the full SHA
    f01511d View commit details
  2. [Truffle] Do not contain other specializations in Fixnum#&.

    * Otherwise it gets to long in all cases in pure interpreter.
    eregon committed Dec 3, 2015
    Copy the full SHA
    92288e6 View commit details
  3. Copy the full SHA
    5a5fe17 View commit details
  4. Copy the full SHA
    4168709 View commit details
  5. [Truffle] Make sure the @Mask is a int in the Fixnum#& spec.

    * Since in interpreter nodes are not split, either of the two operations might return long.
    eregon committed Dec 3, 2015
    Copy the full SHA
    f2f03cd View commit details
  6. Copy the full SHA
    5b1b6ae View commit details
  7. [Truffle] Use ConditionProfile in FixnumOrBignumNode.

    * May also omit the BigInteger case in compiled code now.
    eregon committed Dec 3, 2015
    Copy the full SHA
    1dacc10 View commit details
  8. Copy the full SHA
    4dc9ffd View commit details
Showing with 12,637 additions and 2,968 deletions.
  1. +4 −0 COPYING
  2. +49 −14 core/src/main/java/org/jruby/Main.java
  3. +1 −1 core/src/main/java/org/jruby/RubyArray.java
  4. +3 −0 core/src/main/java/org/jruby/RubyClass.java
  5. +19 −15 core/src/main/java/org/jruby/RubyFloat.java
  6. +16 −7 core/src/main/java/org/jruby/RubyTime.java
  7. +23 −22 core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java
  8. +4 −5 core/src/main/java/org/jruby/ext/timeout/Timeout.java
  9. +5 −2 core/src/main/java/org/jruby/ir/IRClosure.java
  10. +6 −0 core/src/main/java/org/jruby/ir/IRVisitor.java
  11. +8 −1 core/src/main/java/org/jruby/ir/Operation.java
  12. +9 −3 core/src/main/java/org/jruby/ir/instructions/EQQInstr.java
  13. +37 −0 core/src/main/java/org/jruby/ir/instructions/PrepareBlockArgsInstr.java
  14. +30 −0 core/src/main/java/org/jruby/ir/instructions/PrepareFixedBlockArgsInstr.java
  15. +30 −0 core/src/main/java/org/jruby/ir/instructions/PrepareSingleBlockArgInstr.java
  16. +39 −0 core/src/main/java/org/jruby/ir/instructions/RestoreBindingVisibilityInstr.java
  17. +28 −0 core/src/main/java/org/jruby/ir/instructions/SaveBindingVisibilityInstr.java
  18. +43 −0 core/src/main/java/org/jruby/ir/instructions/UpdateBlockExecutionStateInstr.java
  19. +1 −0 core/src/main/java/org/jruby/ir/interpreter/InterpreterContext.java
  20. +39 −24 core/src/main/java/org/jruby/ir/interpreter/InterpreterEngine.java
  21. +118 −72 core/src/main/java/org/jruby/ir/passes/AddCallProtocolInstructions.java
  22. +4 −0 core/src/main/java/org/jruby/ir/representations/BasicBlock.java
  23. +189 −3 core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
  24. +73 −1 core/src/main/java/org/jruby/ir/targets/IRBytecodeAdapter.java
  25. +2 −42 core/src/main/java/org/jruby/ir/targets/IRBytecodeAdapter6.java
  26. +105 −12 core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
  27. +11 −3 core/src/main/java/org/jruby/runtime/Block.java
  28. +74 −25 core/src/main/java/org/jruby/runtime/BlockBody.java
  29. +35 −19 core/src/main/java/org/jruby/runtime/CompiledIRBlockBody.java
  30. +47 −20 core/src/main/java/org/jruby/runtime/IRBlockBody.java
  31. +16 −1 core/src/main/java/org/jruby/runtime/InterpretedIRBlockBody.java
  32. +41 −24 core/src/main/java/org/jruby/runtime/MixedModeIRBlockBody.java
  33. +1 −1 core/src/main/java/org/jruby/runtime/Signature.java
  34. +13 −33 core/src/main/java/org/jruby/runtime/ThreadContext.java
  35. +0 −3 core/src/main/java/org/jruby/util/Memo.java
  36. +93 −83 core/src/main/java/org/jruby/util/StringSupport.java
  37. +55 −13 lib/ruby/stdlib/cmath.rb
  38. +10 −11 lib/ruby/stdlib/fileutils.rb
  39. +3 −8 lib/ruby/stdlib/net/ftp.rb
  40. +1 −2 lib/ruby/stdlib/net/http.rb
  41. +6 −4 lib/ruby/stdlib/net/http/response.rb
  42. +7 −1 lib/ruby/stdlib/net/imap.rb
  43. +7 −1 lib/ruby/stdlib/time.rb
  44. +1 −0 lib/ruby/truffle/README.md
  45. +17 −0 lib/ruby/truffle/jruby+truffle/README.md
  46. +10 −0 lib/ruby/truffle/jruby+truffle/gem_configurations/activesupport.yaml
  47. +12 −0 lib/ruby/truffle/jruby+truffle/gem_configurations/openweather.yaml
  48. +77 −20 lib/ruby/truffle/jruby+truffle/runner.rb
  49. +23 −0 lib/ruby/truffle/pr-zlib/CHANGES
  50. +20 −0 lib/ruby/truffle/pr-zlib/MANIFEST
  51. +52 −0 lib/ruby/truffle/pr-zlib/README
  52. +116 −0 lib/ruby/truffle/pr-zlib/Rakefile
  53. +173 −0 lib/ruby/truffle/pr-zlib/bin/minizip.rb
  54. +21 −0 lib/ruby/truffle/pr-zlib/certs/djberg96_pub.pem
  55. +385 −0 lib/ruby/truffle/pr-zlib/examples/example_rbzlib.rb
  56. +1 −0 lib/ruby/truffle/pr-zlib/lib/pr-zlib.rb
  57. +5,079 −0 lib/ruby/truffle/pr-zlib/lib/pr/rbzlib.rb
  58. +1,567 −0 lib/ruby/truffle/pr-zlib/lib/pr/zlib.rb
  59. +24 −0 lib/ruby/truffle/pr-zlib/pr-zlib.gemspec
  60. +43 −0 lib/ruby/truffle/pr-zlib/profile/bench_pr_zlib.rb
  61. +43 −0 lib/ruby/truffle/pr-zlib/profile/bench_zlib.rb
  62. +28 −0 lib/ruby/truffle/pr-zlib/profile/profile_pr_zlib_read.rb
  63. +26 −0 lib/ruby/truffle/pr-zlib/profile/profile_pr_zlib_write.rb
  64. +133 −0 lib/ruby/truffle/pr-zlib/test/test_rbzlib.rb
  65. +76 −0 lib/ruby/truffle/pr-zlib/test/test_rbzlib_bytef.rb
  66. +56 −0 lib/ruby/truffle/pr-zlib/test/test_rbzlib_posf.rb
  67. +168 −0 lib/ruby/truffle/pr-zlib/test/test_zlib.rb
  68. +55 −0 lib/ruby/truffle/pr-zlib/test/test_zlib_deflate.rb
  69. +93 −0 lib/ruby/truffle/pr-zlib/test/test_zlib_gzip_file.rb
  70. +183 −0 lib/ruby/truffle/pr-zlib/test/test_zlib_gzip_reader.rb
  71. +186 −0 lib/ruby/truffle/pr-zlib/test/test_zlib_gzip_writer.rb
  72. +55 −0 lib/ruby/truffle/pr-zlib/test/test_zlib_inflate.rb
  73. +146 −0 lib/ruby/truffle/pr-zlib/test/test_zlib_zstream.rb
  74. +1 −1 lib/ruby/truffle/truffle/bigdecimal.rb
  75. +1 −250 lib/ruby/truffle/truffle/zlib.rb
  76. +1 −1 spec/ruby/fixtures/code/concurrent.rb
  77. +4 −0 spec/ruby/library/bigdecimal/new_spec.rb
  78. +0 −1 spec/tags/ruby/core/array/collect_tags.txt
  79. +0 −1 spec/tags/ruby/core/class/initialize_tags.txt
  80. +18 −15 spec/truffle/specs/truffle/attachments/attach_spec.rb
  81. +0 −54 spec/truffle/specs/truffle/attachments/detach_spec.rb
  82. +10 −3 spec/truffle/specs/truffle/binding_of_caller_spec.rb
  83. +1 −1 spec/truffle/specs/truffle/cext/load_extconf_spec.rb
  84. +40 −0 spec/truffle/specs/truffle/fixnum/and_spec.rb
  85. +2 −2 spec/truffle/specs/truffle/primitive/coverage_result_spec.rb
  86. +9 −2 spec/truffle/specs/truffle/source_of_caller_spec.rb
  87. +3 −0 spec/truffle/tags/library/zlib/crc32_tags.txt
  88. +0 −1 spec/truffle/tags/library/zlib/crc_table_tags.txt
  89. +0 −2 spec/truffle/tags/library/zlib/deflate/deflate_tags.txt
  90. +0 −1 spec/truffle/tags/library/zlib/deflate/set_dictionary_tags.txt
  91. +0 −1 spec/truffle/tags/library/zlib/gzipfile/close_tags.txt
  92. +0 −1 spec/truffle/tags/library/zlib/gzipfile/closed_tags.txt
  93. +0 −2 spec/truffle/tags/library/zlib/gzipfile/comment_tags.txt
  94. +0 −2 spec/truffle/tags/library/zlib/gzipfile/orig_name_tags.txt
  95. +0 −1 spec/truffle/tags/library/zlib/gzipreader/each_byte_tags.txt
  96. +0 −5 spec/truffle/tags/library/zlib/gzipreader/eof_tags.txt
  97. +0 −3 spec/truffle/tags/library/zlib/gzipreader/getc_tags.txt
  98. +0 −1 spec/truffle/tags/library/zlib/gzipreader/pos_tags.txt
  99. +0 −7 spec/truffle/tags/library/zlib/gzipreader/read_tags.txt
  100. +0 −3 spec/truffle/tags/library/zlib/gzipreader/rewind_tags.txt
  101. +0 −3 spec/truffle/tags/library/zlib/gzipwriter/mtime_tags.txt
  102. +0 −2 spec/truffle/tags/library/zlib/gzipwriter/write_tags.txt
  103. +0 −7 spec/truffle/tags/library/zlib/inflate/append_tags.txt
  104. +0 −5 spec/truffle/tags/library/zlib/inflate/inflate_tags.txt
  105. +0 −1 spec/truffle/tags/library/zlib/inflate/set_dictionary_tags.txt
  106. +0 −1 spec/truffle/tags/library/zlib/zstream/adler_tags.txt
  107. +0 −1 spec/truffle/tags/library/zlib/zstream/avail_in_tags.txt
  108. +0 −1 spec/truffle/tags/library/zlib/zstream/avail_out_tags.txt
  109. +0 −1 spec/truffle/tags/library/zlib/zstream/data_type_tags.txt
  110. +0 −1 spec/truffle/tags/library/zlib/zstream/flush_next_out_tags.txt
  111. +0 −3 spec/truffle/tags/truffle/array/max_tags.txt
  112. +0 −3 spec/truffle/tags/truffle/array/min_tags.txt
  113. +0 −3 spec/truffle/tags/truffle/attachments/attach_tags.txt
  114. +0 −2 spec/truffle/tags/truffle/binding_of_caller_tags.txt
  115. +0 −1 spec/truffle/tags/truffle/cext/load_extconf_tags.txt
  116. +0 −1 spec/truffle/tags/truffle/primitive/coverage_result_tags.txt
  117. +0 −1 spec/truffle/tags/truffle/primitive/coverage_start_tags.txt
  118. +0 −2 spec/truffle/tags/truffle/source_of_caller_tags.txt
  119. +1 −1 spec/truffle/truffle.mspec
  120. +8 −0 test/jruby/test_big_decimal.rb
  121. +1 −0 test/mri/excludes/TestEnumerable.rb
  122. +4 −1 test/mri/excludes/TestIO.rb
  123. +1 −0 test/mri/excludes/TestKeywordArguments.rb
  124. +3 −0 test/mri/excludes/TestMethod.rb
  125. +11 −9 test/mri/excludes/TestProcess.rb
  126. +1 −0 test/mri/excludes/TestRange.rb
  127. +3 −0 test/mri/excludes/TestString.rb
  128. +2 −1 test/mri/excludes/TestSymbol.rb
  129. +6 −7 test/mri/excludes/TestSyntax.rb
  130. +3 −0 test/mri/excludes/TestTimeExtension.rb
  131. +1 −0 test/mri/excludes/TestTimeout.rb
  132. +1 −0 test/mri/excludes_truffle/TestFloat.rb
  133. +2 −0 test/mri/excludes_truffle/TestMethod.rb
  134. +1 −0 test/mri/excludes_truffle/TestRange.rb
  135. +2 −0 test/mri/excludes_truffle/TestSymbol.rb
  136. +6 −0 test/mri/excludes_truffle/TestSyntax.rb
  137. +9 −0 test/mri/excludes_truffle/TestTimeExtension.rb
  138. +43 −6 test/mri/ruby/envutil.rb
  139. +43 −8 test/mri/ruby/test_array.rb
  140. +20 −3 test/mri/ruby/test_enum.rb
  141. +8 −0 test/mri/ruby/test_float.rb
  142. +97 −74 test/mri/ruby/test_io.rb
  143. +50 −3 test/mri/ruby/test_keyword.rb
  144. +36 −1 test/mri/ruby/test_method.rb
  145. +151 −112 test/mri/ruby/test_process.rb
  146. +8 −2 test/mri/ruby/test_range.rb
  147. +41 −91 test/mri/ruby/test_string.rb
  148. +56 −0 test/mri/ruby/test_symbol.rb
  149. +115 −6 test/mri/ruby/test_syntax.rb
  150. +99 −76 test/mri/test_time.rb
  151. +20 −3 test/mri/test_timeout.rb
  152. +11 −0 test/truffle/pe/core/string_pe.rb
  153. +6 −0 test/truffle/pe/language/ivar_pe.rb
  154. +13 −5 test/truffle/pe/pe.rb
  155. +9 −0 tool/jruby_eclipse
  156. +16 −16 tool/jt.rb
  157. +10 −0 tool/truffle-findbugs-exclude.xml
  158. +8 −1 truffle/pom.rb
  159. +18 −0 truffle/pom.xml
  160. +74 −0 truffle/src/main/antlr4/org/jruby/truffle/format/parser/Pack.g4
  161. +1 −1 truffle/src/main/java/org/jruby/truffle/format/nodes/write/PNode.java
  162. +2 −0 truffle/src/main/java/org/jruby/truffle/format/nodes/write/WriteBinaryStringNode.java
  163. +35 −38 truffle/src/main/java/org/jruby/truffle/format/nodes/write/WriteBitStringNode.java
  164. +17 −25 truffle/src/main/java/org/jruby/truffle/format/nodes/write/WriteHexStringNode.java
  165. +1 −1 truffle/src/main/java/org/jruby/truffle/format/parser/FormatParser.java
  166. +154 −0 truffle/src/main/java/org/jruby/truffle/format/parser/PackCompiler.java
  167. +34 −0 truffle/src/main/java/org/jruby/truffle/format/parser/PackErrorListener.java
  168. +0 −576 truffle/src/main/java/org/jruby/truffle/format/parser/PackParser.java
  169. +0 −128 truffle/src/main/java/org/jruby/truffle/format/parser/PackTokenizer.java
  170. +489 −0 truffle/src/main/java/org/jruby/truffle/format/parser/PackTreeBuilder.java
  171. +0 −15 truffle/src/main/java/org/jruby/truffle/format/runtime/Endianness.java
  172. +4 −4 truffle/src/main/java/org/jruby/truffle/nodes/core/EncodingNodes.java
  173. +16 −27 truffle/src/main/java/org/jruby/truffle/nodes/core/FixnumOrBignumNode.java
  174. +79 −19 truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
  175. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/ModuleNodes.java
  176. +1 −10 truffle/src/main/java/org/jruby/truffle/nodes/core/ObjectSpaceNodes.java
  177. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/RegexpNodes.java
  178. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/ThreadNodes.java
  179. +21 −16 truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
  180. +3 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/array/ArrayGuards.java
  181. +42 −17 truffle/src/main/java/org/jruby/truffle/nodes/core/array/ArrayNodes.java
  182. +36 −24 truffle/src/main/java/org/jruby/truffle/nodes/core/fixnum/FixnumNodes.java
  183. +3 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/hash/HashGuards.java
  184. +37 −16 truffle/src/main/java/org/jruby/truffle/nodes/ext/BigDecimalNodes.java
  185. +0 −203 truffle/src/main/java/org/jruby/truffle/nodes/ext/ZlibNodes.java
  186. +37 −38 truffle/src/main/java/org/jruby/truffle/nodes/ext/psych/PsychParserNodes.java
  187. +52 −0 truffle/src/main/java/org/jruby/truffle/nodes/globals/ReadGlobalVariableNode.java
  188. +2 −8 truffle/src/main/java/org/jruby/truffle/nodes/globals/ReadLastBacktraceNode.java
  189. +54 −0 truffle/src/main/java/org/jruby/truffle/nodes/globals/ReadThreadLocalGlobalVariableNode.java
  190. +2 −6 truffle/src/main/java/org/jruby/truffle/nodes/globals/UpdateLastBacktraceNode.java
  191. +49 −0 truffle/src/main/java/org/jruby/truffle/nodes/globals/WriteGlobalVariableNode.java
  192. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/interop/InteropNode.java
  193. +14 −5 truffle/src/main/java/org/jruby/truffle/nodes/literal/StringLiteralNode.java
  194. +1 −2 truffle/src/main/java/org/jruby/truffle/nodes/locals/ReadDeclarationVariableNode.java
  195. +24 −0 truffle/src/main/java/org/jruby/truffle/nodes/locals/ReadLocalNode.java
  196. +1 −2 truffle/src/main/java/org/jruby/truffle/nodes/locals/ReadLocalVariableNode.java
  197. +1 −7 truffle/src/main/java/org/jruby/truffle/nodes/locals/WriteDeclarationVariableNode.java
  198. +1 −7 truffle/src/main/java/org/jruby/truffle/nodes/locals/WriteLocalVariableNode.java
  199. +1 −6 truffle/src/main/java/org/jruby/truffle/nodes/objects/IsFrozenNode.java
  200. +1 −6 truffle/src/main/java/org/jruby/truffle/nodes/objects/IsTaintedNode.java
  201. +10 −80 truffle/src/main/java/org/jruby/truffle/nodes/objects/ReadInstanceVariableNode.java
  202. +2 −72 truffle/src/main/java/org/jruby/truffle/nodes/objects/WriteInstanceVariableNode.java
  203. +2 −87 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadHeadObjectFieldNode.java
  204. +2 −12 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/IOPrimitiveNodes.java
  205. +1 −7 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ObjectPrimitiveNodes.java
  206. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/RegexpPrimitiveNodes.java
  207. +3 −4 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/StringPrimitiveNodes.java
  208. +8 −5 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/TimePrimitiveNodes.java
  209. +3 −0 truffle/src/main/java/org/jruby/truffle/nodes/supercall/LookupSuperMethodNode.java
  210. +1 −3 truffle/src/main/java/org/jruby/truffle/runtime/RubyObjectType.java
  211. +6 −5 truffle/src/main/java/org/jruby/truffle/runtime/core/CoreLibrary.java
  212. +0 −1 truffle/src/main/java/org/jruby/truffle/runtime/core/StringOperations.java
  213. +1 −1 truffle/src/main/java/org/jruby/truffle/runtime/layouts/ThreadLayout.java
  214. +2 −16 truffle/src/main/java/org/jruby/truffle/runtime/subsystems/AttachmentsManager.java
  215. +5 −2 truffle/src/main/java/org/jruby/truffle/runtime/subsystems/SafepointManager.java
  216. +2 −2 truffle/src/main/java/org/jruby/truffle/runtime/subsystems/ThreadManager.java
  217. +31 −61 truffle/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
  218. +3 −2 truffle/src/main/java/org/jruby/truffle/translator/LoadArgumentsTranslator.java
  219. +0 −26 truffle/src/main/java/org/jruby/truffle/translator/ReadNode.java
  220. +5 −3 truffle/src/main/java/org/jruby/truffle/translator/TranslatorEnvironment.java
  221. +0 −25 truffle/src/main/java/org/jruby/truffle/translator/WriteNode.java
  222. +1 −0 truffle/src/main/ruby/core.rb
  223. +18 −0 truffle/src/main/ruby/core/rubinius/api/shims/stat.rb
  224. +7 −0 truffle/src/main/ruby/core/shims.rb
  225. +2 −2 truffle/src/main/ruby/core/thread.rb
  226. +17 −13 truffle/src/main/ruby/core/truffle/attachments.rb
4 changes: 4 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
@@ -78,6 +78,10 @@ below. Also see LICENSE.RUBY for most files found in lib/ruby/stdlib.
Some parts of the RubySL implementations of the stdlib in lib/ruby/truffle/rubysl
are copyright (c) 2013 Brian Shirai and are licensed under the 3-clause BSD license.

pr-zlib is copyright Park Heesob and Daniel Berger. "This library is covered
under the same license as zlib itself. For the text of the zlib license,
please see http://zlib.net/zlib_license.html."

The complete text of the Eclipse Public License is as follows:

Eclipse Public License - v 1.0
63 changes: 49 additions & 14 deletions core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
package org.jruby;

import org.jruby.exceptions.MainExitException;
import org.jruby.exceptions.JumpException;
import org.jruby.exceptions.RaiseException;
import org.jruby.exceptions.ThreadKill;
import org.jruby.main.DripMain;
@@ -205,9 +206,14 @@ public static void main(String[] args) {
if (status.isExit()) {
System.exit(status.getStatus());
}
} catch (RaiseException rj) {
System.exit(handleRaiseException(rj));
} catch (Throwable t) {
}
catch (RaiseException ex) {
System.exit( handleRaiseException(ex) );
}
catch (JumpException ex) {
System.exit( handleUnexpectedJump(ex) );
}
catch (Throwable t) {
// If a Truffle exception gets this far it's a hard failure - don't try and dress it up as a Ruby exception

if (main.config.getCompileMode() == RubyInstanceConfig.CompileMode.TRUFFLE) {
@@ -516,25 +522,54 @@ private void doCheckSecurityManager() {
* run should be System.err. In order to avoid the Ruby err being closed and unable
* to write, we use System.err unconditionally.
*
* @param rj
* @param ex
* @return
*/
protected static int handleRaiseException(RaiseException rj) {
RubyException raisedException = rj.getException();
Ruby runtime = raisedException.getRuntime();
if (runtime.getSystemExit().isInstance(raisedException)) {
protected static int handleRaiseException(final RaiseException ex) {
RubyException raisedException = ex.getException();
final Ruby runtime = raisedException.getRuntime();
if ( runtime.getSystemExit().isInstance(raisedException) ) {
IRubyObject status = raisedException.callMethod(runtime.getCurrentContext(), "status");
if (status != null && !status.isNil()) {
if (status != null && ! status.isNil()) {
return RubyNumeric.fix2int(status);
} else {
return 0;
}
} else {
System.err.print(runtime.getInstanceConfig().getTraceType().printBacktrace(raisedException, runtime.getPosix().isatty(FileDescriptor.err)));
return 1;
return 0;
}
System.err.print(runtime.getInstanceConfig().getTraceType().printBacktrace(raisedException, runtime.getPosix().isatty(FileDescriptor.err)));
return 1;
}

private static int handleUnexpectedJump(final JumpException ex) {
if ( ex instanceof JumpException.SpecialJump ) { // ex == JumpException.SPECIAL_JUMP
System.err.println("Unexpected break: " + ex);
}
else if ( ex instanceof JumpException.FlowControlException ) {
// NOTE: assuming a single global runtime main(args) should have :
if ( Ruby.isGlobalRuntimeReady() ) {
final Ruby runtime = Ruby.getGlobalRuntime();
RaiseException raise = ((JumpException.FlowControlException) ex).buildException(runtime);
if ( raise != null ) handleRaiseException(raise);
}
else {
System.err.println("Unexpected jump: " + ex);
}
}
else {
System.err.println("Unexpected: " + ex);
}

final StackTraceElement[] trace = ex.getStackTrace();
if ( trace != null && trace.length > 0 ) {
System.err.println( ThreadContext.createRawBacktraceStringFromThrowable(ex, false) );
}
else {
System.err.println("HINT: to get backtrace for jump exceptions run with -Xjump.backtrace=true");
}

// TODO: should match MRI (>= 2.2.3) exit status - @see ruby/test_enum.rb#test_first
return 2;
}

public static void printTruffleTimeMetric(String id) {
if (Options.TRUFFLE_METRICS_TIME.load()) {
final long millis = System.currentTimeMillis();
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
@@ -2341,7 +2341,7 @@ public RubyArray collectBang(ThreadContext context, Block block) {
*/
@JRubyMethod(name = "collect!")
public IRubyObject collect_bang(ThreadContext context, Block block) {
return block.isGiven() ? collectBang(context, block) : enumeratorize(context.runtime, this, "collect!");
return block.isGiven() ? collectBang(context, block) : enumeratorizeWithSize(context, this, "collect!", enumLengthFn());
}

/** rb_ary_collect_bang
3 changes: 3 additions & 0 deletions core/src/main/java/org/jruby/RubyClass.java
Original file line number Diff line number Diff line change
@@ -1138,6 +1138,9 @@ public static void checkInheritable(IRubyObject superClass) {
if (((RubyClass)superClass).isSingleton()) {
throw superClass.getRuntime().newTypeError("can't make subclass of virtual class");
}
if (superClass == superClass.getRuntime().getClassClass()) {
throw superClass.getRuntime().newTypeError("can't make subclass of Class");
}
}

public final ObjectMarshal getMarshal() {
34 changes: 19 additions & 15 deletions core/src/main/java/org/jruby/RubyFloat.java
Original file line number Diff line number Diff line change
@@ -651,34 +651,38 @@ public IRubyObject op_le(ThreadContext context, double other) {
@JRubyMethod(name = "eql?", required = 1)
@Override
public IRubyObject eql_p(IRubyObject other) {
if (other instanceof RubyFloat) {
double b = ((RubyFloat) other).value;
if (Double.isNaN(value) || Double.isNaN(b)) {
return getRuntime().getFalse();
}
if (value == b) {
return getRuntime().getTrue();
}
}
return getRuntime().getFalse();
return getRuntime().newBoolean( equals(other) );
}

@Override
public boolean equals(Object other) {
return (other instanceof RubyFloat) && equals((RubyFloat) other);
}

private boolean equals(RubyFloat that) {
if ( Double.isNaN(this.value) || Double.isNaN(that.value) ) return false;
final double val1 = this.value == -0.0 ? 0.0 : this.value;
final double val2 = that.value == -0.0 ? 0.0 : that.value;
return Double.doubleToLongBits(val1) == Double.doubleToLongBits(val2);
}

/** flo_hash
*
*/
@JRubyMethod(name = "hash")
@Override
public RubyFixnum hash() {
return getRuntime().newFixnum(hashCode());
return getRuntime().newFixnum( hashCode() );
}

@Override
public final int hashCode() {
long l = Double.doubleToLongBits(value);
return (int)(l ^ l >>> 32);
}
final double val = value == 0.0 ? -0.0 : value;
final long l = Double.doubleToLongBits(val);
return (int) ( l ^ l >>> 32 );
}

/** flo_fo
/** flo_fo
*
*/
@JRubyMethod(name = "to_f")
23 changes: 16 additions & 7 deletions core/src/main/java/org/jruby/RubyTime.java
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@

import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
@@ -81,9 +82,10 @@
@JRubyClass(name="Time", include="Comparable")
public class RubyTime extends RubyObject {
public static final String UTC = "UTC";
public static final BigDecimal ONE_MILLION_BD = new BigDecimal(1000000);
@Deprecated // no longer used
public static final BigDecimal ONE_MILLION_BD = BigDecimal.valueOf(1000000);
public static final BigInteger ONE_MILLION_BI = BigInteger.valueOf(1000000);
public static final BigDecimal ONE_THOUSAND_BD = new BigDecimal(1000);
public static final BigDecimal ONE_THOUSAND_BD = BigDecimal.valueOf(1000);
private DateTime dt;
private long nsec;

@@ -1058,12 +1060,19 @@ public static IRubyObject at(ThreadContext context, IRubyObject recv, IRubyObjec
long numerator = rational.numerator(context).convertToInteger().getLongValue();
long denominator = rational.denominator(context).convertToInteger().getLongValue();

BigDecimal accurateSeconds = new BigDecimal(numerator).divide(new BigDecimal(denominator));
BigDecimal accurateMillis = accurateSeconds.multiply(ONE_THOUSAND_BD);
BigInteger integralMillis = accurateMillis.toBigInteger();
BigInteger remainingNanos = accurateMillis.multiply(ONE_MILLION_BD).toBigInteger().subtract(integralMillis.multiply(ONE_MILLION_BI));
final BigDecimal secs;
if ( numerator <= Integer.MAX_VALUE ) {
secs = new BigDecimal(numerator * 1000);
}
else {
secs = BigDecimal.valueOf(numerator).multiply(ONE_THOUSAND_BD);
}
final BigDecimal millis = secs.divide(BigDecimal.valueOf(denominator), 12, RoundingMode.DOWN);

final BigInteger roundMillis = millis.toBigInteger();
BigInteger remainingNanos = millis.movePointRight(6).toBigInteger().subtract( roundMillis.multiply(ONE_MILLION_BI) );

millisecs = integralMillis.longValue();
millisecs = roundMillis.longValue();
nanosecs = remainingNanos.longValue();
}
} else {
45 changes: 23 additions & 22 deletions core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java
Original file line number Diff line number Diff line change
@@ -506,24 +506,21 @@ private static RubyBigDecimal newInstance(ThreadContext context, IRubyObject rec
String strValue = arg.convertToString().toString().trim();

int sign = 1;
if(strValue.length() > 0) {
switch (strValue.charAt(0)) {
case '_' :
return newZero(context.runtime, 1); // leading "_" are not allowed
case 'N' :
if ( "NaN".equals(strValue) ) return newNaN(context.runtime);
break;
case 'I' :
if ( "Infinity".equals(strValue) ) return newInfinity(context.runtime, 1);
break;
case '-' :
if ( "-Infinity".equals(strValue) ) return newInfinity(context.runtime, -1);
sign = -1;
break;
case '+' :
if ( "+Infinity".equals(strValue) ) return newInfinity(context.runtime, +1);
break;
}
switch ( strValue.length() > 0 ? strValue.charAt(0) : ' ' ) {
case '_' : return newZero(context.runtime, 1); // leading "_" are not allowed
case 'N' :
if ( "NaN".equals(strValue) ) return newNaN(context.runtime);
break;
case 'I' :
if ( "Infinity".equals(strValue) ) return newInfinity(context.runtime, 1);
break;
case '-' :
if ( "-Infinity".equals(strValue) ) return newInfinity(context.runtime, -1);
sign = -1;
break;
case '+' :
if ( "+Infinity".equals(strValue) ) return newInfinity(context.runtime, +1);
break;
}

// Convert String to Java understandable format (for BigDecimal).
@@ -533,17 +530,21 @@ private static RubyBigDecimal newInstance(ThreadContext context, IRubyObject rec
Matcher matcher = NUMBER_PATTERN.matcher(strValue);
strValue = matcher.replaceFirst("$1"); // 3. MRI ignores the trailing junk

String exp = matcher.group(2);
if(!exp.isEmpty()) {
String exp = matcher.group(2); int idx;
if ( exp != null && ! exp.isEmpty() ) {
String expValue = matcher.group(3);
if (expValue.isEmpty() || expValue.equals("-") || expValue.equals("+")) {
strValue = strValue.concat("0"); // 4. MRI allows 1E, 1E-, 1E+
} else if (isExponentOutOfRange(expValue)) {
}
else if (isExponentOutOfRange(expValue)) {
// Handle infinity (Integer.MIN_VALUE + 1) < expValue < Integer.MAX_VALUE
return newInfinity(context.runtime, sign);
}
}

else if ( ( idx = matcher.start(3) ) > 0 ) {
strValue = strValue.substring(0, idx); // ignored tail junk e.g. "5-6" -> "-6"
}

BigDecimal decimal;
try {
decimal = new BigDecimal(strValue, mathContext);
9 changes: 4 additions & 5 deletions core/src/main/java/org/jruby/ext/timeout/Timeout.java
Original file line number Diff line number Diff line change
@@ -46,7 +46,6 @@
import org.jruby.anno.JRubyMethod;
import org.jruby.exceptions.RaiseException;
import org.jruby.runtime.Helpers;
import org.jruby.runtime.Arity;
import org.jruby.runtime.Block;
import org.jruby.runtime.ThreadContext;
import static org.jruby.runtime.Visibility.*;
@@ -58,9 +57,9 @@
public class Timeout implements Library {
public void load(Ruby runtime, boolean wrap) throws IOException {
RubyModule timeout = runtime.defineModule("Timeout");
RubyClass superclass = runtime.getRuntimeError();
RubyClass timeoutError = runtime.defineClassUnder("Error", superclass, superclass.getAllocator(), timeout);
runtime.defineClassUnder("ExitException", runtime.getException(), runtime.getException().getAllocator(), timeout);
RubyClass RuntimeError = runtime.getRuntimeError();
RubyClass TimeoutError = runtime.defineClassUnder("Error", RuntimeError, RuntimeError.getAllocator(), timeout);
timeout.defineConstant("ExitException", TimeoutError);

// Here we create an "anonymous" exception type used for unrolling the stack.
// MRI creates a new one for *every call* to timeout, which can be costly.
@@ -76,7 +75,7 @@ public void load(Ruby runtime, boolean wrap) throws IOException {
timeout.defineAnnotatedMethods(Timeout.class);

// Toplevel defines
runtime.getObject().defineConstant("TimeoutError", timeoutError);
runtime.getObject().defineConstant("TimeoutError", TimeoutError);
runtime.getObject().defineAnnotatedMethods(TimeoutToplevel.class);
}

7 changes: 5 additions & 2 deletions core/src/main/java/org/jruby/ir/IRClosure.java
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
import org.jruby.runtime.BlockBody;
import org.jruby.runtime.IRBlockBody;
import org.jruby.runtime.MixedModeIRBlockBody;
import org.jruby.runtime.InterpretedIRBlockBody;
import org.jruby.runtime.Signature;
import org.objectweb.asm.Handle;

@@ -67,7 +68,8 @@ protected IRClosure(IRClosure c, IRScope lexicalParent, int closureId, String fu
if (getManager().isDryRun()) {
this.body = null;
} else {
this.body = new MixedModeIRBlockBody(c, c.getSignature());
boolean shouldJit = getManager().getInstanceConfig().getCompileMode().shouldJIT();
this.body = shouldJit ? new MixedModeIRBlockBody(c, c.getSignature()) : new InterpretedIRBlockBody(c, c.getSignature());
}

this.signature = c.signature;
@@ -90,7 +92,8 @@ public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, Stati
if (getManager().isDryRun()) {
this.body = null;
} else {
this.body = new MixedModeIRBlockBody(this, signature);
boolean shouldJit = manager.getInstanceConfig().getCompileMode().shouldJIT();
this.body = shouldJit ? new MixedModeIRBlockBody(this, signature) : new InterpretedIRBlockBody(this, signature);
if (staticScope != null && !isBeginEndBlock) {
staticScope.setIRScope(this);
staticScope.setScopeType(this.getScopeType());
6 changes: 6 additions & 0 deletions core/src/main/java/org/jruby/ir/IRVisitor.java
Original file line number Diff line number Diff line change
@@ -88,6 +88,9 @@ private void error(Object object) {
public void PopBindingInstr(PopBindingInstr popbindinginstr) { error(popbindinginstr); }
public void PopBlockFrameInstr(PopBlockFrameInstr instr) { error(instr); }
public void PopMethodFrameInstr(PopMethodFrameInstr instr) { error(instr); }
public void PrepareBlockArgsInstr(PrepareBlockArgsInstr instr) { error(instr); }
public void PrepareFixedBlockArgsInstr(PrepareFixedBlockArgsInstr instr) { error(instr); }
public void PrepareSingleBlockArgInstr(PrepareSingleBlockArgInstr instr) { error(instr); }
public void ProcessModuleBodyInstr(ProcessModuleBodyInstr processmodulebodyinstr) { error(processmodulebodyinstr); }
public void PutClassVariableInstr(PutClassVariableInstr putclassvariableinstr) { error(putclassvariableinstr); }
public void PutConstInstr(PutConstInstr putconstinstr) { error(putconstinstr); }
@@ -112,8 +115,10 @@ private void error(Object object) {
public void ReqdArgMultipleAsgnInstr(ReqdArgMultipleAsgnInstr reqdargmultipleasgninstr) { error(reqdargmultipleasgninstr); }
public void RescueEQQInstr(RescueEQQInstr rescueeqqinstr) { error(rescueeqqinstr); }
public void RestArgMultipleAsgnInstr(RestArgMultipleAsgnInstr restargmultipleasgninstr) { error(restargmultipleasgninstr); }
public void RestoreBindingVisibilityInstr(RestoreBindingVisibilityInstr instr) { error(instr); }
public void ReturnInstr(ReturnInstr returninstr) { error(returninstr); }
public void RuntimeHelperCall(RuntimeHelperCall runtimehelpercall) { error(runtimehelpercall); }
public void SaveBindingVisibilityInstr(SaveBindingVisibilityInstr instr) { error(instr); }
public void SearchConstInstr(SearchConstInstr searchconstinstr) { error(searchconstinstr); }
public void SetCapturedVarInstr(SetCapturedVarInstr instr) { error(instr); }
public void StoreLocalVarInstr(StoreLocalVarInstr storelocalvarinstr) { error(storelocalvarinstr); }
@@ -123,6 +128,7 @@ private void error(Object object) {
public void ToAryInstr(ToAryInstr toaryinstr) { error(toaryinstr); }
public void UndefMethodInstr(UndefMethodInstr undefmethodinstr) { error(undefmethodinstr); }
public void UnresolvedSuperInstr(UnresolvedSuperInstr unresolvedsuperinstr) { error(unresolvedsuperinstr); }
public void UpdateBlockExecutionStateInstr (UpdateBlockExecutionStateInstr instr) { error(instr); }
public void YieldInstr(YieldInstr yieldinstr) { error(yieldinstr); }
public void ZeroOperandArgNoBlockCallInstr(ZeroOperandArgNoBlockCallInstr zeroOperandArgNoBlockCallInstr) { error(zeroOperandArgNoBlockCallInstr); }
public void ZSuperInstr(ZSuperInstr zsuperinstr) { error(zsuperinstr); }
9 changes: 8 additions & 1 deletion core/src/main/java/org/jruby/ir/Operation.java
Original file line number Diff line number Diff line change
@@ -211,7 +211,14 @@ public enum Operation {
PUSH_BLOCK_BINDING(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect),
POP_BLOCK_FRAME(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect),
POP_BINDING(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect),
TOGGLE_BACKTRACE(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect);
SAVE_BINDING_VIZ(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect),
RESTORE_BINDING_VIZ(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect),
TOGGLE_BACKTRACE(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect),
UPDATE_BLOCK_STATE(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect),

PREPARE_BLOCK_ARGS(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect),
PREPARE_SINGLE_BLOCK_ARG(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect),
PREPARE_FIXED_BLOCK_ARGS(OpFlags.f_is_book_keeping_op | OpFlags.f_has_side_effect);

public final OpClass opClass;
private int flags;
Loading