Граф коммитов

419 Коммитов

Автор SHA1 Сообщение Дата
mame 92b81dc597 make rb_iseq_new* accept rb_ast_body_t instead of NODE*
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05 08:59:22 +00:00
mame 503b858cef node.h: define rb_ast_body_t and restructure rb_ast_t
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05 08:59:20 +00:00
shyouhei b6a2d63eb3 explicit cast to void* required for %p
These functions take variadic arguments so no automatic type
promotion is expected.  You have to do it by hand.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02 06:41:40 +00:00
ko1 c39bdb798d `$SAFE` as a process global state. [Feature #14250]
* vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to
  `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state.

* vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc`
  objects don't need to keep `$SAFE` at the creation.
  Also make `is_from_method` and `is_lambda` as 1 bit fields.

* cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation.

* eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access
  `vm->safe_level_` directly.

* eval_jump.c: End procs `END{}` doesn't keep `$SAFE`.

* proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c.

* safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes.

* safe.c (safe_setter): use `rb_set_safe_level()`.

* thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`.
  It should be obsolete.

* transcode.c (load_transcoder_entry): `rb_safe_level()` only returns
  0 or 1 so that this check is not needed.

* vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc.

* vm.c (rb_proc_create): renamed to `proc_create`.

* vm.c (rb_proc_dup): moved from proc.c.

* vm.c (vm_invoke_proc): do not need to set and restore `$SAFE`
  for `Proc#call`.

* vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer
  meaning.

* lib/drb/drb.rb: restore `$SAFE`.

* lib/erb.rb: restore `$SAFE`, too.

* test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests.

* test/rubygems/test_gem.rb: do not set `$SAFE = 1`.

* bootstraptest/test_proc.rb: catch up this change.

* spec/ruby/optional/capi/string_spec.rb: ditto.

* test/bigdecimal/test_bigdecimal.rb: ditto.

* test/fiddle/test_func.rb: ditto.

* test/fiddle/test_handle.rb: ditto.

* test/net/imap/test_imap_response_parser.rb: ditto.

* test/pathname/test_pathname.rb: ditto.

* test/readline/test_readline.rb: ditto.

* test/ruby/test_file.rb: ditto.

* test/ruby/test_optimization.rb: ditto.

* test/ruby/test_proc.rb: ditto.

* test/ruby/test_require.rb: ditto.

* test/ruby/test_thread.rb: ditto.

* test/rubygems/test_gem_specification.rb: ditto.

* test/test_tempfile.rb: ditto.

* test/test_tmpdir.rb: ditto.

* test/win32ole/test_win32ole.rb: ditto.

* test/win32ole/test_win32ole_event.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-28 20:09:24 +00:00
nobu 8224002b81 vm_eval.c: expanded eval_string
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27 03:00:30 +00:00
nobu ed6680c1df vm_eval.c: split eval_string_with_cref
* vm_eval.c (eval_string_with_cref): split into cref and scope
  modes, which are exclusive.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27 02:55:16 +00:00
nobu 5f0dca59a3 vm_eval.c: refactor eval_make_iseq
* vm_eval.c (eval_make_iseq): moved preparations of location and
  debug print.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27 02:55:15 +00:00
nobu 3802fb92ff parse.y: warning for locations
* parse.y (gettable_gen): warn for __FILE__/__LINE__ when eval
  with binding only.  promote use of Binding#source_location
  instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-26 10:10:41 +00:00
nobu 62a3e7a33b vm_eval.c: strange message in eval
* vm_eval.c (eval_string_with_cref): remove unnecessary location
  from exception backtrace in eval.
  [ruby-core:84434] [Bug #14229]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-26 09:05:28 +00:00
k0kubun f5090e2f5c iseq.c: dump type of branchiftype on disasm
This makes easier to debug scripts related to r59950.

* before

$ ./ruby --dump=insns -e '"#{a}"'
== disasm: #<ISeq:<main>@-e>============================================
0000 putobject        ""                                              (   1)[Li]
0002 putself
0003 opt_send_without_block <callinfo!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE>, <callcache>
0006 dup
0007 branchiftype     5, 15
0010 dup
0011 opt_send_without_block <callinfo!mid:to_s, argc:0, FCALL|ARGS_SIMPLE>, <callcache>
0014 tostring
0015 concatstrings    2
0017 leave

* after

$ ./ruby --dump=insns -e '"#{a}"'
== disasm: #<ISeq:<main>@-e>============================================
0000 putobject        ""                                              (   1)[Li]
0002 putself
0003 opt_send_without_block <callinfo!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE>, <callcache>
0006 dup
0007 branchiftype     T_STRING, 15
0010 dup
0011 opt_send_without_block <callinfo!mid:to_s, argc:0, FCALL|ARGS_SIMPLE>, <callcache>
0014 tostring
0015 concatstrings    2
0017 leave

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13 16:07:52 +00:00
ko1 2c7e974e4f make a func static.
* vm_eval.c (rb_f_block_given_p): make it static.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-16 07:49:43 +00:00
ko1 1a7af9d0cd make a func static.
* vm_eval.c (rb_f_public_send): make it static.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-16 07:47:33 +00:00
ko1 3936aaa59b make a func static.
* vm_eval.c (rb_raise_method_missing): make this func static and renmae with
  vm_ prefix.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-16 07:38:41 +00:00
ko1 0c2746a7bb th->ec: dtrace
* vm.c (ruby_th_dtrace_setup): rename to rb_dtrace_setup()
  and accept `ec`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 08:19:25 +00:00
ko1 f1ad90a5e3 * vm_eval.c (rescue_funcall_args): th->ec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:39:02 +00:00
ko1 48ce4cb414 * eval_intern.h: rename macros rb_thread_raised_* to
rb_ec_raised_*.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:22:09 +00:00
ko1 af8a7df3b6 move `rb_thread_t::method_missing_reason` to ec.
* vm_core.h (rb_thread_t): move method_missing_reason to
  rb_execution_context_t.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:01:51 +00:00
ko1 5dfdaa9299 move rb_thread_t::interrupt_flag and mask
to rb_execution_context_t.

* vm_core.h (rb_thread_t): move
  `rb_thread_t::interrupt_flag` and
  `rb_thread_t::interrupt_mask` to rb_execution_context_t.

  RUBY_VM_CHECK_INTS() accepts `ec` instead of `th`.

* cont.c (rb_fiber_terminate): to propagate interrupt information,
  add new parameter `need_interrupt`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-06 07:44:28 +00:00
ko1 484cd5a13e * vm_eval.c (current_vm_stack_arg): accepts `ec`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 15:31:47 +00:00
ko1 9ffc0d19b7 * vm_eval.c (vm_catch_protect): accepts `ec` instead of `th`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 15:03:33 +00:00
ko1 d95acd784e use `GET_EC()`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 15:00:23 +00:00
ko1 502d8d7ccb use `GET_EC()`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 14:59:04 +00:00
ko1 881ac0a565 `th` -> `ec` for `rb_iterate0`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 14:55:19 +00:00
ko1 cf28dbc543 `th` -> `ec` for rb_raise_method_missing().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 14:52:05 +00:00
ko1 2ffa4d2394 `rb_call0()` accepts `ec`.
* vm_eval.c (rb_call0): accepts `ec`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 14:45:16 +00:00
ko1 01a935d478 * vm_eval.c (rb_current_receiver): use `GET_EC()`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 14:39:51 +00:00
ko1 bcdb02c8f4 `th` -> `ec` for vm_call_super().
* vm_eval.c (vm_call_super): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 14:38:25 +00:00
ko1 248d3d54a3 rb_ec_stack_check()
* gc.c (rb_ec_stack_check): renamed from rb_threadptr_stack_check()
  and it accepts `ec`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 13:49:45 +00:00
ko1 a288b87c4c EXEC_EVENT_HOOK(ec, ...)
* vm_core.h (EXEC_EVENT_HOOK): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 13:19:14 +00:00
ko1 ad1b64d35d `th` -> `ec` for backtrace functions.
* vm_backtrace.c: accept `ec` and rename `threadptr` to `ec`.
  * rb_threadptr_backtrace_object -> rb_ec_backtrace_object
  * rb_threadptr_backtrace_str_ary -> rb_ec_backtrace_str_ar
  * rb_threadptr_backtrace_location_ary -> rb_ec_backtrace_location_ary
  * threadptr_backtrace_to_ary -> ec_backtrace_to_ary

* vm_eval.c (adjust_backtrace_in_eval): accepts `ec`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 13:22:04 +00:00
ko1 7fa4beba91 `th` -> `ec` for method management functions.
* vm_eval.c: `th` -> `ec` for the following functions:
  * check_funcall_respond_to
  * check_funcall_callable
  * check_funcall_missing
  * rb_method_call_status

* vm_method.c: ditto.
  * call_method_entry
  * basic_obj_respond_to_missing
  * basic_obj_respond_to
  * vm_respond_to

* vm_eval.c (stack_check): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 12:23:51 +00:00
ko1 ed21061f21 `th` -> `ec` for rb_vm_call()
* vm_eval.c (rb_vm_call): accepts `ec` instead of `th`.

* proc.c: catch up this fix.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 11:52:56 +00:00
ko1 9ca5088428 `th` -> `ec` for rb_vm_rewind_cfp.
* vm.c (rb_vm_rewind_cfp): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 10:43:30 +00:00
ko1 796e1990be `th` -> `ec` for vm_exec().
* vm.c (vm_exec): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 10:35:55 +00:00
ko1 9c4542dbaa `th` -> `ec` for vm_set_*_stack.
* vm.c: `th` -> `ec` for the following functions:
  * vm_set_top_stack
  * vm_set_eval_stack
  * vm_set_main_stack
  * vm_cref_new_toplevel


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 10:23:58 +00:00
ko1 f8a9d044f4 move fields from `th` to `ec`.
* vm_core.h: move rb_thread_t::passed_block_handler to
  rb_execution_context_t::passed_block_handler.
  Also move rb_thread_t::passed_bmethod_me to
  rb_execution_context_t::passed_bmethod_me.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 10:01:54 +00:00
ko1 88910e94a8 `th` -> `ec` for block related functions.
* vm.c: the following functions accept `ec` instead of `th`.
  * invoke_block
  * invoke_bmethod
  * invoke_iseq_block_from_c
  * invoke_block_from_c_bh
  * check_block_handler
  * vm_yield_with_cref
  * vm_yield
  * vm_yield_with_block
  * vm_yield_force_blockarg
  * invoke_block_from_c_proc
  * vm_invoke_proc
  * vm_invoke_bmethod
  * rb_vm_invoke_proc

* vm_insnhelper.c: ditto.
  * vm_yield_with_cfunc
  * vm_yield_with_symbol
  * vm_callee_setup_block_arg
  * vm_yield_setup_args
  * vm_invoke_iseq_block
  * vm_invoke_symbol_block
  * vm_invoke_ifunc_block
  * vm_invoke_block


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27 06:06:31 +00:00
ko1 c96f809729 `vm_call_handler` and related functions accept `ec` instead of `th`.
* vm_core.h (vm_call_handler): fix to accept `ec` instead of `th`.

* vm_args.c: the following functions accept `ec` instead of `th`.
  * raise_argument_error
  * argument_arity_error
  * argument_kw_error
  * setup_parameters_complex

* vm_eval.c: ditto.
  * vm_call0
  * vm_call0_cfunc_with_frame
  * vm_call0_cfunc
  * vm_call0_body

* vm_insnhelper.c: ditto
  * vm_call_iseq_setup_tailcall_0start
  * vm_call_iseq_setup_normal_0start
  * vm_callee_setup_arg
  * vm_call_iseq_setup
  * vm_call_iseq_setup_2
  * vm_call_iseq_setup_normal
  * vm_call_iseq_setup_tailcall
  * vm_cfp_consistent_p
  * vm_call_cfunc_with_frame
  * vm_call_cfunc
  * vm_call_ivar
  * vm_call_attrset
  * vm_call_bmethod_body
  * vm_call_bmethod
  * vm_call_opt_send
  * vm_call_opt_call
  * vm_call_method_missing
  * vm_call_zsuper
  * current_method_entry
  * vm_call_method_each_type
  * vm_call_method_nome
  * vm_call_method
  * vm_call_general
  * vm_call_super_method

* tool/mk_call_iseq_optimized.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27 02:49:30 +00:00
ko1 84e6a3d31c ec->th for vm_cref_push() and constify.
* vm_insnhelper.c (vm_cref_push): accepts `ec` instead of `th`.

* vm_insnhelper.c: consitfy the first parameter (ec):
  * lep_svar
  * lep_svar_write
  * lep_svar_get
  * lep_svar_set
  * vm_getspecial
  and added vm_cref_push.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27 01:31:15 +00:00
ko1 9d41e74398 refactoring (rb_|)threadptr_stack_overflow.
* vm_insnhelper.c (ec_stack_overflow): renamed from threadptr_stack_overflow
  and also rb_ec_stack_overflow is from rb_threadptr_stack_overflow
  because they accept `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27 01:13:35 +00:00
ko1 e47a687c83 vm_get_ruby_level_caller_cfp() accepts `ec` instead of `th`.
* vm.c (vm_get_ruby_level_caller_cfp): accepts `ec` instead of `th`.

* vm.c (vm_collect_local_variables_in_heap): don't need `th` anymore.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27 00:46:11 +00:00
ko1 4552f74715 introduce EC_*_TAG() instead of TH_*_TAG()
* eval_intern.h:
  introduce EC_*_TAG() macros instead of TH_*_TAG() macros.
  * TH_PUSH_TAG() -> EC_PUSH_TAG()
  * TH_POP_TAG() -> EC_POP_TAG()
  * TH_TMPPOP_TAG() -> EC_TMPPOP_TAG()
  * TH_REPUSH_TAG() -> EC_REPUSH_TAG()
  * TH_EXEC_TAG() -> EC_EXEC_TAG()
  * TH_JUMP_TAG() -> EC_JUMP_TAG()

  rb_threadptr_tag_state() , rb_ec_tag_jump() also accept `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 11:02:13 +00:00
ko1 284d4c08d6 vm_pop_frame() accepts `ec` instead of `th`.
* vm_insnhelper.c (vm_pop_frame): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 10:55:24 +00:00
ko1 9adf6064ce vm_push_frame() accepts `ec` instead of `th`.
* vm_insnhelper.c (vm_push_frame): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 10:53:42 +00:00
ko1 e95de48f1d some functions accept `ec` instead of `th`.
* vm.c (vm_make_env_object): accepts `ec`.

* vm.c (rb_vm_get_ruby_level_next_cfp): ditto.

* vm.c (rb_vm_make_proc): ditto.

* vm.c (rb_vm_make_proc_lambda): ditto.

* vm_core.h: some macros accept ec instead of th
  (and make them inline functions):
  * RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW
  * RUBY_VM_END_CONTROL_FRAME
  * RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P

* eval.c (frame_func_id): constify for the first parameter.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 08:41:34 +00:00
ko1 837fd5e494 Use rb_execution_context_t instead of rb_thread_t
to represent execution context [Feature #14038]

* vm_core.h (rb_thread_t): rb_thread_t::ec is now a pointer.
  There are many code using `th` to represent execution context
  (such as cfp, VM stack and so on). To access `ec`, they need to
  use `th->ec->...` (adding one indirection) so that we need to
  replace them by passing `ec` instead of `th`.

* vm_core.h (GET_EC()): introduced to access current ec. Also
  remove `ruby_current_thread` global variable.

* cont.c (rb_context_t): introduce rb_context_t::thread_ptr instead of
  rb_context_t::thread_value.

* cont.c (ec_set_vm_stack): added to update vm_stack explicitly.

* cont.c (ec_switch): added to switch ec explicitly.

* cont.c (rb_fiber_close): added to terminate fibers explicitly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 08:32:49 +00:00
nobu 49b25aaa22 vm_eval.c: all value type cases
* vm_eval.c (rb_type_str): ensure all value types are covered.
  missed types would be warned by -Wswitch option of gcc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 08:13:13 +00:00
nobu 184845f2cd vm_eval.c: uncallable_object
* vm_eval.c (uncallable_object): extract error case as a no-return
  function.  split successive ?-marks not to get confused with a
  trigraph.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 07:17:36 +00:00
glass f5740d18bf Revert "vm_eval.c: add rb_yield_assoc_or_values()"
This reverts commit r60095 to prevent performance degradation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-02 07:51:27 +00:00
glass 7ae65b24c2 vm_eval.c: add rb_yield_assoc_or_values()
The new function rb_yield_assoc_or_values() will reduce branching.

* vm_eval.c: add rb_yield_assoc_or_values()

* internal.h: ditto

* hash.c: use rb_yield_assoc_or_values()

* struct.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-02 05:29:11 +00:00