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

Commits on Mar 11, 2016

  1. Copy the full SHA
    c2c7681 View commit details
  2. Fix typo.

    headius committed Mar 11, 2016
    Copy the full SHA
    82665d4 View commit details
  3. Copy the full SHA
    39ea617 View commit details
  4. Copy the full SHA
    c8dae65 View commit details
  5. Various improvements for Java class "initializers".

    * Use ClassValue to cache reflection arrays, avoiding clones.
    * Avoid using implicit for-loop Iterator when numeric works.
    * Reduce use of intermediate collections.
    headius committed Mar 11, 2016
    Copy the full SHA
    c85e5c7 View commit details
  6. Improvements to runtime annotated method binding.

    * Cache declared methods as in Initializer.
    * Cache TypePopulator instance since some classes are used to
      populate multiple Ruby types.
    headius committed Mar 11, 2016
    Copy the full SHA
    ce1557f View commit details
  7. Copy the full SHA
    91cd296 View commit details
  8. Add jit.kernel property to enable jit during kernel boot.

    Useful with -Xjit.threshold=0 to see kernel in boot stacktrace.
    headius committed Mar 11, 2016
    Copy the full SHA
    7c4322d View commit details
  9. Cut out middle-man and use FrozenString here.

    Also add Stringable interface to FrozenString and StringLiteral
    so they can be used interchangeably when only the java.lang.String
    is needed.
    headius committed Mar 11, 2016
    Copy the full SHA
    b1a6564 View commit details
  10. Copy the full SHA
    9153317 View commit details
  11. Copy the full SHA
    6c03786 View commit details

Commits on Mar 14, 2016

  1. Copy the full SHA
    949216a View commit details
  2. Fix up how our 223 engine encodes input and decodes output.

    * Incoming scripts should be decoded from String to byte[] using
      default internal encoding, rather than trusting JDK's
      file.encoding to be appropriate.
    * Outgoing streams wrapping writers should decode strings based
      on current default internal encoding.
    
    Fixes #2403
    headius committed Mar 14, 2016
    Copy the full SHA
    e02641b View commit details
  3. Copy the full SHA
    9326df8 View commit details
  4. Copy the full SHA
    cb6e0bb View commit details
  5. Add --verbose flag. Fixes #3653.

    headius committed Mar 14, 2016
    Copy the full SHA
    b3d952c View commit details
  6. Copy the full SHA
    b3e23e5 View commit details
  7. Copy the full SHA
    4d97a89 View commit details
  8. Copy the full SHA
    5837373 View commit details
  9. Fix up non-native popen init and closing logic wrt write streams.

    MRI uses a hidden attribute on IO objects made up of two separate
    read and write streams (tied_io_for_writing), when it must wrap
    those streams as if they're a single IO. This is the case for
    popen, and so we put the write stream into this "tied" field.
    
    However, we're only supposed to use the tied field when there's
    already a read stream. When there's just a write stream, as in
    
    The other part of this patch fixes the close logic for non-native
    popen, so that it will check if either the main stream or the
    "tied" stream is open before deciding whether to close it. The old
    logic only considered the primary stream.
    
    The first part of this patch (not using "tied" when only writing)
    hides the failure fixed by the second part of this patch since we
    see a single-stream normal IO and the original bug does not
    happen.
    
    Note that this probably regressed in 9k because we started using
    this "tied" field most places, but the non-native popen bits were
    not updated to test it. If we work on getting more tests green on
    Windows we should be able to find and eliminate these
    discrepancies.
    
    Fixes #3473.
    headius committed Mar 14, 2016
    Copy the full SHA
    16aef81 View commit details
  10. Copy the full SHA
    fb71835 View commit details
  11. Copy the full SHA
    9d3d6dd View commit details
  12. [Truffle] Fixed a bad guard.

    nirvdrum committed Mar 14, 2016
    Copy the full SHA
    c289445 View commit details
  13. Tweaks to --disable to pass TestRubyOptions#test_disable.

    * Fix handling of "--disable foo"
    * Add did_you_mean to features
    * Use err, not out, for printing command line errors
    * Do not display usage for "--disable" with no argument
    headius committed Mar 14, 2016
    Copy the full SHA
    5de0bdd View commit details
  14. Copy the full SHA
    768f9fd View commit details
  15. Add concept of "features" to arg processing and hook up --enable

    This fixes MRI's TestRubyOptions#test_enable.
    headius committed Mar 14, 2016
    Copy the full SHA
    ef64d7e View commit details
  16. Copy the full SHA
    7171956 View commit details
  17. Copy the full SHA
    7428442 View commit details
  18. Copy the full SHA
    849d30d View commit details
  19. Copy the full SHA
    992962d View commit details
  20. Copy the full SHA
    bb470cb View commit details
  21. Copy the full SHA
    a347cd3 View commit details
  22. Copy the full SHA
    cf62adb View commit details
  23. 2
    Copy the full SHA
    60a2a84 View commit details
  24. [Truffle] j+tr: formatting

    pitr-ch committed Mar 14, 2016
    Copy the full SHA
    0d786cd View commit details
  25. Copy the full SHA
    bb2fa00 View commit details
  26. Copy the full SHA
    1fd82ea View commit details

