1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/benchmark
ko1 5ee9513a71 Lazy Proc allocation for block parameters
[Feature #14045]

* insns.def (getblockparam, setblockparam): add special access
  instructions for block parameters.
  getblockparam checks VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM and
  if it is not set this instruction creates a Proc object from
  a given blcok and set VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM.
  setblockparam is similar to setlocal, but set
  VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM.

* compile.c: use get/setblockparm instead get/setlocal instructions.
  Note that they are used for method local block parameters (def m(&b)),
  not for block local method parameters (iter{|&b|).

* proc.c (get_local_variable_ptr): creates Proc object for
  Binding#local_variable_get/set.

* safe.c (safe_setter): we need to create Proc objects for postponed
  block parameters when $SAFE is changed.

* vm_args.c (args_setup_block_parameter): used only for block local blcok
  parameters.

* vm_args.c (vm_caller_setup_arg_block): if called with
  VM_CALL_ARGS_BLOCKARG_BLOCKPARAM flag then passed block values should be
  a block handler.

* test/ruby/test_optimization.rb: add tests.

* benchmark/bm_vm1_blockparam*: added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:13:49 +00:00
..
gc
other-lang
bm_app_answer.rb
bm_app_aobench.rb
bm_app_erb.rb
bm_app_factorial.rb
bm_app_fib.rb
bm_app_lc_fizzbuzz.rb
bm_app_mandelbrot.rb
bm_app_pentomino.rb
bm_app_raise.rb
bm_app_strconcat.rb
bm_app_tak.rb
bm_app_tarai.rb
bm_app_uri.rb
bm_array_sample_100k_10.rb
bm_array_sample_100k_11.rb
bm_array_sample_100k__1k.rb
bm_array_sample_100k__6k.rb
bm_array_sample_100k__100.rb
bm_array_sample_100k___10k.rb
bm_array_sample_100k___50k.rb
bm_array_shift.rb
bm_array_small_and.rb
bm_array_small_diff.rb
bm_array_small_or.rb
bm_array_sort_block.rb
bm_array_sort_float.rb
bm_bighash.rb
bm_dir_empty_p.rb Dir.empty? releases GVL 2017-10-04 00:04:51 +00:00
bm_erb_render.rb
bm_file_chmod.rb file.c: apply2files releases GVL 2017-10-24 01:20:04 +00:00
bm_file_rename.rb File#rename releases GVL 2017-10-01 21:19:24 +00:00
bm_hash_aref_dsym.rb
bm_hash_aref_dsym_long.rb
bm_hash_aref_fix.rb
bm_hash_aref_flo.rb
bm_hash_aref_miss.rb
bm_hash_aref_str.rb
bm_hash_aref_sym.rb
bm_hash_aref_sym_long.rb
bm_hash_flatten.rb
bm_hash_ident_flo.rb
bm_hash_ident_num.rb
bm_hash_ident_obj.rb
bm_hash_ident_str.rb
bm_hash_ident_sym.rb
bm_hash_keys.rb
bm_hash_long.rb
bm_hash_shift.rb
bm_hash_shift_u16.rb
bm_hash_shift_u24.rb
bm_hash_shift_u32.rb
bm_hash_small2.rb
bm_hash_small4.rb
bm_hash_small8.rb
bm_hash_to_proc.rb
bm_hash_values.rb
bm_int_quo.rb
bm_io_copy_stream_write.rb
bm_io_copy_stream_write_socket.rb
bm_io_file_create.rb
bm_io_file_read.rb
bm_io_file_write.rb
bm_io_nonblock_noex.rb
bm_io_nonblock_noex2.rb
bm_io_pipe_rw.rb
bm_io_select.rb
bm_io_select2.rb
bm_io_select3.rb
bm_loop_for.rb
bm_loop_generator.rb
bm_loop_times.rb
bm_loop_whileloop.rb
bm_loop_whileloop2.rb
bm_marshal_dump_flo.rb
bm_marshal_dump_load_geniv.rb
bm_marshal_dump_load_time.rb
bm_require.rb
bm_require_thread.rb
bm_securerandom.rb
bm_so_ackermann.rb
bm_so_array.rb
bm_so_binary_trees.rb
bm_so_concatenate.rb
bm_so_count_words.rb
bm_so_exception.rb
bm_so_fannkuch.rb
bm_so_fasta.rb
bm_so_k_nucleotide.rb
bm_so_lists.rb
bm_so_mandelbrot.rb
bm_so_matrix.rb
bm_so_meteor_contest.rb
bm_so_nbody.rb
bm_so_nested_loop.rb
bm_so_nsieve.rb
bm_so_nsieve_bits.rb
bm_so_object.rb
bm_so_partial_sums.rb
bm_so_pidigits.rb
bm_so_random.rb
bm_so_reverse_complement.rb
bm_so_sieve.rb
bm_so_spectralnorm.rb
bm_string_index.rb string.c: avoid unnecessary call of str_strlen() 2017-10-01 13:44:49 +00:00
bm_string_scan_re.rb
bm_string_scan_str.rb
bm_time_subsec.rb
bm_vm1_attr_ivar.rb
bm_vm1_attr_ivar_set.rb
bm_vm1_block.rb
bm_vm1_blockparam.rb Lazy Proc allocation for block parameters 2017-10-24 11:13:49 +00:00
bm_vm1_blockparam_call.rb Lazy Proc allocation for block parameters 2017-10-24 11:13:49 +00:00
bm_vm1_blockparam_pass.rb Lazy Proc allocation for block parameters 2017-10-24 11:13:49 +00:00
bm_vm1_blockparam_yield.rb Lazy Proc allocation for block parameters 2017-10-24 11:13:49 +00:00
bm_vm1_const.rb
bm_vm1_ensure.rb
bm_vm1_float_simple.rb
bm_vm1_gc_short_lived.rb
bm_vm1_gc_short_with_complex_long.rb
bm_vm1_gc_short_with_long.rb
bm_vm1_gc_short_with_symbol.rb
bm_vm1_gc_wb_ary.rb
bm_vm1_gc_wb_ary_promoted.rb
bm_vm1_gc_wb_obj.rb
bm_vm1_gc_wb_obj_promoted.rb
bm_vm1_ivar.rb
bm_vm1_ivar_set.rb
bm_vm1_length.rb
bm_vm1_lvar_init.rb
bm_vm1_lvar_set.rb
bm_vm1_neq.rb
bm_vm1_not.rb
bm_vm1_rescue.rb
bm_vm1_simplereturn.rb
bm_vm1_swap.rb
bm_vm1_yield.rb
bm_vm2_array.rb
bm_vm2_bigarray.rb
bm_vm2_bighash.rb
bm_vm2_case.rb
bm_vm2_case_lit.rb
bm_vm2_defined_method.rb
bm_vm2_dstr.rb
bm_vm2_eval.rb
bm_vm2_fiber_switch.rb
bm_vm2_method.rb
bm_vm2_method_missing.rb
bm_vm2_method_with_block.rb
bm_vm2_module_ann_const_set.rb
bm_vm2_module_const_set.rb
bm_vm2_mutex.rb
bm_vm2_newlambda.rb
bm_vm2_poly_method.rb
bm_vm2_poly_method_ov.rb
bm_vm2_poly_singleton.rb
bm_vm2_proc.rb
bm_vm2_raise1.rb
bm_vm2_raise2.rb
bm_vm2_regexp.rb
bm_vm2_send.rb
bm_vm2_string_literal.rb
bm_vm2_struct_big_aref_hi.rb
bm_vm2_struct_big_aref_lo.rb
bm_vm2_struct_big_aset.rb
bm_vm2_struct_big_href_hi.rb
bm_vm2_struct_big_href_lo.rb
bm_vm2_struct_big_hset.rb
bm_vm2_struct_small_aref.rb
bm_vm2_struct_small_aset.rb
bm_vm2_struct_small_href.rb
bm_vm2_struct_small_hset.rb
bm_vm2_super.rb
bm_vm2_unif1.rb
bm_vm2_zsuper.rb
bm_vm3_backtrace.rb
bm_vm3_clearmethodcache.rb
bm_vm3_gc.rb
bm_vm3_gc_old_full.rb
bm_vm3_gc_old_immediate.rb
bm_vm3_gc_old_lazy.rb
bm_vm_symbol_block_pass.rb
bm_vm_thread_alive_check1.rb
bm_vm_thread_close.rb
bm_vm_thread_condvar1.rb
bm_vm_thread_condvar2.rb
bm_vm_thread_create_join.rb
bm_vm_thread_mutex1.rb
bm_vm_thread_mutex2.rb
bm_vm_thread_mutex3.rb
bm_vm_thread_pass.rb
bm_vm_thread_pass_flood.rb
bm_vm_thread_pipe.rb
bm_vm_thread_queue.rb
bm_vm_thread_sized_queue.rb
bm_vm_thread_sized_queue2.rb
bm_vm_thread_sized_queue3.rb
bm_vm_thread_sized_queue4.rb
driver.rb driver.rb: allow executing driver.rb directly 2017-10-21 15:45:32 +00:00
make_fasta_output.rb
memory_wrapper.rb
prepare_require.rb
prepare_require_thread.rb
prepare_so_count_words.rb
prepare_so_k_nucleotide.rb
prepare_so_reverse_complement.rb
report.rb
run.rb
runc.rb
wc.input.base