diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-03 04:43:07 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-03 04:43:07 +0000 |
commit | ef25be739196ce019f1918736151e0daa0e93f19 (patch) | |
tree | 7240be35b2b2e0a699fe10e81989776f0e8cb5b9 /vm_core.h | |
parent | 888e16c51ec6dd4b6aeb94cb44ee70e8f2d102b4 (diff) | |
download | ruby-ef25be739196ce019f1918736151e0daa0e93f19.tar.gz |
* vm_core.h: change semantics of opt_num and opt_table.
`opt_num' was the number of optional parameters + 1.
`opt_table' has "opt_num" entries.
Change them to:
`opt_num' is the number of optional parameters.
`opt_talbe' has "opt_num + 1" entries.
This change simplify parameter fitting logics.
* compile.c: catch up this change.
* iseq.c: ditto.
* proc.c: ditto.
* vm_args.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -252,7 +252,7 @@ struct rb_iseq_struct { * => * * lead_num = M - * opt_num = N+1 + * opt_num = N * rest_start = M+N * post_start = M+N+(*1) * post_num = O @@ -284,7 +284,20 @@ struct rb_iseq_struct { int post_num; int block_start; - VALUE *opt_table; + VALUE *opt_table; /* (opt_num + 1) entries. */ + /* opt_num and opt_table: + * + * def foo o1=e1, o2=e2, ..., oN=eN + * #=> + * # prologue code + * A1: e1 + * A2: e2 + * ... + * AN: eN + * AL: body + * opt_num = N + * opt_table = [A1, A2, ..., AN, AL] + */ struct rb_iseq_param_keyword { int num; |