path: root/ruby.c
diff options
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 22:52:59 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 22:52:59 +0000
commite4198a73d406d9a9f61a6db2d2a243c0f5267679 (patch)
treee77fa8d9817f9ff7c53864e373784f902b4368c1 /ruby.c
parent6053426a669386353a6b7fe11f3d3ea8d3c11e7c (diff)
* make rb_iseq_t T_IMEMO object (type is imemo_iseq).
All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data. * compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE). * eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq). * ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq. * gc.c: check T_IMEMO/iseq. * internal.h: add imemo_type::imemo_iseq. * iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_.... * load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq). * method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq). * vm_core.h (GetISeqPtr): removed because it is not T_DATA now. * vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721]. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
1 files changed, 3 insertions, 3 deletions
diff --git a/ruby.c b/ruby.c
index 9167b68..d74451f 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1305,7 +1305,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
NODE *tree = 0;
VALUE parser;
- VALUE iseq;
+ const rb_iseq_t *iseq;
rb_encoding *enc, *lenc;
const char *s;
char fbuf[MAXPATHLEN];
@@ -1544,7 +1544,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
if (opt->dump & DUMP_BIT(insns)) {
- rb_io_write(rb_stdout, rb_iseq_disasm(iseq));
+ rb_io_write(rb_stdout, rb_iseq_disasm((const rb_iseq_t *)iseq));
return Qtrue;
@@ -1555,7 +1555,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
- return iseq;
+ return (VALUE)iseq;
struct load_file_arg {