Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. Index: lib/irb/slex.rb
  2. ===================================================================
  3. --- lib/irb/slex.rb (revision 57284)
  4. +++ lib/irb/slex.rb (revision 57293)
  5. @@ -53,7 +53,7 @@
  6. node.preproc=proc
  7. end
  8.  
  9. - #$BMW%A%'%C%/(B?
  10. + # need a check?
  11. def postproc(token)
  12. node = search(token, proc)
  13. node.postproc=proc
  14. Index: lib/getoptlong.rb
  15. ===================================================================
  16. --- lib/getoptlong.rb (revision 57284)
  17. +++ lib/getoptlong.rb (revision 57293)
  18. @@ -1,4 +1,4 @@
  19. -# frozen_string_literal: false
  20. +# frozen_string_literal: true
  21. #
  22. # GetoptLong for Ruby
  23. #
  24. Index: benchmark/driver.rb
  25. ===================================================================
  26. --- benchmark/driver.rb (revision 57284)
  27. +++ benchmark/driver.rb (revision 57293)
  28. @@ -41,10 +41,16 @@
  29. else
  30. h = eval(input.read)
  31. end
  32. + results = h[:results] || h["results"]
  33. obj = allocate
  34. obj.instance_variable_set("@execs", h[:executables] || h["executables"])
  35. - obj.instance_variable_set("@results", h[:results] || h["results"])
  36. + obj.instance_variable_set("@results", results)
  37. obj.instance_variable_set("@opt", opt)
  38. + [1, 2].each do |i|
  39. + loop = results.assoc((n = "loop_whileloop#{i}").intern) || results.assoc(n)
  40. + obj.instance_variable_set("@loop_wl#{i}", loop ? loop[1].map {|t,*|t} : nil)
  41. + end
  42. + obj.instance_variable_set("@measure_target", opt[:measure_target] || opt["measure_target"])
  43. obj
  44. end
  45.  
  46. @@ -153,7 +159,9 @@
  47. numformat = " %1$*2$.3f"
  48. end
  49.  
  50. - name_width ||= @results.map {|v,*| v.size}.max
  51. + name_width ||= @results.map {|v, result|
  52. + v.size + (case v; when /^vm1_/; @loop_wl1; when /^vm2_/; @loop_wl2; end ? 1 : 0)
  53. + }.max
  54. minwidth ||= 7
  55. width = @execs.map{|(_, v)| [v.size, minwidth].max}
  56.  
  57. @@ -413,7 +421,6 @@
  58. }
  59.  
  60. parser.parse!(ARGV)
  61. - opt[:output] ||= "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}#{formats[opt[:format]]}"
  62.  
  63. if input = opt[:rawdata_input]
  64. b = open(input) {|f|
  65. @@ -421,6 +428,7 @@
  66. }
  67. b.show_results
  68. else
  69. + opt[:output] ||= "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}#{formats[opt[:format]]}"
  70. BenchmarkDriver.benchmark(opt)
  71. end
  72. end
  73. Index: vm_insnhelper.c
  74. ===================================================================
  75. --- vm_insnhelper.c (revision 57284)
  76. +++ vm_insnhelper.c (revision 57293)
  77. @@ -1538,8 +1538,6 @@
  78. vm_pop_frame(th, cfp, cfp->ep);
  79. cfp = th->cfp;
  80.  
  81. - RUBY_VM_CHECK_INTS(th);
  82. -
  83. sp_orig = sp = cfp->sp;
  84.  
  85. /* push self */
  86. @@ -1558,6 +1556,8 @@
  87. iseq->body->stack_max);
  88.  
  89. cfp->sp = sp_orig;
  90. + RUBY_VM_CHECK_INTS(th);
  91. +
  92. return Qundef;
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement