From 003fd99ab3172a0428e83e64a95bc51f97aa81f7 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 16 Nov 2017 07:25:30 +0000 Subject: provide rb_vm_make_proc/lambda(). * vm.c (rb_vm_make_proc): removed. * vm_core.h: provide utility inline functions * rb_vm_make_proc() * rb_vm_make_lambda() to call rb_vm_make_proc_lambda(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index cf763d46ec..d08880fe4a 100644 --- a/vm_core.h +++ b/vm_core.h @@ -1498,8 +1498,20 @@ int rb_ec_frame_method_id_and_class(const rb_execution_context_t *ec, ID *idp, I void rb_ec_setup_exception(const rb_execution_context_t *ec, VALUE mesg, VALUE cause); VALUE rb_vm_invoke_proc(rb_execution_context_t *ec, rb_proc_t *proc, int argc, const VALUE *argv, VALUE block_handler); + VALUE rb_vm_make_proc_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass, int8_t is_lambda); -VALUE rb_vm_make_proc(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass); +static inline VALUE +rb_vm_make_proc(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass) +{ + return rb_vm_make_proc_lambda(ec, captured, klass, 0); +} + +static inline VALUE +rb_vm_make_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass) +{ + return rb_vm_make_proc_lambda(ec, captured, klass, 1); +} + VALUE rb_vm_make_binding(const rb_execution_context_t *ec, const rb_control_frame_t *src_cfp); VALUE rb_vm_env_local_variables(const rb_env_t *env); const rb_env_t *rb_vm_env_prev_env(const rb_env_t *env); -- cgit v1.2.3