Commits on Mar 15, 2016

  1. Copy the full SHA
    d708499 View commit details
  2. Copy the full SHA
    6b52440 View commit details
  3. [Truffle] Formatting.

    chrisseaton committed Mar 15, 2016
    Copy the full SHA
    9159938 View commit details

Commits on Mar 16, 2016

  1. Various improvements to dregexp processing.

    * Ensure only one regexp is ever cached for //o
    
    This is done using an AtomicReference in the compiled method for
    JVM6 and a field + atomic updater in the indy call site. In both
    cases, we may end up evaluating the operands twice, and the code
    that produced them may still run after caching (a bug,
    #2798), but we will at least guarantee to return
    exactly one regexp.
    
    * Add non-boxed paths to construct dregexp with up to 5 elements.
    
    * Add a ThreadContext-local Encoding[1] to use for encoding
      negotiation when preprocessing the dregexp elements.
    
    * If, at JIT time, a once-dregexp has already been encountered and
      cached in the instr, just emit that regexp directly into the
      bytecode.
    
    This new logic is faster than what we had before, likely because
    the locking I put in place for JVM6 was preventing the JVM from
    jitting (punted out with "COMPILE SKIPPED: invalid parsing" due
    to a flaw in my code). This new logic is lighter-weight and JITs
    fine. Given the benchmark from #3735:
    
    9.0.5:  3.87s
    9.1:    0.70s
    1.7.24: 0.72s
    headius committed Mar 16, 2016
    Copy the full SHA
    256e753 View commit details
  2. Preallocate blocking task for strscan.

    For #3735, though it has only a minor impact on a scan bench.
    headius committed Mar 16, 2016
    Copy the full SHA
    a1dbe82 View commit details
  3. Copy the full SHA
    b8b7b48 View commit details
  4. Always use invokeynamic to lookup and cache constants.

    * This adds a hard requirement on Java 7+. However, we crossed
      that line some time ago.
    * Indy can take long to warm up. However, this case is a very
      simple chain of handles.
    * This improves the performance of constant lookup, since JVM6 did
      not do any caching.
    headius committed Mar 16, 2016
    Copy the full SHA
    e03c4f1 View commit details
  5. Copy the full SHA
    2c038eb View commit details
  6. Copy the full SHA
    797aea4 View commit details
  7. Copy the full SHA
    6d4af5a View commit details
  8. Copy the full SHA
    8c35779 View commit details
  9. Copy the full SHA
    6c1411a View commit details
  10. Copy the full SHA
    f77ee64 View commit details
Showing with 3,886 additions and 2,648 deletions.
  1. +4 −2 .travis.yml
  2. +1 −5 bin/jruby.bash
  3. +1 −1 bin/jruby.sh
  4. +1 −1 core/pom.rb
  5. +1 −1 core/pom.xml
  6. +19 −13 core/src/main/java/org/jruby/Main.java
  7. +8 −0 core/src/main/java/org/jruby/Ruby.java
  8. +12 −2 core/src/main/java/org/jruby/RubyClass.java
  9. +16 −9 core/src/main/java/org/jruby/RubyDir.java
  10. +12 −1 core/src/main/java/org/jruby/RubyEnumerator.java
  11. +145 −81 core/src/main/java/org/jruby/RubyFile.java
  12. +5 −1 core/src/main/java/org/jruby/RubyHash.java
  13. +13 −15 core/src/main/java/org/jruby/RubyIO.java
  14. +3 −3 core/src/main/java/org/jruby/RubyInstanceConfig.java
  15. +19 −12 core/src/main/java/org/jruby/RubyModule.java
  16. +115 −26 core/src/main/java/org/jruby/RubyRegexp.java
  17. +3 −7 core/src/main/java/org/jruby/RubyString.java
  18. +11 −5 core/src/main/java/org/jruby/RubyThread.java
  19. +20 −5 core/src/main/java/org/jruby/anno/TypePopulator.java
  20. +15 −4 core/src/main/java/org/jruby/ast/RootNode.java
  21. +2 −2 core/src/main/java/org/jruby/exceptions/RaiseException.java
  22. +39 −31 core/src/main/java/org/jruby/ext/coverage/CoverageData.java
  23. +7 −3 core/src/main/java/org/jruby/ext/coverage/CoverageModule.java
  24. +0 −4 core/src/main/java/org/jruby/ext/ffi/StructLayout.java
  25. +3 −2 core/src/main/java/org/jruby/ext/ffi/jffi/CallbackManager.java
  26. +62 −47 core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java
  27. +42 −22 core/src/main/java/org/jruby/ext/strscan/RubyStringScanner.java
  28. +0 −1 core/src/main/java/org/jruby/ext/zlib/RubyZlib.java
  29. +31 −31 core/src/main/java/org/jruby/internal/runtime/ThreadService.java
  30. +1 −1 core/src/main/java/org/jruby/internal/runtime/methods/InterpretedIRMethod.java
  31. +1 −1 core/src/main/java/org/jruby/internal/runtime/methods/MixedModeIRMethod.java
  32. +21 −9 core/src/main/java/org/jruby/ir/IRBuilder.java
  33. +17 −3 core/src/main/java/org/jruby/ir/IRClosure.java
  34. +1 −0 core/src/main/java/org/jruby/ir/IRFlags.java
  35. +4 −2 core/src/main/java/org/jruby/ir/IRMethod.java
  36. +7 −2 core/src/main/java/org/jruby/ir/IRScopeType.java
  37. +4 −2 core/src/main/java/org/jruby/ir/Operation.java
  38. +5 −5 core/src/main/java/org/jruby/ir/instructions/RuntimeHelperCall.java
  39. +1 −1 core/src/main/java/org/jruby/ir/operands/FrozenString.java
  40. +1 −1 core/src/main/java/org/jruby/ir/operands/StringLiteral.java
  41. +8 −0 core/src/main/java/org/jruby/ir/operands/Stringable.java
  42. +7 −2 core/src/main/java/org/jruby/ir/operands/TemporaryVariableType.java
  43. +2 −2 core/src/main/java/org/jruby/ir/persistence/IRReader.java
  44. +50 −0 core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
  45. +0 −20 core/src/main/java/org/jruby/ir/targets/Bootstrap.java
  46. +25 −1 core/src/main/java/org/jruby/ir/targets/ConstantLookupSite.java
  47. +16 −3 core/src/main/java/org/jruby/ir/targets/DRegexpObjectSite.java
  48. +145 −83 core/src/main/java/org/jruby/ir/targets/IRBytecodeAdapter6.java
  49. +2 −16 core/src/main/java/org/jruby/ir/targets/IRBytecodeAdapter7.java
  50. +12 −7 core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
  51. +1 −1 core/src/main/java/org/jruby/javasupport/Java.java
  52. +14 −12 core/src/main/java/org/jruby/javasupport/binding/ClassInitializer.java
  53. +76 −49 core/src/main/java/org/jruby/javasupport/binding/Initializer.java
  54. +9 −7 core/src/main/java/org/jruby/javasupport/binding/InterfaceInitializer.java
  55. +0 −5 core/src/main/java/org/jruby/parser/Parser.java
  56. +39 −15 core/src/main/java/org/jruby/parser/ParserConfiguration.java
  57. +16 −14 core/src/main/java/org/jruby/parser/ParserSupport.java
  58. +8 −3 core/src/main/java/org/jruby/runtime/CallType.java
  59. +10 −10 core/src/main/java/org/jruby/runtime/Helpers.java
  60. +1 −1 core/src/main/java/org/jruby/runtime/InterpretedIRBlockBody.java
  61. +1 −1 core/src/main/java/org/jruby/runtime/MixedModeIRBlockBody.java
  62. +13 −2 core/src/main/java/org/jruby/runtime/Signature.java
  63. +30 −33 core/src/main/java/org/jruby/runtime/ThreadContext.java
  64. +24 −2 core/src/main/java/org/jruby/runtime/backtrace/BacktraceData.java
  65. +46 −24 core/src/main/java/org/jruby/runtime/backtrace/RubyStackTraceElement.java
  66. +1 −11 core/src/main/java/org/jruby/runtime/opto/OptoFactory.java
  67. +10 −3 core/src/main/java/org/jruby/util/StringSupport.java
  68. +93 −46 core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java
  69. +2 −1 core/src/main/java/org/jruby/util/cli/Options.java
  70. +3 −2 core/src/main/java/org/jruby/util/cli/OutputStrings.java
  71. +21 −6 core/src/main/ruby/jruby/java/core_ext/kernel.rb
  72. +15 −11 core/src/main/ruby/jruby/java/java_ext/java.lang.rb
  73. +28 −4 core/src/test/java/org/jruby/exceptions/TestRaiseException.java
  74. +140 −36 core/src/test/java/org/jruby/test/TestRaiseException.java
  75. +8 −3 core/src/test/java/org/jruby/test/TestRubyBase.java
  76. +1 −1 lib/ruby/stdlib/rubygems.rb
  77. +8 −5 lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb
  78. +1 −1 lib/ruby/truffle/jruby+truffle/bin/jruby+truffle
  79. +7 −0 lib/ruby/truffle/jruby+truffle/gem_ci/algebrick.rb
  80. +1 −0 lib/ruby/truffle/jruby+truffle/gem_ci/travis.txt
  81. +1 −1 lib/ruby/truffle/jruby+truffle/gem_configurations/activesupport.yaml
  82. +16 −9 lib/ruby/truffle/jruby+truffle/lib/runner.rb
  83. +3 −0 lib/ruby/truffle/shims/openssl-stubs.rb
  84. +1 −1 pom.rb
  85. +1 −1 pom.xml
  86. +5 −1 spec/compiler/general_spec.rb
  87. +3 −3 spec/java_integration/scala/singleton_spec.rb
  88. +25 −0 spec/ruby/core/thread/backtrace_spec.rb
  89. +20 −0 spec/ruby/language/class_variable_spec.rb
  90. +19 −4 test/jruby/test_caller.rb
  91. +38 −50 test/jruby/test_command_line_switches.rb
  92. +9 −3 test/jruby/test_helper.rb
  93. +0 −2 test/mri/excludes/TestCoverage.rb
  94. +0 −4 test/mri/excludes/TestRubyOptions.rb
  95. +13 −2 test/mri/ruby/test_rubyoptions.rb
  96. +4 −4 test/truffle/compiler/attachments-optimise/attachments-optimise.rb
  97. +3 −0 test/truffle/compiler/stf-optimises.sh
  98. +40 −0 test/truffle/compiler/stf-optimises/stf-optimises.rb
  99. +3 −0 test/truffle/compiler/tp-optimises.sh_excluded
  100. +40 −0 test/truffle/compiler/tp-optimises/tp-optimises.rb
  101. 0 test/truffle/integration/{instrumentation-server.sh → instrumentation-server.sh_excluded}
  102. +2 −0 test/truffle/integration/long-tests.txt
  103. +4 −4 test/truffle/integration/tracing/binding.trace
  104. +2 −2 test/truffle/integration/tracing/simple.trace
  105. +19 −12 tool/jt.rb
  106. +1 −0 truffle/pom.rb
  107. +1 −0 truffle/pom.xml
  108. +11 −0 truffle/src/main/java/org/jruby/truffle/RubyContext.java
  109. +11 −0 truffle/src/main/java/org/jruby/truffle/RubyLanguage.java
  110. +4 −0 truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
  111. +3 −0 truffle/src/main/java/org/jruby/truffle/core/Layouts.java
  112. +0 −115 truffle/src/main/java/org/jruby/truffle/core/RubyMethodForeignAccessFactory.java
  113. +0 −116 truffle/src/main/java/org/jruby/truffle/core/array/ArrayForeignAccessFactory.java
  114. +2 −9 truffle/src/main/java/org/jruby/truffle/core/array/ArrayNodes.java
  115. +0 −117 truffle/src/main/java/org/jruby/truffle/core/basicobject/BasicForeignAccessFactory.java
  116. +4 −3 truffle/src/main/java/org/jruby/truffle/core/exception/ExceptionNodes.java
  117. +0 −125 truffle/src/main/java/org/jruby/truffle/core/hash/HashForeignAccessFactory.java
  118. +100 −77 truffle/src/main/java/org/jruby/truffle/core/kernel/TraceManager.java
  119. +24 −33 truffle/src/main/java/org/jruby/truffle/core/module/ModuleFields.java
  120. +1 −1 truffle/src/main/java/org/jruby/truffle/core/module/ModuleNodes.java
  121. +27 −5 truffle/src/main/java/org/jruby/truffle/core/module/ModuleOperations.java
  122. +2 −2 truffle/src/main/java/org/jruby/truffle/core/numeric/FloatNodes.java
  123. +10 −1 truffle/src/main/java/org/jruby/truffle/core/rope/ConcatRope.java
  124. +63 −109 truffle/src/main/java/org/jruby/truffle/core/rope/RopeNodes.java
  125. +11 −0 truffle/src/main/java/org/jruby/truffle/core/rope/RopeTable.java
  126. +9 −0 truffle/src/main/java/org/jruby/truffle/core/rope/SubstringRope.java
  127. +3 −2 truffle/src/main/java/org/jruby/truffle/core/rubinius/PosixNodes.java
  128. +4 −4 truffle/src/main/java/org/jruby/truffle/core/rubinius/StringPrimitiveNodes.java
  129. +14 −7 truffle/src/main/java/org/jruby/truffle/core/string/CoreString.java
  130. +6 −0 truffle/src/main/java/org/jruby/truffle/core/string/CoreStrings.java
  131. +0 −117 truffle/src/main/java/org/jruby/truffle/core/string/StringForeignAccessFactory.java
  132. +17 −17 truffle/src/main/java/org/jruby/truffle/core/string/StringNodes.java
  133. +13 −5 truffle/src/main/java/org/jruby/truffle/core/thread/ThreadNodes.java
  134. +87 −0 truffle/src/main/java/org/jruby/truffle/core/tracepoint/TracePointEventNode.java
  135. +62 −0 truffle/src/main/java/org/jruby/truffle/core/tracepoint/TracePointLayout.java
  136. +229 −0 truffle/src/main/java/org/jruby/truffle/core/tracepoint/TracePointNodes.java
  137. +3 −3 truffle/src/main/java/org/jruby/truffle/extra/AttachmentsManager.java
  138. +86 −0 truffle/src/main/java/org/jruby/truffle/interop/ExecuteMethodNode.java
  139. +44 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignExecuteNode.java
  140. +49 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignGetSizeNode.java
  141. +28 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignHasSizeNode.java
  142. +45 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignInvokeNode.java
  143. +32 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignIsBoxedNode.java
  144. +32 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignIsExecutableNode.java
  145. +44 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignIsNullNode.java
  146. +48 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignReadNode.java
  147. +32 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignUnboxNode.java
  148. +45 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignWriteNode.java
  149. +31 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropExecute.java
  150. +42 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropInstanceVariableReadNode.java
  151. +42 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropInstanceVariableWriteNode.java
  152. +0 −745 truffle/src/main/java/org/jruby/truffle/interop/InteropNode.java
  153. +47 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropReadStringByteNode.java
  154. +49 −0 truffle/src/main/java/org/jruby/truffle/interop/ResolvedInteropExecuteAfterReadNode.java
  155. +41 −0 truffle/src/main/java/org/jruby/truffle/interop/ResolvedInteropIndexedReadNode.java
  156. +44 −0 truffle/src/main/java/org/jruby/truffle/interop/ResolvedInteropIndexedWriteNode.java
  157. +45 −0 truffle/src/main/java/org/jruby/truffle/interop/ResolvedInteropReadFromSymbolNode.java
  158. +44 −0 truffle/src/main/java/org/jruby/truffle/interop/ResolvedInteropReadNode.java
  159. +49 −0 truffle/src/main/java/org/jruby/truffle/interop/ResolvedInteropWriteNode.java
  160. +51 −0 truffle/src/main/java/org/jruby/truffle/interop/ResolvedInteropWriteToSymbolNode.java
  161. +31 −0 truffle/src/main/java/org/jruby/truffle/interop/RubyInteropArgumentNode.java
  162. +27 −0 truffle/src/main/java/org/jruby/truffle/interop/RubyInteropReceiverNode.java
  163. +1 −2 truffle/src/main/java/org/jruby/truffle/interop/TargetableRubyNode.java
  164. +39 −0 truffle/src/main/java/org/jruby/truffle/interop/UnresolvedInteropExecuteAfterReadNode.java
  165. +66 −0 truffle/src/main/java/org/jruby/truffle/interop/UnresolvedInteropReadNode.java
  166. +55 −0 truffle/src/main/java/org/jruby/truffle/interop/UnresolvedInteropStringReadNode.java
  167. +62 −0 truffle/src/main/java/org/jruby/truffle/interop/UnresolvedInteropWriteNode.java
  168. +3 −2 truffle/src/main/java/org/jruby/truffle/language/Options.java
  169. +7 −3 truffle/src/main/java/org/jruby/truffle/language/RubyConstant.java
  170. +4 −0 truffle/src/main/java/org/jruby/truffle/language/RubyGuards.java
  171. +11 −4 truffle/src/main/java/org/jruby/truffle/language/RubyNode.java
  172. +5 −19 truffle/src/main/java/org/jruby/truffle/language/RubyObjectType.java
  173. +29 −90 truffle/src/main/java/org/jruby/truffle/language/backtrace/BacktraceFormatter.java
  174. +12 −1 truffle/src/main/java/org/jruby/truffle/language/methods/ModuleBodyDefinitionNode.java
  175. +3 −3 truffle/src/main/java/org/jruby/truffle/stdlib/CoverageManager.java
  176. +1 −1 truffle/src/main/java/org/jruby/truffle/tools/simpleshell/SimpleShell.java
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ sudo: false

before_script:
- export MAVEN_SKIP_RC=true
- export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=512m"
- export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"
- unset GEM_PATH GEM_HOME IRBRC JRUBY_OPTS
- "export PATH=`pwd`/bin:$PATH"
- echo $HOME
@@ -22,13 +22,15 @@ os:

env:
global:
- JAVA_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx512M"
- MALLOC_ARENA_MAX=2
matrix:
- JT='test specs :language'
- JT='test specs :core'
- JT='test specs :library'
- JT='test specs :truffle'
- JT='test integration'
- JT='test integration fast'
- JT='test integration long' JAVA_OPTS="$JAVA_OPTS -Xmx512m"

matrix:
include:
6 changes: 1 addition & 5 deletions bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -91,10 +91,6 @@ if [ -z "$JAVACMD" ] ; then
fi
fi

if [ -z "$JAVA_MEM" ] ; then
JAVA_MEM=-Xmx500m
fi

if [ -z "$JAVA_STACK" ] ; then
JAVA_STACK=-Xss2048k
fi
@@ -250,11 +246,11 @@ do
# Pass -X... and -X? search options through
-X*\.\.\.|-X*\?)
ruby_args=("${ruby_args[@]}" "$1") ;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X+T)
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
ruby_args=("${ruby_args[@]}" "-X+T")
;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
if expr "$val" : '.*[.]' > /dev/null; then
2 changes: 1 addition & 1 deletion bin/jruby.sh
Original file line number Diff line number Diff line change
@@ -196,11 +196,11 @@ do
# Pass -X... and -X? search options through
-X*\.\.\.|-X*\?)
ruby_args="${ruby_args} $1" ;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X+T)
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
ruby_args="${ruby_args} -X+T"
;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
if expr "$val" : '.*[.]' > /dev/null; then
2 changes: 1 addition & 1 deletion core/pom.rb
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@
jar 'com.github.jnr:jnr-x86asm:1.0.2', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.12', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.29', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-constants:0.9.1', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-constants:0.9.2-SNAPSHOT', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-ffi:2.0.9'
jar 'com.github.jnr:jffi:${jffi.version}'
jar 'com.github.jnr:jffi:${jffi.version}:native'
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-constants</artifactId>
<version>0.9.1</version>
<version>0.9.2-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
32 changes: 19 additions & 13 deletions core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -358,21 +358,32 @@ private Status handleOutOfMemory(OutOfMemoryError oome) {
System.gc(); // try to clean up a bit of space, hopefully, so we can report this error

String oomeMessage = oome.getMessage();
boolean heapError = false;

if (oomeMessage != null) {
if (oomeMessage.contains("PermGen")) {
// report permgen memory error
config.getError().println("Error: Your application exhausted PermGen area of the heap.");
config.getError().println("Specify -J-XX:MaxPermSize=###M to increase it (### = PermGen size in MB).");
} else if (oomeMessage.contains("unable to create new native thread")) {
// report thread exhaustion error
config.getError().println("Error: Your application demanded too many live threads, perhaps for Fiber or Enumerator.");
config.getError().println("Ensure your old Fibers and Enumerators are being cleaned up.");
} else {
heapError = true;
}
}

if (oomeMessage != null && oomeMessage.contains("PermGen")) { // report permgen memory error
config.getError().println("Error: Your application exhausted PermGen area of the heap.");
config.getError().println("Specify -J-XX:MaxPermSize=###M to increase it (### = PermGen size in MB).");

} else { // report heap memory error
if (heapError) { // report heap memory error

String memoryMax = getRuntimeFlagValue("-Xmx");

if (memoryMax != null) {
config.getError().println("Error: Your application used more memory than the safety cap of " + memoryMax + ".");
} else {
config.getError().println("Error: Your application used more memory than the default safety cap.");
config.getError().println("Error: Your application used more memory than the automatic cap of " + Runtime.getRuntime().maxMemory() / 1024 / 1024 + "MB.");
}
config.getError().println("Specify -J-Xmx####m to increase it (#### = cap size in MB).");
config.getError().println("Specify -J-Xmx####M to increase it (#### = cap size in MB).");
}

if (config.isVerbose()) {
@@ -399,7 +410,7 @@ private String getRuntimeFlagValue(String prefix) {

private Status handleMainExit(MainExitException mee) {
if (!mee.isAborted()) {
config.getOutput().println(mee.getMessage());
config.getError().println(mee.getMessage());
if (mee.isUsageError()) {
doPrintUsage(true);
}
@@ -408,7 +419,6 @@ private Status handleMainExit(MainExitException mee) {
}

private Status doRunFromMain(Ruby runtime, InputStream in, String filename) {
long now = -1;
try {
doCheckSecurityManager();

@@ -474,10 +484,6 @@ private void doSetContextClassLoader(Ruby runtime) {
}
}

private void doProcessArguments(InputStream in) {
config.processArguments(config.parseShebangOptions(in));
}

private void doPrintProperties() {
if (config.getShouldPrintProperties()) {
config.getOutput().print(OutputStrings.getPropertyHelp());
8 changes: 8 additions & 0 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@
package org.jruby;

import org.jcodings.specific.UTF8Encoding;
import org.jruby.anno.TypePopulator;
import org.jruby.ast.ArrayNode;
import org.jruby.ast.BlockNode;
import org.jruby.ast.CallNode;
@@ -5290,4 +5291,11 @@ public void addToObjectSpace(boolean useObjectSpace, IRubyObject object) {
* The nullToNil filter for this runtime.
*/
private MethodHandle nullToNil;

public final ClassValue<TypePopulator> POPULATORS = new ClassValue<TypePopulator>() {
@Override
protected TypePopulator computeValue(Class<?> type) {
return RubyModule.loadPopulatorFor(type);
}
};
}
14 changes: 12 additions & 2 deletions core/src/main/java/org/jruby/RubyClass.java
Original file line number Diff line number Diff line change
@@ -1968,12 +1968,22 @@ private CS_NAMES(String id) {
this.id = id;
}

private static final CS_NAMES[] VALUES = values();
public static final int length = VALUES.length;

public static CS_NAMES fromOrdinal(int ordinal) {
if (ordinal < 0 || ordinal >= VALUES.length) {
throw new RuntimeException("invalid rest: " + ordinal);
}
return VALUES[ordinal];
}

public final String id;
};
private final CallSite[] baseCallSites = new CallSite[CS_NAMES.values().length];
private final CallSite[] baseCallSites = new CallSite[CS_NAMES.length];
{
for(int i = 0; i < baseCallSites.length; i++) {
baseCallSites[i] = MethodIndex.getFunctionalCallSite(CS_NAMES.values()[i].id);
baseCallSites[i] = MethodIndex.getFunctionalCallSite(CS_NAMES.fromOrdinal(i).id);
}
}

25 changes: 16 additions & 9 deletions core/src/main/java/org/jruby/RubyDir.java
Original file line number Diff line number Diff line change
@@ -812,24 +812,31 @@ public static IRubyObject getHomeDirectoryPath(ThreadContext context, String use
throw runtime.newArgumentError("user " + user + " doesn't exist");
}

static final ByteList HOME = new ByteList(new byte[] {'H','O','M','E'}, false);

public static RubyString getHomeDirectoryPath(ThreadContext context) {
Ruby runtime = context.runtime;
IRubyObject systemHash = runtime.getObject().getConstant("ENV_JAVA");
RubyHash envHash = (RubyHash) runtime.getObject().getConstant("ENV");
IRubyObject home = envHash.op_aref(context, runtime.newString("HOME"));
final RubyString homeKey = RubyString.newStringShared(context.runtime, HOME);
return getHomeDirectoryPath(context, context.runtime.getENV().op_aref(context, homeKey));
}

if (home == null || home.isNil()) {
home = systemHash.callMethod(context, "[]", runtime.newString("user.home"));
static RubyString getHomeDirectoryPath(ThreadContext context, IRubyObject home) {
final Ruby runtime = context.runtime;

if (home == null || home == context.nil) {
IRubyObject ENV_JAVA = runtime.getObject().getConstant("ENV_JAVA");
home = ENV_JAVA.callMethod(context, "[]", runtime.newString("user.home"));
}

if (home == null || home.isNil()) {
home = envHash.op_aref(context, runtime.newString("LOGDIR"));
if (home == null || home == context.nil) {
RubyHash ENV = (RubyHash) runtime.getObject().getConstant("ENV");
home = ENV.op_aref(context, runtime.newString("LOGDIR"));
}

if (home == null || home.isNil()) {
if (home == null || home == context.nil) {
throw runtime.newArgumentError("user.home/LOGDIR not set");
}

return (RubyString) home;
}

}
13 changes: 12 additions & 1 deletion core/src/main/java/org/jruby/RubyEnumerator.java
Original file line number Diff line number Diff line change
@@ -700,7 +700,18 @@ public synchronized IRubyObject peek() {
}

private void ensureStarted() {
if (thread == null) future = runtime.getFiberExecutor().submit(this);
try {
if (thread == null) future = runtime.getFiberExecutor().submit(this);
} catch (OutOfMemoryError oome) {
String oomeMessage = oome.getMessage();
if (oomeMessage != null && oomeMessage.contains("unable to create new native thread")) {
// try to clean out stale enumerator threads by forcing GC
System.gc();
future = runtime.getFiberExecutor().submit(this);
} else {
throw oome;
}
}
}

private IRubyObject peekTake() {
Loading